1. Packages
  2. Vultr
  3. API Docs
  4. getBackup
Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien

vultr.getBackup

Explore with Pulumi AI

vultr logo
Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien

    Get information about a Vultr backup. This data source provides a list of backups which contain the description, size, status, and the creation date for your Vultr backup.

    Example Usage

    Get the information for a backup by description:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@pulumi/vultr";
    
    const myBackup = vultr.getBackup({
        filters: [{
            name: "description",
            values: ["my-backup-description"],
        }],
    });
    
    import pulumi
    import pulumi_vultr as vultr
    
    my_backup = vultr.get_backup(filters=[vultr.GetBackupFilterArgs(
        name="description",
        values=["my-backup-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.GetBackup(ctx, &vultr.GetBackupArgs{
    			Filters: []vultr.GetBackupFilter{
    				{
    					Name: "description",
    					Values: []string{
    						"my-backup-description",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vultr = Pulumi.Vultr;
    
    return await Deployment.RunAsync(() => 
    {
        var myBackup = Vultr.GetBackup.Invoke(new()
        {
            Filters = new[]
            {
                new Vultr.Inputs.GetBackupFilterInputArgs
                {
                    Name = "description",
                    Values = new[]
                    {
                        "my-backup-description",
                    },
                },
            },
        });
    
    });
    
    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.GetBackupArgs;
    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 myBackup = VultrFunctions.getBackup(GetBackupArgs.builder()
                .filters(GetBackupFilterArgs.builder()
                    .name("description")
                    .values("my-backup-description")
                    .build())
                .build());
    
        }
    }
    
    variables:
      myBackup:
        fn::invoke:
          Function: vultr:getBackup
          Arguments:
            filters:
              - name: description
                values:
                  - my-backup-description
    

    Using getBackup

    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 getBackup(args: GetBackupArgs, opts?: InvokeOptions): Promise<GetBackupResult>
    function getBackupOutput(args: GetBackupOutputArgs, opts?: InvokeOptions): Output<GetBackupResult>
    def get_backup(filters: Optional[Sequence[GetBackupFilter]] = None,
                   opts: Optional[InvokeOptions] = None) -> GetBackupResult
    def get_backup_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetBackupFilterArgs]]]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetBackupResult]
    func GetBackup(ctx *Context, args *GetBackupArgs, opts ...InvokeOption) (*GetBackupResult, error)
    func GetBackupOutput(ctx *Context, args *GetBackupOutputArgs, opts ...InvokeOption) GetBackupResultOutput

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

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

    The following arguments are supported:

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

    getBackup Result

    The following output properties are available:

    Backups List<ImmutableDictionary<string, object>>
    Id string
    The provider-assigned unique ID for this managed resource.
    Filters List<ediri.Vultr.Outputs.GetBackupFilter>
    Backups []map[string]interface{}
    Id string
    The provider-assigned unique ID for this managed resource.
    Filters []GetBackupFilter
    backups List<Map<String,Object>>
    id String
    The provider-assigned unique ID for this managed resource.
    filters List<GetBackupFilter>
    backups {[key: string]: any}[]
    id string
    The provider-assigned unique ID for this managed resource.
    filters GetBackupFilter[]
    backups Sequence[Mapping[str, Any]]
    id str
    The provider-assigned unique ID for this managed resource.
    filters Sequence[GetBackupFilter]
    backups List<Map<Any>>
    id String
    The provider-assigned unique ID for this managed resource.
    filters List<Property Map>

    Supporting Types

    GetBackupFilter

    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.21.1 published on Monday, Jul 22, 2024 by dirien