1. Packages
  2. Linode Provider
  3. API Docs
  4. getDatabaseMysqlBackups
Linode v4.37.0 published on Thursday, Apr 10, 2025 by Pulumi

linode.getDatabaseMysqlBackups

Explore with Pulumi AI

DEPRECATION NOTICE: This data source has been deprecated.

Provides information about Linode MySQL Database Backups that match a set of filters. For more information, see the Linode APIv4 docs.

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.getDatabaseMysqlBackups({
    databaseId: 12345,
});
Copy
import pulumi
import pulumi_linode as linode

all_backups = linode.get_database_mysql_backups(database_id=12345)
Copy
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.GetDatabaseMysqlBackups(ctx, &linode.GetDatabaseMysqlBackupsArgs{
			DatabaseId: 12345,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;

return await Deployment.RunAsync(() => 
{
    var all_backups = Linode.GetDatabaseMysqlBackups.Invoke(new()
    {
        DatabaseId = 12345,
    });

});
Copy
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.GetDatabaseMysqlBackupsArgs;
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.getDatabaseMysqlBackups(GetDatabaseMysqlBackupsArgs.builder()
            .databaseId(12345)
            .build());

    }
}
Copy
variables:
  all-backups:
    fn::invoke:
      function: linode:getDatabaseMysqlBackups
      arguments:
        databaseId: 12345
Copy

Get information about all automatic MySQL Database Backups:

import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";

const auto_backups = linode.getDatabaseMysqlBackups({
    databaseId: 12345,
    filters: [{
        name: "type",
        values: ["auto"],
    }],
});
Copy
import pulumi
import pulumi_linode as linode

auto_backups = linode.get_database_mysql_backups(database_id=12345,
    filters=[{
        "name": "type",
        "values": ["auto"],
    }])
Copy
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.GetDatabaseMysqlBackups(ctx, &linode.GetDatabaseMysqlBackupsArgs{
			DatabaseId: 12345,
			Filters: []linode.GetDatabaseMysqlBackupsFilter{
				{
					Name: "type",
					Values: []string{
						"auto",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;

return await Deployment.RunAsync(() => 
{
    var auto_backups = Linode.GetDatabaseMysqlBackups.Invoke(new()
    {
        DatabaseId = 12345,
        Filters = new[]
        {
            new Linode.Inputs.GetDatabaseMysqlBackupsFilterInputArgs
            {
                Name = "type",
                Values = new[]
                {
                    "auto",
                },
            },
        },
    });

});
Copy
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.GetDatabaseMysqlBackupsArgs;
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.getDatabaseMysqlBackups(GetDatabaseMysqlBackupsArgs.builder()
            .databaseId(12345)
            .filters(GetDatabaseMysqlBackupsFilterArgs.builder()
                .name("type")
                .values("auto")
                .build())
            .build());

    }
}
Copy
variables:
  auto-backups:
    fn::invoke:
      function: linode:getDatabaseMysqlBackups
      arguments:
        databaseId: 12345
        filters:
          - name: type
            values:
              - auto
Copy

Using getDatabaseMysqlBackups

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 getDatabaseMysqlBackups(args: GetDatabaseMysqlBackupsArgs, opts?: InvokeOptions): Promise<GetDatabaseMysqlBackupsResult>
function getDatabaseMysqlBackupsOutput(args: GetDatabaseMysqlBackupsOutputArgs, opts?: InvokeOptions): Output<GetDatabaseMysqlBackupsResult>
Copy
def get_database_mysql_backups(database_id: Optional[int] = None,
                               filters: Optional[Sequence[GetDatabaseMysqlBackupsFilter]] = None,
                               latest: Optional[bool] = None,
                               order: Optional[str] = None,
                               order_by: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetDatabaseMysqlBackupsResult
def get_database_mysql_backups_output(database_id: Optional[pulumi.Input[int]] = None,
                               filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetDatabaseMysqlBackupsFilterArgs]]]] = 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[GetDatabaseMysqlBackupsResult]
Copy
func GetDatabaseMysqlBackups(ctx *Context, args *GetDatabaseMysqlBackupsArgs, opts ...InvokeOption) (*GetDatabaseMysqlBackupsResult, error)
func GetDatabaseMysqlBackupsOutput(ctx *Context, args *GetDatabaseMysqlBackupsOutputArgs, opts ...InvokeOption) GetDatabaseMysqlBackupsResultOutput
Copy

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

public static class GetDatabaseMysqlBackups 
{
    public static Task<GetDatabaseMysqlBackupsResult> InvokeAsync(GetDatabaseMysqlBackupsArgs args, InvokeOptions? opts = null)
    public static Output<GetDatabaseMysqlBackupsResult> Invoke(GetDatabaseMysqlBackupsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDatabaseMysqlBackupsResult> getDatabaseMysqlBackups(GetDatabaseMysqlBackupsArgs args, InvokeOptions options)
public static Output<GetDatabaseMysqlBackupsResult> getDatabaseMysqlBackups(GetDatabaseMysqlBackupsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: linode:index/getDatabaseMysqlBackups:getDatabaseMysqlBackups
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

DatabaseId This property is required. int
The ID of the database to retrieve backups for.
Filters List<GetDatabaseMysqlBackupsFilter>
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; default asc)
OrderBy string
The attribute to order the results by. (created)
DatabaseId This property is required. int
The ID of the database to retrieve backups for.
Filters []GetDatabaseMysqlBackupsFilter
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; default asc)
OrderBy string
The attribute to order the results by. (created)
databaseId This property is required. Integer
The ID of the database to retrieve backups for.
filters List<GetDatabaseMysqlBackupsFilter>
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; default asc)
orderBy String
The attribute to order the results by. (created)
databaseId This property is required. number
The ID of the database to retrieve backups for.
filters GetDatabaseMysqlBackupsFilter[]
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; default asc)
orderBy string
The attribute to order the results by. (created)
database_id This property is required. int
The ID of the database to retrieve backups for.
filters Sequence[GetDatabaseMysqlBackupsFilter]
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; default asc)
order_by str
The attribute to order the results by. (created)
databaseId This property is required. Number
The ID of the database to retrieve backups for.
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; default asc)
orderBy String
The attribute to order the results by. (created)

getDatabaseMysqlBackups Result

The following output properties are available:

Backups List<GetDatabaseMysqlBackupsBackup>
DatabaseId int
Id string
The provider-assigned unique ID for this managed resource.
Filters List<GetDatabaseMysqlBackupsFilter>
Latest bool
Order string
OrderBy string
Backups []GetDatabaseMysqlBackupsBackup
DatabaseId int
Id string
The provider-assigned unique ID for this managed resource.
Filters []GetDatabaseMysqlBackupsFilter
Latest bool
Order string
OrderBy string
backups List<GetDatabaseMysqlBackupsBackup>
databaseId Integer
id String
The provider-assigned unique ID for this managed resource.
filters List<GetDatabaseMysqlBackupsFilter>
latest Boolean
order String
orderBy String
backups GetDatabaseMysqlBackupsBackup[]
databaseId number
id string
The provider-assigned unique ID for this managed resource.
filters GetDatabaseMysqlBackupsFilter[]
latest boolean
order string
orderBy string
backups List<Property Map>
databaseId Number
id String
The provider-assigned unique ID for this managed resource.
filters List<Property Map>
latest Boolean
order String
orderBy String

Supporting Types

GetDatabaseMysqlBackupsBackup

Created This property is required. string
A time value given in a combined date and time format that represents when the database backup was created.
Id This property is required. int
The ID of the database backup object.
Label This property is required. string
The database backup’s label, for display purposes only.
Type This property is required. string
The type of database backup, determined by how the backup was created.
Created This property is required. string
A time value given in a combined date and time format that represents when the database backup was created.
Id This property is required. int
The ID of the database backup object.
Label This property is required. string
The database backup’s label, for display purposes only.
Type This property is required. string
The type of database backup, determined by how the backup was created.
created This property is required. String
A time value given in a combined date and time format that represents when the database backup was created.
id This property is required. Integer
The ID of the database backup object.
label This property is required. String
The database backup’s label, for display purposes only.
type This property is required. String
The type of database backup, determined by how the backup was created.
created This property is required. string
A time value given in a combined date and time format that represents when the database backup was created.
id This property is required. number
The ID of the database backup object.
label This property is required. string
The database backup’s label, for display purposes only.
type This property is required. string
The type of database backup, determined by how the backup was created.
created This property is required. str
A time value given in a combined date and time format that represents when the database backup was created.
id This property is required. int
The ID of the database backup object.
label This property is required. str
The database backup’s label, for display purposes only.
type This property is required. str
The type of database backup, determined by how the backup was created.
created This property is required. String
A time value given in a combined date and time format that represents when the database backup was created.
id This property is required. Number
The ID of the database backup object.
label This property is required. String
The database backup’s label, for display purposes only.
type This property is required. String
The type of database backup, determined by how the backup was created.

GetDatabaseMysqlBackupsFilter

Name This property is required. string
The name of the field to filter by.
Values This property is required. List<string>
A list of values for the filter to allow. These values should all be in string form.
MatchBy string
The method to match the field by. (exact, regex, substring; default exact)
Name This property is required. string
The name of the field to filter by.
Values This property is required. []string
A list of values for the filter to allow. These values should all be in string form.
MatchBy string
The method to match the field by. (exact, regex, substring; default exact)
name This property is required. String
The name of the field to filter by.
values This property is required. List<String>
A list of values for the filter to allow. These values should all be in string form.
matchBy String
The method to match the field by. (exact, regex, substring; default exact)
name This property is required. string
The name of the field to filter by.
values This property is required. string[]
A list of values for the filter to allow. These values should all be in string form.
matchBy string
The method to match the field by. (exact, regex, substring; default exact)
name This property is required. str
The name of the field to filter by.
values This property is required. Sequence[str]
A list of values for the filter to allow. These values should all be in string form.
match_by str
The method to match the field by. (exact, regex, substring; default exact)
name This property is required. String
The name of the field to filter by.
values This property is required. List<String>
A list of values for the filter to allow. These values should all be in string form.
matchBy String
The method to match the field by. (exact, regex, substring; default exact)

Package Details

Repository
Linode pulumi/pulumi-linode
License
Apache-2.0
Notes
This Pulumi package is based on the linode Terraform Provider.