1. Packages
  2. Ucloud Provider
  3. API Docs
  4. getDbBackups
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.getDbBackups

Explore with Pulumi AI

ucloud logo
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

    This data source provides a list of database backups according to their name, availability zone and project.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const example = ucloud.getDbBackups({
        availabilityZone: "cn-bj2-05",
        nameRegex: "init.*",
    });
    export const backups = example.then(example => example.dbBackups);
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    example = ucloud.get_db_backups(availability_zone="cn-bj2-05",
        name_regex="init.*")
    pulumi.export("backups", example.db_backups)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ucloud.GetDbBackups(ctx, &ucloud.GetDbBackupsArgs{
    			AvailabilityZone: pulumi.StringRef("cn-bj2-05"),
    			NameRegex:        pulumi.StringRef("init.*"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("backups", example.DbBackups)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ucloud.GetDbBackups.Invoke(new()
        {
            AvailabilityZone = "cn-bj2-05",
            NameRegex = "init.*",
        });
    
        return new Dictionary<string, object?>
        {
            ["backups"] = example.Apply(getDbBackupsResult => getDbBackupsResult.DbBackups),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.UcloudFunctions;
    import com.pulumi.ucloud.inputs.GetDbBackupsArgs;
    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 example = UcloudFunctions.getDbBackups(GetDbBackupsArgs.builder()
                .availabilityZone("cn-bj2-05")
                .nameRegex("init.*")
                .build());
    
            ctx.export("backups", example.applyValue(getDbBackupsResult -> getDbBackupsResult.dbBackups()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ucloud:getDbBackups
          arguments:
            availabilityZone: cn-bj2-05
            nameRegex: init.*
    outputs:
      backups: ${example.dbBackups}
    

    Using getDbBackups

    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 getDbBackups(args: GetDbBackupsArgs, opts?: InvokeOptions): Promise<GetDbBackupsResult>
    function getDbBackupsOutput(args: GetDbBackupsOutputArgs, opts?: InvokeOptions): Output<GetDbBackupsResult>
    def get_db_backups(availability_zone: Optional[str] = None,
                       id: Optional[str] = None,
                       name_regex: Optional[str] = None,
                       output_file: Optional[str] = None,
                       project_id: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetDbBackupsResult
    def get_db_backups_output(availability_zone: Optional[pulumi.Input[str]] = None,
                       id: Optional[pulumi.Input[str]] = None,
                       name_regex: Optional[pulumi.Input[str]] = None,
                       output_file: Optional[pulumi.Input[str]] = None,
                       project_id: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetDbBackupsResult]
    func GetDbBackups(ctx *Context, args *GetDbBackupsArgs, opts ...InvokeOption) (*GetDbBackupsResult, error)
    func GetDbBackupsOutput(ctx *Context, args *GetDbBackupsOutputArgs, opts ...InvokeOption) GetDbBackupsResultOutput

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

    public static class GetDbBackups 
    {
        public static Task<GetDbBackupsResult> InvokeAsync(GetDbBackupsArgs args, InvokeOptions? opts = null)
        public static Output<GetDbBackupsResult> Invoke(GetDbBackupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDbBackupsResult> getDbBackups(GetDbBackupsArgs args, InvokeOptions options)
    public static Output<GetDbBackupsResult> getDbBackups(GetDbBackupsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ucloud:index/getDbBackups:getDbBackups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AvailabilityZone string
    Availability zone where database instances are located. Such as: "cn-bj2-02". You may refer to list of availability zone
    Id string
    NameRegex string
    A regex string to filter backups by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ProjectId string
    id of the projects to which the backups belong
    AvailabilityZone string
    Availability zone where database instances are located. Such as: "cn-bj2-02". You may refer to list of availability zone
    Id string
    NameRegex string
    A regex string to filter backups by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ProjectId string
    id of the projects to which the backups belong
    availabilityZone String
    Availability zone where database instances are located. Such as: "cn-bj2-02". You may refer to list of availability zone
    id String
    nameRegex String
    A regex string to filter backups by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    projectId String
    id of the projects to which the backups belong
    availabilityZone string
    Availability zone where database instances are located. Such as: "cn-bj2-02". You may refer to list of availability zone
    id string
    nameRegex string
    A regex string to filter backups by name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    projectId string
    id of the projects to which the backups belong
    availability_zone str
    Availability zone where database instances are located. Such as: "cn-bj2-02". You may refer to list of availability zone
    id str
    name_regex str
    A regex string to filter backups by name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    project_id str
    id of the projects to which the backups belong
    availabilityZone String
    Availability zone where database instances are located. Such as: "cn-bj2-02". You may refer to list of availability zone
    id String
    nameRegex String
    A regex string to filter backups by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    projectId String
    id of the projects to which the backups belong

    getDbBackups Result

    The following output properties are available:

    DbBackups List<GetDbBackupsDbBackup>
    It is a nested type which documented below.
    Id string
    TotalCount double
    Total number of database backups that satisfy the condition.
    AvailabilityZone string
    NameRegex string
    OutputFile string
    ProjectId string
    DbBackups []GetDbBackupsDbBackup
    It is a nested type which documented below.
    Id string
    TotalCount float64
    Total number of database backups that satisfy the condition.
    AvailabilityZone string
    NameRegex string
    OutputFile string
    ProjectId string
    dbBackups List<GetDbBackupsDbBackup>
    It is a nested type which documented below.
    id String
    totalCount Double
    Total number of database backups that satisfy the condition.
    availabilityZone String
    nameRegex String
    outputFile String
    projectId String
    dbBackups GetDbBackupsDbBackup[]
    It is a nested type which documented below.
    id string
    totalCount number
    Total number of database backups that satisfy the condition.
    availabilityZone string
    nameRegex string
    outputFile string
    projectId string
    db_backups Sequence[GetDbBackupsDbBackup]
    It is a nested type which documented below.
    id str
    total_count float
    Total number of database backups that satisfy the condition.
    availability_zone str
    name_regex str
    output_file str
    project_id str
    dbBackups List<Property Map>
    It is a nested type which documented below.
    id String
    totalCount Number
    Total number of database backups that satisfy the condition.
    availabilityZone String
    nameRegex String
    outputFile String
    projectId String

    Supporting Types

    GetDbBackupsDbBackup

    BackupEndTime string
    time when the backup was completed
    BackupId double
    id of the database backup which can used to seed new database instance
    BackupName string
    name of the database backup
    BackupSize double
    size of the database backup in bytes
    BackupTime string
    time when the backup was created
    BackupType double
    type of backup, 0: auto-backup, 1: manual-backup
    BackupZone string
    availability zone where the backup database locates, empty for non-master-slave instances
    DbId string
    id of the database instance
    DbName string
    name of the database instance
    State string
    State of backup
    Zone string
    availability zone where the database instance locates
    BackupEndTime string
    time when the backup was completed
    BackupId float64
    id of the database backup which can used to seed new database instance
    BackupName string
    name of the database backup
    BackupSize float64
    size of the database backup in bytes
    BackupTime string
    time when the backup was created
    BackupType float64
    type of backup, 0: auto-backup, 1: manual-backup
    BackupZone string
    availability zone where the backup database locates, empty for non-master-slave instances
    DbId string
    id of the database instance
    DbName string
    name of the database instance
    State string
    State of backup
    Zone string
    availability zone where the database instance locates
    backupEndTime String
    time when the backup was completed
    backupId Double
    id of the database backup which can used to seed new database instance
    backupName String
    name of the database backup
    backupSize Double
    size of the database backup in bytes
    backupTime String
    time when the backup was created
    backupType Double
    type of backup, 0: auto-backup, 1: manual-backup
    backupZone String
    availability zone where the backup database locates, empty for non-master-slave instances
    dbId String
    id of the database instance
    dbName String
    name of the database instance
    state String
    State of backup
    zone String
    availability zone where the database instance locates
    backupEndTime string
    time when the backup was completed
    backupId number
    id of the database backup which can used to seed new database instance
    backupName string
    name of the database backup
    backupSize number
    size of the database backup in bytes
    backupTime string
    time when the backup was created
    backupType number
    type of backup, 0: auto-backup, 1: manual-backup
    backupZone string
    availability zone where the backup database locates, empty for non-master-slave instances
    dbId string
    id of the database instance
    dbName string
    name of the database instance
    state string
    State of backup
    zone string
    availability zone where the database instance locates
    backup_end_time str
    time when the backup was completed
    backup_id float
    id of the database backup which can used to seed new database instance
    backup_name str
    name of the database backup
    backup_size float
    size of the database backup in bytes
    backup_time str
    time when the backup was created
    backup_type float
    type of backup, 0: auto-backup, 1: manual-backup
    backup_zone str
    availability zone where the backup database locates, empty for non-master-slave instances
    db_id str
    id of the database instance
    db_name str
    name of the database instance
    state str
    State of backup
    zone str
    availability zone where the database instance locates
    backupEndTime String
    time when the backup was completed
    backupId Number
    id of the database backup which can used to seed new database instance
    backupName String
    name of the database backup
    backupSize Number
    size of the database backup in bytes
    backupTime String
    time when the backup was created
    backupType Number
    type of backup, 0: auto-backup, 1: manual-backup
    backupZone String
    availability zone where the backup database locates, empty for non-master-slave instances
    dbId String
    id of the database instance
    dbName String
    name of the database instance
    state String
    State of backup
    zone String
    availability zone where the database instance locates

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud logo
    ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud