Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi
linode.getDatabaseBackups
Explore with Pulumi AI
Provides information about Linode Database Backups that match a set of filters. For more information, see the Linode APIv4 docs for MySQL and PostgreSQL.
Example Usage
Get information about all backups for a MySQL database:
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const all-backups = linode.getDatabaseBackups({
    databaseId: 12345,
    databaseType: "mysql",
});
import pulumi
import pulumi_linode as linode
all_backups = linode.get_database_backups(database_id=12345,
    database_type="mysql")
package main
import (
	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := linode.GetDatabaseBackups(ctx, &linode.GetDatabaseBackupsArgs{
			DatabaseId:   12345,
			DatabaseType: "mysql",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;
return await Deployment.RunAsync(() => 
{
    var all_backups = Linode.GetDatabaseBackups.Invoke(new()
    {
        DatabaseId = 12345,
        DatabaseType = "mysql",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.linode.LinodeFunctions;
import com.pulumi.linode.inputs.GetDatabaseBackupsArgs;
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 all-backups = LinodeFunctions.getDatabaseBackups(GetDatabaseBackupsArgs.builder()
            .databaseId(12345)
            .databaseType("mysql")
            .build());
    }
}
variables:
  all-backups:
    fn::invoke:
      Function: linode:getDatabaseBackups
      Arguments:
        databaseId: 12345
        databaseType: mysql
Get information about all automatic PostgreSQL Database Backups:
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const auto-backups = linode.getDatabaseBackups({
    databaseId: 12345,
    databaseType: "postgresql",
    filters: [{
        name: "type",
        values: ["auto"],
    }],
});
import pulumi
import pulumi_linode as linode
auto_backups = linode.get_database_backups(database_id=12345,
    database_type="postgresql",
    filters=[{
        "name": "type",
        "values": ["auto"],
    }])
package main
import (
	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := linode.GetDatabaseBackups(ctx, &linode.GetDatabaseBackupsArgs{
			DatabaseId:   12345,
			DatabaseType: "postgresql",
			Filters: []linode.GetDatabaseBackupsFilter{
				{
					Name: "type",
					Values: []string{
						"auto",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;
return await Deployment.RunAsync(() => 
{
    var auto_backups = Linode.GetDatabaseBackups.Invoke(new()
    {
        DatabaseId = 12345,
        DatabaseType = "postgresql",
        Filters = new[]
        {
            new Linode.Inputs.GetDatabaseBackupsFilterInputArgs
            {
                Name = "type",
                Values = new[]
                {
                    "auto",
                },
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.linode.LinodeFunctions;
import com.pulumi.linode.inputs.GetDatabaseBackupsArgs;
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 auto-backups = LinodeFunctions.getDatabaseBackups(GetDatabaseBackupsArgs.builder()
            .databaseId(12345)
            .databaseType("postgresql")
            .filters(GetDatabaseBackupsFilterArgs.builder()
                .name("type")
                .values("auto")
                .build())
            .build());
    }
}
variables:
  auto-backups:
    fn::invoke:
      Function: linode:getDatabaseBackups
      Arguments:
        databaseId: 12345
        databaseType: postgresql
        filters:
          - name: type
            values:
              - auto
Using getDatabaseBackups
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 getDatabaseBackups(args: GetDatabaseBackupsArgs, opts?: InvokeOptions): Promise<GetDatabaseBackupsResult>
function getDatabaseBackupsOutput(args: GetDatabaseBackupsOutputArgs, opts?: InvokeOptions): Output<GetDatabaseBackupsResult>def get_database_backups(backups: Optional[Sequence[GetDatabaseBackupsBackup]] = None,
                         database_id: Optional[int] = None,
                         database_type: Optional[str] = None,
                         filters: Optional[Sequence[GetDatabaseBackupsFilter]] = None,
                         latest: Optional[bool] = None,
                         order: Optional[str] = None,
                         order_by: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetDatabaseBackupsResult
def get_database_backups_output(backups: Optional[pulumi.Input[Sequence[pulumi.Input[GetDatabaseBackupsBackupArgs]]]] = None,
                         database_id: Optional[pulumi.Input[int]] = None,
                         database_type: Optional[pulumi.Input[str]] = None,
                         filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetDatabaseBackupsFilterArgs]]]] = None,
                         latest: Optional[pulumi.Input[bool]] = None,
                         order: Optional[pulumi.Input[str]] = None,
                         order_by: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseBackupsResult]func GetDatabaseBackups(ctx *Context, args *GetDatabaseBackupsArgs, opts ...InvokeOption) (*GetDatabaseBackupsResult, error)
func GetDatabaseBackupsOutput(ctx *Context, args *GetDatabaseBackupsOutputArgs, opts ...InvokeOption) GetDatabaseBackupsResultOutput> Note: This function is named GetDatabaseBackups in the Go SDK.
public static class GetDatabaseBackups 
{
    public static Task<GetDatabaseBackupsResult> InvokeAsync(GetDatabaseBackupsArgs args, InvokeOptions? opts = null)
    public static Output<GetDatabaseBackupsResult> Invoke(GetDatabaseBackupsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetDatabaseBackupsResult> getDatabaseBackups(GetDatabaseBackupsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: linode:index/getDatabaseBackups:getDatabaseBackups
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Database
Id int - The ID of the database to retrieve backups for.
 - Database
Type string - The type of the database to retrieve backups for. (
mysql,postgresql) - Backups
List<Get
Database Backups Backup>  - Filters
List<Get
Database Backups Filter>  - Latest bool
 - If true, only the latest backup will be returned.
filter- (Optional) A set of filters used to select database backups that meet certain requirements.
 - Order string
 - The order in which results should be returned. (
asc,desc; defaultasc) - Order
By string - The attribute to order the results by. (
created) 
- Database
Id int - The ID of the database to retrieve backups for.
 - Database
Type string - The type of the database to retrieve backups for. (
mysql,postgresql) - Backups
[]Get
Database Backups Backup  - Filters
[]Get
Database Backups Filter  - Latest bool
 - If true, only the latest backup will be returned.
filter- (Optional) A set of filters used to select database backups that meet certain requirements.
 - Order string
 - The order in which results should be returned. (
asc,desc; defaultasc) - Order
By string - The attribute to order the results by. (
created) 
- database
Id Integer - The ID of the database to retrieve backups for.
 - database
Type String - The type of the database to retrieve backups for. (
mysql,postgresql) - backups
List<Get
Database Backups Backup>  - filters
List<Get
Database Backups Filter>  - latest Boolean
 - If true, only the latest backup will be returned.
filter- (Optional) A set of filters used to select database backups that meet certain requirements.
 - order String
 - The order in which results should be returned. (
asc,desc; defaultasc) - order
By String - The attribute to order the results by. (
created) 
- database
Id number - The ID of the database to retrieve backups for.
 - database
Type string - The type of the database to retrieve backups for. (
mysql,postgresql) - backups
Get
Database Backups Backup[]  - filters
Get
Database Backups Filter[]  - latest boolean
 - If true, only the latest backup will be returned.
filter- (Optional) A set of filters used to select database backups that meet certain requirements.
 - order string
 - The order in which results should be returned. (
asc,desc; defaultasc) - order
By string - The attribute to order the results by. (
created) 
- database_
id int - The ID of the database to retrieve backups for.
 - database_
type str - The type of the database to retrieve backups for. (
mysql,postgresql) - backups
Sequence[Get
Database Backups Backup]  - filters
Sequence[Get
Database Backups Filter]  - latest bool
 - If true, only the latest backup will be returned.
filter- (Optional) A set of filters used to select database backups that meet certain requirements.
 - order str
 - The order in which results should be returned. (
asc,desc; defaultasc) - order_
by str - The attribute to order the results by. (
created) 
- database
Id Number - The ID of the database to retrieve backups for.
 - database
Type String - The type of the database to retrieve backups for. (
mysql,postgresql) - backups List<Property Map>
 - filters List<Property Map>
 - latest Boolean
 - If true, only the latest backup will be returned.
filter- (Optional) A set of filters used to select database backups that meet certain requirements.
 - order String
 - The order in which results should be returned. (
asc,desc; defaultasc) - order
By String - The attribute to order the results by. (
created) 
getDatabaseBackups Result
The following output properties are available:
- Database
Id int - Database
Type string - Id int
 - The ID of the database backup object.
 - Backups
List<Get
Database Backups Backup>  - Filters
List<Get
Database Backups Filter>  - Latest bool
 - Order string
 - Order
By string 
- Database
Id int - Database
Type string - Id int
 - The ID of the database backup object.
 - Backups
[]Get
Database Backups Backup  - Filters
[]Get
Database Backups Filter  - Latest bool
 - Order string
 - Order
By string 
- database
Id Integer - database
Type String - id Integer
 - The ID of the database backup object.
 - backups
List<Get
Database Backups Backup>  - filters
List<Get
Database Backups Filter>  - latest Boolean
 - order String
 - order
By String 
- database
Id number - database
Type string - id number
 - The ID of the database backup object.
 - backups
Get
Database Backups Backup[]  - filters
Get
Database Backups Filter[]  - latest boolean
 - order string
 - order
By string 
- database_
id int - database_
type str - id int
 - The ID of the database backup object.
 - backups
Sequence[Get
Database Backups Backup]  - filters
Sequence[Get
Database Backups Filter]  - latest bool
 - order str
 - order_
by str 
- database
Id Number - database
Type String - id Number
 - The ID of the database backup object.
 - backups List<Property Map>
 - filters List<Property Map>
 - latest Boolean
 - order String
 - order
By String 
Supporting Types
GetDatabaseBackupsBackup   
- Created string
 - A time value given in a combined date and time format that represents when the database backup was created.
 - Id int
 - The ID of the database backup object.
 - Label string
 - The database backup’s label, for display purposes only.
 - Type string
 - The type of database backup, determined by how the backup was created.
 
- Created string
 - A time value given in a combined date and time format that represents when the database backup was created.
 - Id int
 - The ID of the database backup object.
 - Label string
 - The database backup’s label, for display purposes only.
 - Type string
 - The type of database backup, determined by how the backup was created.
 
- created String
 - A time value given in a combined date and time format that represents when the database backup was created.
 - id Integer
 - The ID of the database backup object.
 - label String
 - The database backup’s label, for display purposes only.
 - type String
 - The type of database backup, determined by how the backup was created.
 
- created string
 - A time value given in a combined date and time format that represents when the database backup was created.
 - id number
 - The ID of the database backup object.
 - label string
 - The database backup’s label, for display purposes only.
 - type string
 - The type of database backup, determined by how the backup was created.
 
- created str
 - A time value given in a combined date and time format that represents when the database backup was created.
 - id int
 - The ID of the database backup object.
 - label str
 - The database backup’s label, for display purposes only.
 - type str
 - The type of database backup, determined by how the backup was created.
 
- created String
 - A time value given in a combined date and time format that represents when the database backup was created.
 - id Number
 - The ID of the database backup object.
 - label String
 - The database backup’s label, for display purposes only.
 - type String
 - The type of database backup, determined by how the backup was created.
 
GetDatabaseBackupsFilter   
Package Details
- Repository
 - Linode pulumi/pulumi-linode
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
linodeTerraform Provider.