1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Database
  5. getBackups
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.Database.getBackups

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the list of Backups in Oracle Cloud Infrastructure Database service.

    Gets a list of backups based on the databaseId or compartmentId specified. Either one of these query parameters must be provided.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testBackups = oci.Database.getBackups({
        compartmentId: compartmentId,
        databaseId: testDatabase.id,
        shapeFamily: backupShapeFamily,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_backups = oci.Database.get_backups(compartment_id=compartment_id,
        database_id=test_database["id"],
        shape_family=backup_shape_family)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Database"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Database.GetBackups(ctx, &database.GetBackupsArgs{
    			CompartmentId: pulumi.StringRef(compartmentId),
    			DatabaseId:    pulumi.StringRef(testDatabase.Id),
    			ShapeFamily:   pulumi.StringRef(backupShapeFamily),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testBackups = Oci.Database.GetBackups.Invoke(new()
        {
            CompartmentId = compartmentId,
            DatabaseId = testDatabase.Id,
            ShapeFamily = backupShapeFamily,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Database.DatabaseFunctions;
    import com.pulumi.oci.Database.inputs.GetBackupsArgs;
    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 testBackups = DatabaseFunctions.getBackups(GetBackupsArgs.builder()
                .compartmentId(compartmentId)
                .databaseId(testDatabase.id())
                .shapeFamily(backupShapeFamily)
                .build());
    
        }
    }
    
    variables:
      testBackups:
        fn::invoke:
          Function: oci:Database:getBackups
          Arguments:
            compartmentId: ${compartmentId}
            databaseId: ${testDatabase.id}
            shapeFamily: ${backupShapeFamily}
    

    Using getBackups

    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 getBackups(args: GetBackupsArgs, opts?: InvokeOptions): Promise<GetBackupsResult>
    function getBackupsOutput(args: GetBackupsOutputArgs, opts?: InvokeOptions): Output<GetBackupsResult>
    def get_backups(compartment_id: Optional[str] = None,
                    database_id: Optional[str] = None,
                    filters: Optional[Sequence[_database.GetBackupsFilter]] = None,
                    shape_family: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetBackupsResult
    def get_backups_output(compartment_id: Optional[pulumi.Input[str]] = None,
                    database_id: Optional[pulumi.Input[str]] = None,
                    filters: Optional[pulumi.Input[Sequence[pulumi.Input[_database.GetBackupsFilterArgs]]]] = None,
                    shape_family: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetBackupsResult]
    func GetBackups(ctx *Context, args *GetBackupsArgs, opts ...InvokeOption) (*GetBackupsResult, error)
    func GetBackupsOutput(ctx *Context, args *GetBackupsOutputArgs, opts ...InvokeOption) GetBackupsResultOutput

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

    public static class GetBackups 
    {
        public static Task<GetBackupsResult> InvokeAsync(GetBackupsArgs args, InvokeOptions? opts = null)
        public static Output<GetBackupsResult> Invoke(GetBackupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBackupsResult> getBackups(GetBackupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Database/getBackups:getBackups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The compartment OCID.
    DatabaseId string
    The OCID of the database.
    Filters List<GetBackupsFilter>
    ShapeFamily string
    If provided, filters the results to the set of database versions which are supported for the given shape family.
    CompartmentId string
    The compartment OCID.
    DatabaseId string
    The OCID of the database.
    Filters []GetBackupsFilter
    ShapeFamily string
    If provided, filters the results to the set of database versions which are supported for the given shape family.
    compartmentId String
    The compartment OCID.
    databaseId String
    The OCID of the database.
    filters List<GetBackupsFilter>
    shapeFamily String
    If provided, filters the results to the set of database versions which are supported for the given shape family.
    compartmentId string
    The compartment OCID.
    databaseId string
    The OCID of the database.
    filters GetBackupsFilter[]
    shapeFamily string
    If provided, filters the results to the set of database versions which are supported for the given shape family.
    compartment_id str
    The compartment OCID.
    database_id str
    The OCID of the database.
    filters Sequence[database.GetBackupsFilter]
    shape_family str
    If provided, filters the results to the set of database versions which are supported for the given shape family.
    compartmentId String
    The compartment OCID.
    databaseId String
    The OCID of the database.
    filters List<Property Map>
    shapeFamily String
    If provided, filters the results to the set of database versions which are supported for the given shape family.

    getBackups Result

    The following output properties are available:

    Backups List<GetBackupsBackup>
    The list of backups.
    Id string
    The provider-assigned unique ID for this managed resource.
    CompartmentId string
    The OCID of the compartment.
    DatabaseId string
    The OCID of the database.
    Filters List<GetBackupsFilter>
    ShapeFamily string
    Backups []GetBackupsBackup
    The list of backups.
    Id string
    The provider-assigned unique ID for this managed resource.
    CompartmentId string
    The OCID of the compartment.
    DatabaseId string
    The OCID of the database.
    Filters []GetBackupsFilter
    ShapeFamily string
    backups List<GetBackupsBackup>
    The list of backups.
    id String
    The provider-assigned unique ID for this managed resource.
    compartmentId String
    The OCID of the compartment.
    databaseId String
    The OCID of the database.
    filters List<GetBackupsFilter>
    shapeFamily String
    backups GetBackupsBackup[]
    The list of backups.
    id string
    The provider-assigned unique ID for this managed resource.
    compartmentId string
    The OCID of the compartment.
    databaseId string
    The OCID of the database.
    filters GetBackupsFilter[]
    shapeFamily string
    backups Sequence[database.GetBackupsBackup]
    The list of backups.
    id str
    The provider-assigned unique ID for this managed resource.
    compartment_id str
    The OCID of the compartment.
    database_id str
    The OCID of the database.
    filters Sequence[database.GetBackupsFilter]
    shape_family str
    backups List<Property Map>
    The list of backups.
    id String
    The provider-assigned unique ID for this managed resource.
    compartmentId String
    The OCID of the compartment.
    databaseId String
    The OCID of the database.
    filters List<Property Map>
    shapeFamily String

    Supporting Types

    GetBackupsBackup

    AvailabilityDomain string
    The name of the availability domain where the database backup is stored.
    CompartmentId string
    The compartment OCID.
    DatabaseEdition string
    The Oracle Database edition of the DB system from which the database backup was taken.
    DatabaseId string
    The OCID of the database.
    DatabaseSizeInGbs double
    The size of the database in gigabytes at the time the backup was taken.
    DisplayName string
    The user-friendly name for the backup. The name does not have to be unique.
    Id string
    The OCID of the backup.
    KeyStoreId string
    The OCID of the key store of Oracle Vault.
    KeyStoreWalletName string
    The wallet name for Oracle Key Vault.
    KmsKeyId string
    The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
    KmsKeyVersionId string
    The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances.
    LifecycleDetails string
    Additional information about the current lifecycle state.
    Shape string
    Shape of the backup's source database.
    State string
    The current state of the backup.
    TimeEnded string
    The date and time the backup was completed.
    TimeStarted string
    The date and time the backup started.
    Type string
    The type of backup.
    VaultId string
    The OCID of the Oracle Cloud Infrastructure vault. This parameter and secretId are required for Customer Managed Keys.
    Version string
    Version of the backup's source database
    AvailabilityDomain string
    The name of the availability domain where the database backup is stored.
    CompartmentId string
    The compartment OCID.
    DatabaseEdition string
    The Oracle Database edition of the DB system from which the database backup was taken.
    DatabaseId string
    The OCID of the database.
    DatabaseSizeInGbs float64
    The size of the database in gigabytes at the time the backup was taken.
    DisplayName string
    The user-friendly name for the backup. The name does not have to be unique.
    Id string
    The OCID of the backup.
    KeyStoreId string
    The OCID of the key store of Oracle Vault.
    KeyStoreWalletName string
    The wallet name for Oracle Key Vault.
    KmsKeyId string
    The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
    KmsKeyVersionId string
    The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances.
    LifecycleDetails string
    Additional information about the current lifecycle state.
    Shape string
    Shape of the backup's source database.
    State string
    The current state of the backup.
    TimeEnded string
    The date and time the backup was completed.
    TimeStarted string
    The date and time the backup started.
    Type string
    The type of backup.
    VaultId string
    The OCID of the Oracle Cloud Infrastructure vault. This parameter and secretId are required for Customer Managed Keys.
    Version string
    Version of the backup's source database
    availabilityDomain String
    The name of the availability domain where the database backup is stored.
    compartmentId String
    The compartment OCID.
    databaseEdition String
    The Oracle Database edition of the DB system from which the database backup was taken.
    databaseId String
    The OCID of the database.
    databaseSizeInGbs Double
    The size of the database in gigabytes at the time the backup was taken.
    displayName String
    The user-friendly name for the backup. The name does not have to be unique.
    id String
    The OCID of the backup.
    keyStoreId String
    The OCID of the key store of Oracle Vault.
    keyStoreWalletName String
    The wallet name for Oracle Key Vault.
    kmsKeyId String
    The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
    kmsKeyVersionId String
    The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances.
    lifecycleDetails String
    Additional information about the current lifecycle state.
    shape String
    Shape of the backup's source database.
    state String
    The current state of the backup.
    timeEnded String
    The date and time the backup was completed.
    timeStarted String
    The date and time the backup started.
    type String
    The type of backup.
    vaultId String
    The OCID of the Oracle Cloud Infrastructure vault. This parameter and secretId are required for Customer Managed Keys.
    version String
    Version of the backup's source database
    availabilityDomain string
    The name of the availability domain where the database backup is stored.
    compartmentId string
    The compartment OCID.
    databaseEdition string
    The Oracle Database edition of the DB system from which the database backup was taken.
    databaseId string
    The OCID of the database.
    databaseSizeInGbs number
    The size of the database in gigabytes at the time the backup was taken.
    displayName string
    The user-friendly name for the backup. The name does not have to be unique.
    id string
    The OCID of the backup.
    keyStoreId string
    The OCID of the key store of Oracle Vault.
    keyStoreWalletName string
    The wallet name for Oracle Key Vault.
    kmsKeyId string
    The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
    kmsKeyVersionId string
    The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances.
    lifecycleDetails string
    Additional information about the current lifecycle state.
    shape string
    Shape of the backup's source database.
    state string
    The current state of the backup.
    timeEnded string
    The date and time the backup was completed.
    timeStarted string
    The date and time the backup started.
    type string
    The type of backup.
    vaultId string
    The OCID of the Oracle Cloud Infrastructure vault. This parameter and secretId are required for Customer Managed Keys.
    version string
    Version of the backup's source database
    availability_domain str
    The name of the availability domain where the database backup is stored.
    compartment_id str
    The compartment OCID.
    database_edition str
    The Oracle Database edition of the DB system from which the database backup was taken.
    database_id str
    The OCID of the database.
    database_size_in_gbs float
    The size of the database in gigabytes at the time the backup was taken.
    display_name str
    The user-friendly name for the backup. The name does not have to be unique.
    id str
    The OCID of the backup.
    key_store_id str
    The OCID of the key store of Oracle Vault.
    key_store_wallet_name str
    The wallet name for Oracle Key Vault.
    kms_key_id str
    The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
    kms_key_version_id str
    The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances.
    lifecycle_details str
    Additional information about the current lifecycle state.
    shape str
    Shape of the backup's source database.
    state str
    The current state of the backup.
    time_ended str
    The date and time the backup was completed.
    time_started str
    The date and time the backup started.
    type str
    The type of backup.
    vault_id str
    The OCID of the Oracle Cloud Infrastructure vault. This parameter and secretId are required for Customer Managed Keys.
    version str
    Version of the backup's source database
    availabilityDomain String
    The name of the availability domain where the database backup is stored.
    compartmentId String
    The compartment OCID.
    databaseEdition String
    The Oracle Database edition of the DB system from which the database backup was taken.
    databaseId String
    The OCID of the database.
    databaseSizeInGbs Number
    The size of the database in gigabytes at the time the backup was taken.
    displayName String
    The user-friendly name for the backup. The name does not have to be unique.
    id String
    The OCID of the backup.
    keyStoreId String
    The OCID of the key store of Oracle Vault.
    keyStoreWalletName String
    The wallet name for Oracle Key Vault.
    kmsKeyId String
    The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
    kmsKeyVersionId String
    The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances.
    lifecycleDetails String
    Additional information about the current lifecycle state.
    shape String
    Shape of the backup's source database.
    state String
    The current state of the backup.
    timeEnded String
    The date and time the backup was completed.
    timeStarted String
    The date and time the backup started.
    type String
    The type of backup.
    vaultId String
    The OCID of the Oracle Cloud Infrastructure vault. This parameter and secretId are required for Customer Managed Keys.
    version String
    Version of the backup's source database

    GetBackupsFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi