1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. gpdb
  5. getLogBackups
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.gpdb.getLogBackups

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 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);
Copy
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)
Copy
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
})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
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}
Copy

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>
Copy
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]
Copy
func GetLogBackups(ctx *Context, args *GetLogBackupsArgs, opts ...InvokeOption) (*GetLogBackupsResult, error)
func GetLogBackupsOutput(ctx *Context, args *GetLogBackupsOutputArgs, opts ...InvokeOption) GetLogBackupsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetLogBackupsResult> getLogBackups(GetLogBackupsArgs args, InvokeOptions options)
public static Output<GetLogBackupsResult> getLogBackups(GetLogBackupsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:gpdb/getLogBackups:getLogBackups
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

DbInstanceId This property is required. 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 Changes to this property will trigger replacement. 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 This property is required. 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 Changes to this property will trigger replacement. []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 This property is required. 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 Changes to this property will trigger replacement. 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 This property is required. 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 Changes to this property will trigger replacement. 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 This property is required. 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 Changes to this property will trigger replacement. 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 This property is required. 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 Changes to this property will trigger replacement. 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 This property is required. string
The ID of the Master node of the instance.
LogBackupId This property is required. string
The first ID of the resource
LogFileName This property is required. string
Log file name (OSS path).
LogFileSize This property is required. int
Size of the backup log file. Unit: Byte.
LogTime This property is required. string
The log timestamp.
RecordTotal This property is required. int
Total number of records.
SegmentName This property is required. string
The node name.
DbInstanceId This property is required. string
The ID of the Master node of the instance.
LogBackupId This property is required. string
The first ID of the resource
LogFileName This property is required. string
Log file name (OSS path).
LogFileSize This property is required. int
Size of the backup log file. Unit: Byte.
LogTime This property is required. string
The log timestamp.
RecordTotal This property is required. int
Total number of records.
SegmentName This property is required. string
The node name.
dbInstanceId This property is required. String
The ID of the Master node of the instance.
logBackupId This property is required. String
The first ID of the resource
logFileName This property is required. String
Log file name (OSS path).
logFileSize This property is required. Integer
Size of the backup log file. Unit: Byte.
logTime This property is required. String
The log timestamp.
recordTotal This property is required. Integer
Total number of records.
segmentName This property is required. String
The node name.
dbInstanceId This property is required. string
The ID of the Master node of the instance.
logBackupId This property is required. string
The first ID of the resource
logFileName This property is required. string
Log file name (OSS path).
logFileSize This property is required. number
Size of the backup log file. Unit: Byte.
logTime This property is required. string
The log timestamp.
recordTotal This property is required. number
Total number of records.
segmentName This property is required. string
The node name.
db_instance_id This property is required. str
The ID of the Master node of the instance.
log_backup_id This property is required. str
The first ID of the resource
log_file_name This property is required. str
Log file name (OSS path).
log_file_size This property is required. int
Size of the backup log file. Unit: Byte.
log_time This property is required. str
The log timestamp.
record_total This property is required. int
Total number of records.
segment_name This property is required. str
The node name.
dbInstanceId This property is required. String
The ID of the Master node of the instance.
logBackupId This property is required. String
The first ID of the resource
logFileName This property is required. String
Log file name (OSS path).
logFileSize This property is required. Number
Size of the backup log file. Unit: Byte.
logTime This property is required. String
The log timestamp.
recordTotal This property is required. Number
Total number of records.
segmentName This property is required. 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.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi