1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. gpdb
  5. getLogBackups
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.gpdb.getLogBackups

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides Gpdb Logbackup available to the user.What is Log Backup

    NOTE: Available since v1.231.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.gpdb.getInstances({
        nameRegex: "^default-NODELETING$",
    });
    const defaultGetLogBackups = Promise.all([_default, _default]).then(([_default, _default1]) => alicloud.gpdb.getLogBackups({
        startTime: "2022-12-12T02:00Z",
        endTime: "2024-12-12T02:00Z",
        dbInstanceId: _default.ids?.[0],
        ids: [_default1.ids?.[0]],
    }));
    export const alicloudGpdbLogbackupExampleId = defaultGetLogBackups.then(defaultGetLogBackups => defaultGetLogBackups.logbackups?.[0]?.dbInstanceId);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.gpdb.get_instances(name_regex="^default-NODELETING$")
    default_get_log_backups = alicloud.gpdb.get_log_backups(start_time="2022-12-12T02:00Z",
        end_time="2024-12-12T02:00Z",
        db_instance_id=default.ids[0],
        ids=[default.ids[0]])
    pulumi.export("alicloudGpdbLogbackupExampleId", default_get_log_backups.logbackups[0].db_instance_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/gpdb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    _default, err := gpdb.GetInstances(ctx, &gpdb.GetInstancesArgs{
    NameRegex: pulumi.StringRef("^default-NODELETING$"),
    }, nil);
    if err != nil {
    return err
    }
    defaultGetLogBackups, err := gpdb.GetLogBackups(ctx, &gpdb.GetLogBackupsArgs{
    StartTime: pulumi.StringRef("2022-12-12T02:00Z"),
    EndTime: pulumi.StringRef("2024-12-12T02:00Z"),
    DbInstanceId: _default.Ids[0],
    Ids: interface{}{
    _default.Ids[0],
    },
    }, nil);
    if err != nil {
    return err
    }
    ctx.Export("alicloudGpdbLogbackupExampleId", defaultGetLogBackups.Logbackups[0].DbInstanceId)
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Gpdb.GetInstances.Invoke(new()
        {
            NameRegex = "^default-NODELETING$",
        });
    
        var defaultGetLogBackups = AliCloud.Gpdb.GetLogBackups.Invoke(new()
        {
            StartTime = "2022-12-12T02:00Z",
            EndTime = "2024-12-12T02:00Z",
            DbInstanceId = @default.Apply(getInstancesResult => getInstancesResult.Ids[0]),
            Ids = new[]
            {
                @default.Apply(getInstancesResult => getInstancesResult.Ids[0]),
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudGpdbLogbackupExampleId"] = defaultGetLogBackups.Apply(getLogBackupsResult => getLogBackupsResult.Logbackups[0]?.DbInstanceId),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.gpdb.GpdbFunctions;
    import com.pulumi.alicloud.gpdb.inputs.GetInstancesArgs;
    import com.pulumi.alicloud.gpdb.inputs.GetLogBackupsArgs;
    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 default = GpdbFunctions.getInstances(GetInstancesArgs.builder()
                .nameRegex("^default-NODELETING$")
                .build());
    
            final var defaultGetLogBackups = GpdbFunctions.getLogBackups(GetLogBackupsArgs.builder()
                .startTime("2022-12-12T02:00Z")
                .endTime("2024-12-12T02:00Z")
                .dbInstanceId(default_.ids()[0])
                .ids(default_.ids()[0])
                .build());
    
            ctx.export("alicloudGpdbLogbackupExampleId", defaultGetLogBackups.applyValue(getLogBackupsResult -> getLogBackupsResult.logbackups()[0].dbInstanceId()));
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:gpdb:getInstances
          Arguments:
            nameRegex: ^default-NODELETING$
      defaultGetLogBackups:
        fn::invoke:
          Function: alicloud:gpdb:getLogBackups
          Arguments:
            startTime: 2022-12-12T02:00Z
            endTime: 2024-12-12T02:00Z
            dbInstanceId: ${default.ids[0]}
            ids:
              - ${default.ids[0]}
    outputs:
      alicloudGpdbLogbackupExampleId: ${defaultGetLogBackups.logbackups[0].dbInstanceId}
    

    Using getLogBackups

    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 getLogBackups(args: GetLogBackupsArgs, opts?: InvokeOptions): Promise<GetLogBackupsResult>
    function getLogBackupsOutput(args: GetLogBackupsOutputArgs, opts?: InvokeOptions): Output<GetLogBackupsResult>
    def get_log_backups(db_instance_id: Optional[str] = None,
                        end_time: Optional[str] = None,
                        ids: Optional[Sequence[str]] = None,
                        output_file: Optional[str] = None,
                        page_number: Optional[int] = None,
                        page_size: Optional[int] = None,
                        start_time: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetLogBackupsResult
    def get_log_backups_output(db_instance_id: Optional[pulumi.Input[str]] = None,
                        end_time: Optional[pulumi.Input[str]] = None,
                        ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                        output_file: Optional[pulumi.Input[str]] = None,
                        page_number: Optional[pulumi.Input[int]] = None,
                        page_size: Optional[pulumi.Input[int]] = None,
                        start_time: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetLogBackupsResult]
    func GetLogBackups(ctx *Context, args *GetLogBackupsArgs, opts ...InvokeOption) (*GetLogBackupsResult, error)
    func GetLogBackupsOutput(ctx *Context, args *GetLogBackupsOutputArgs, opts ...InvokeOption) GetLogBackupsResultOutput

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

    public static class GetLogBackups 
    {
        public static Task<GetLogBackupsResult> InvokeAsync(GetLogBackupsArgs args, InvokeOptions? opts = null)
        public static Output<GetLogBackupsResult> Invoke(GetLogBackupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLogBackupsResult> getLogBackups(GetLogBackupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:gpdb/getLogBackups:getLogBackups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DbInstanceId string
    The ID of the Master node of the instance.
    EndTime string
    The query end time, which must be greater than the query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).
    Ids List<string>
    A list of Logbackup IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    Current page number.
    PageSize int
    Number of records per page.
    StartTime string
    The query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).
    DbInstanceId string
    The ID of the Master node of the instance.
    EndTime string
    The query end time, which must be greater than the query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).
    Ids []string
    A list of Logbackup IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    Current page number.
    PageSize int
    Number of records per page.
    StartTime string
    The query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).
    dbInstanceId String
    The ID of the Master node of the instance.
    endTime String
    The query end time, which must be greater than the query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).
    ids List<String>
    A list of Logbackup IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    Current page number.
    pageSize Integer
    Number of records per page.
    startTime String
    The query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).
    dbInstanceId string
    The ID of the Master node of the instance.
    endTime string
    The query end time, which must be greater than the query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).
    ids string[]
    A list of Logbackup IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    Current page number.
    pageSize number
    Number of records per page.
    startTime string
    The query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).
    db_instance_id str
    The ID of the Master node of the instance.
    end_time str
    The query end time, which must be greater than the query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).
    ids Sequence[str]
    A list of Logbackup IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    Current page number.
    page_size int
    Number of records per page.
    start_time str
    The query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).
    dbInstanceId String
    The ID of the Master node of the instance.
    endTime String
    The query end time, which must be greater than the query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).
    ids List<String>
    A list of Logbackup IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    Current page number.
    pageSize Number
    Number of records per page.
    startTime String
    The query start time. Format: yyyy-MM-ddTHH:mmZ(UTC time).

    getLogBackups Result

    The following output properties are available:

    DbInstanceId string
    The ID of the Master node of the instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Logbackup IDs.
    Logbackups List<Pulumi.AliCloud.Gpdb.Outputs.GetLogBackupsLogbackup>
    A list of Logbackup Entries. Each element contains the following attributes:
    EndTime string
    OutputFile string
    PageNumber int
    PageSize int
    StartTime string
    DbInstanceId string
    The ID of the Master node of the instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Logbackup IDs.
    Logbackups []GetLogBackupsLogbackup
    A list of Logbackup Entries. Each element contains the following attributes:
    EndTime string
    OutputFile string
    PageNumber int
    PageSize int
    StartTime string
    dbInstanceId String
    The ID of the Master node of the instance.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Logbackup IDs.
    logbackups List<GetLogBackupsLogbackup>
    A list of Logbackup Entries. Each element contains the following attributes:
    endTime String
    outputFile String
    pageNumber Integer
    pageSize Integer
    startTime String
    dbInstanceId string
    The ID of the Master node of the instance.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Logbackup IDs.
    logbackups GetLogBackupsLogbackup[]
    A list of Logbackup Entries. Each element contains the following attributes:
    endTime string
    outputFile string
    pageNumber number
    pageSize number
    startTime string
    db_instance_id str
    The ID of the Master node of the instance.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Logbackup IDs.
    logbackups Sequence[GetLogBackupsLogbackup]
    A list of Logbackup Entries. Each element contains the following attributes:
    end_time str
    output_file str
    page_number int
    page_size int
    start_time str
    dbInstanceId String
    The ID of the Master node of the instance.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Logbackup IDs.
    logbackups List<Property Map>
    A list of Logbackup Entries. Each element contains the following attributes:
    endTime String
    outputFile String
    pageNumber Number
    pageSize Number
    startTime String

    Supporting Types

    GetLogBackupsLogbackup

    DbInstanceId string
    The ID of the Master node of the instance.
    LogBackupId string
    The first ID of the resource
    LogFileName string
    Log file name (OSS path).
    LogFileSize int
    Size of the backup log file. Unit: Byte.
    LogTime string
    The log timestamp.
    RecordTotal int
    Total number of records.
    SegmentName string
    The node name.
    DbInstanceId string
    The ID of the Master node of the instance.
    LogBackupId string
    The first ID of the resource
    LogFileName string
    Log file name (OSS path).
    LogFileSize int
    Size of the backup log file. Unit: Byte.
    LogTime string
    The log timestamp.
    RecordTotal int
    Total number of records.
    SegmentName string
    The node name.
    dbInstanceId String
    The ID of the Master node of the instance.
    logBackupId String
    The first ID of the resource
    logFileName String
    Log file name (OSS path).
    logFileSize Integer
    Size of the backup log file. Unit: Byte.
    logTime String
    The log timestamp.
    recordTotal Integer
    Total number of records.
    segmentName String
    The node name.
    dbInstanceId string
    The ID of the Master node of the instance.
    logBackupId string
    The first ID of the resource
    logFileName string
    Log file name (OSS path).
    logFileSize number
    Size of the backup log file. Unit: Byte.
    logTime string
    The log timestamp.
    recordTotal number
    Total number of records.
    segmentName string
    The node name.
    db_instance_id str
    The ID of the Master node of the instance.
    log_backup_id str
    The first ID of the resource
    log_file_name str
    Log file name (OSS path).
    log_file_size int
    Size of the backup log file. Unit: Byte.
    log_time str
    The log timestamp.
    record_total int
    Total number of records.
    segment_name str
    The node name.
    dbInstanceId String
    The ID of the Master node of the instance.
    logBackupId String
    The first ID of the resource
    logFileName String
    Log file name (OSS path).
    logFileSize Number
    Size of the backup log file. Unit: Byte.
    logTime String
    The log timestamp.
    recordTotal Number
    Total number of records.
    segmentName String
    The node name.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi