1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Psql
  5. getBackups
Oracle Cloud Infrastructure v2.18.0 published on Friday, Nov 22, 2024 by Pulumi

oci.Psql.getBackups

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.18.0 published on Friday, Nov 22, 2024 by Pulumi

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

    Returns a list of backups.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testBackups = oci.Psql.getBackups({
        backupId: testBackup.id,
        compartmentId: compartmentId,
        displayName: backupDisplayName,
        id: backupId,
        state: backupState,
        timeEnded: backupTimeEnded,
        timeStarted: backupTimeStarted,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_backups = oci.Psql.get_backups(backup_id=test_backup["id"],
        compartment_id=compartment_id,
        display_name=backup_display_name,
        id=backup_id,
        state=backup_state,
        time_ended=backup_time_ended,
        time_started=backup_time_started)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Psql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Psql.GetBackups(ctx, &psql.GetBackupsArgs{
    			BackupId:      pulumi.StringRef(testBackup.Id),
    			CompartmentId: pulumi.StringRef(compartmentId),
    			DisplayName:   pulumi.StringRef(backupDisplayName),
    			Id:            pulumi.StringRef(backupId),
    			State:         pulumi.StringRef(backupState),
    			TimeEnded:     pulumi.StringRef(backupTimeEnded),
    			TimeStarted:   pulumi.StringRef(backupTimeStarted),
    		}, 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.Psql.GetBackups.Invoke(new()
        {
            BackupId = testBackup.Id,
            CompartmentId = compartmentId,
            DisplayName = backupDisplayName,
            Id = backupId,
            State = backupState,
            TimeEnded = backupTimeEnded,
            TimeStarted = backupTimeStarted,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Psql.PsqlFunctions;
    import com.pulumi.oci.Psql.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 = PsqlFunctions.getBackups(GetBackupsArgs.builder()
                .backupId(testBackup.id())
                .compartmentId(compartmentId)
                .displayName(backupDisplayName)
                .id(backupId)
                .state(backupState)
                .timeEnded(backupTimeEnded)
                .timeStarted(backupTimeStarted)
                .build());
    
        }
    }
    
    variables:
      testBackups:
        fn::invoke:
          Function: oci:Psql:getBackups
          Arguments:
            backupId: ${testBackup.id}
            compartmentId: ${compartmentId}
            displayName: ${backupDisplayName}
            id: ${backupId}
            state: ${backupState}
            timeEnded: ${backupTimeEnded}
            timeStarted: ${backupTimeStarted}
    

    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(backup_id: Optional[str] = None,
                    compartment_id: Optional[str] = None,
                    display_name: Optional[str] = None,
                    filters: Optional[Sequence[_psql.GetBackupsFilter]] = None,
                    id: Optional[str] = None,
                    state: Optional[str] = None,
                    time_ended: Optional[str] = None,
                    time_started: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetBackupsResult
    def get_backups_output(backup_id: Optional[pulumi.Input[str]] = None,
                    compartment_id: Optional[pulumi.Input[str]] = None,
                    display_name: Optional[pulumi.Input[str]] = None,
                    filters: Optional[pulumi.Input[Sequence[pulumi.Input[_psql.GetBackupsFilterArgs]]]] = None,
                    id: Optional[pulumi.Input[str]] = None,
                    state: Optional[pulumi.Input[str]] = None,
                    time_ended: Optional[pulumi.Input[str]] = None,
                    time_started: 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:Psql/getBackups:getBackups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    BackupId string
    A unique identifier for the backup.
    CompartmentId string
    The ID of the compartment in which to list resources.
    DisplayName string
    A filter to return only resources that match the entire display name given.
    Filters List<GetBackupsFilter>
    Id string
    A unique identifier for the database system.
    State string
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    TimeEnded string
    The end date for getting backups. An RFC 3339 formatted datetime string.
    TimeStarted string
    The start date for getting backups. An RFC 3339 formatted datetime string.
    BackupId string
    A unique identifier for the backup.
    CompartmentId string
    The ID of the compartment in which to list resources.
    DisplayName string
    A filter to return only resources that match the entire display name given.
    Filters []GetBackupsFilter
    Id string
    A unique identifier for the database system.
    State string
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    TimeEnded string
    The end date for getting backups. An RFC 3339 formatted datetime string.
    TimeStarted string
    The start date for getting backups. An RFC 3339 formatted datetime string.
    backupId String
    A unique identifier for the backup.
    compartmentId String
    The ID of the compartment in which to list resources.
    displayName String
    A filter to return only resources that match the entire display name given.
    filters List<GetBackupsFilter>
    id String
    A unique identifier for the database system.
    state String
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    timeEnded String
    The end date for getting backups. An RFC 3339 formatted datetime string.
    timeStarted String
    The start date for getting backups. An RFC 3339 formatted datetime string.
    backupId string
    A unique identifier for the backup.
    compartmentId string
    The ID of the compartment in which to list resources.
    displayName string
    A filter to return only resources that match the entire display name given.
    filters GetBackupsFilter[]
    id string
    A unique identifier for the database system.
    state string
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    timeEnded string
    The end date for getting backups. An RFC 3339 formatted datetime string.
    timeStarted string
    The start date for getting backups. An RFC 3339 formatted datetime string.
    backup_id str
    A unique identifier for the backup.
    compartment_id str
    The ID of the compartment in which to list resources.
    display_name str
    A filter to return only resources that match the entire display name given.
    filters Sequence[psql.GetBackupsFilter]
    id str
    A unique identifier for the database system.
    state str
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    time_ended str
    The end date for getting backups. An RFC 3339 formatted datetime string.
    time_started str
    The start date for getting backups. An RFC 3339 formatted datetime string.
    backupId String
    A unique identifier for the backup.
    compartmentId String
    The ID of the compartment in which to list resources.
    displayName String
    A filter to return only resources that match the entire display name given.
    filters List<Property Map>
    id String
    A unique identifier for the database system.
    state String
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    timeEnded String
    The end date for getting backups. An RFC 3339 formatted datetime string.
    timeStarted String
    The start date for getting backups. An RFC 3339 formatted datetime string.

    getBackups Result

    The following output properties are available:

    BackupCollections List<GetBackupsBackupCollection>
    The list of backup_collection.
    BackupId string
    CompartmentId string
    The OCID of the compartment that contains the backup.
    DisplayName string
    A user-friendly display name for the backup. Avoid entering confidential information.
    Filters List<GetBackupsFilter>
    Id string
    The OCID of the backup.
    State string
    The current state of the backup.
    TimeEnded string
    TimeStarted string
    BackupCollections []GetBackupsBackupCollection
    The list of backup_collection.
    BackupId string
    CompartmentId string
    The OCID of the compartment that contains the backup.
    DisplayName string
    A user-friendly display name for the backup. Avoid entering confidential information.
    Filters []GetBackupsFilter
    Id string
    The OCID of the backup.
    State string
    The current state of the backup.
    TimeEnded string
    TimeStarted string
    backupCollections List<GetBackupsBackupCollection>
    The list of backup_collection.
    backupId String
    compartmentId String
    The OCID of the compartment that contains the backup.
    displayName String
    A user-friendly display name for the backup. Avoid entering confidential information.
    filters List<GetBackupsFilter>
    id String
    The OCID of the backup.
    state String
    The current state of the backup.
    timeEnded String
    timeStarted String
    backupCollections GetBackupsBackupCollection[]
    The list of backup_collection.
    backupId string
    compartmentId string
    The OCID of the compartment that contains the backup.
    displayName string
    A user-friendly display name for the backup. Avoid entering confidential information.
    filters GetBackupsFilter[]
    id string
    The OCID of the backup.
    state string
    The current state of the backup.
    timeEnded string
    timeStarted string
    backup_collections Sequence[psql.GetBackupsBackupCollection]
    The list of backup_collection.
    backup_id str
    compartment_id str
    The OCID of the compartment that contains the backup.
    display_name str
    A user-friendly display name for the backup. Avoid entering confidential information.
    filters Sequence[psql.GetBackupsFilter]
    id str
    The OCID of the backup.
    state str
    The current state of the backup.
    time_ended str
    time_started str
    backupCollections List<Property Map>
    The list of backup_collection.
    backupId String
    compartmentId String
    The OCID of the compartment that contains the backup.
    displayName String
    A user-friendly display name for the backup. Avoid entering confidential information.
    filters List<Property Map>
    id String
    The OCID of the backup.
    state String
    The current state of the backup.
    timeEnded String
    timeStarted String

    Supporting Types

    GetBackupsBackupCollection

    GetBackupsBackupCollectionItem

    BackupSize int
    The size of the backup, in gigabytes.
    CompartmentId string
    The ID of the compartment in which to list resources.
    DbSystemDetails List<GetBackupsBackupCollectionItemDbSystemDetail>
    Information about the database system associated with a backup.
    DbSystemId string
    The OCID of the backup's source database system.
    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    Description string
    A description for the backup.
    DisplayName string
    A filter to return only resources that match the entire display name given.
    FreeformTags Dictionary<string, string>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Id string
    A unique identifier for the database system.
    LastAcceptedRequestToken string
    lastAcceptedRequestToken from MP.
    LastCompletedRequestToken string
    lastCompletedRequestToken from MP.
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    RetentionPeriod int
    Backup retention period in days.
    SourceType string
    Specifies whether the backup was created manually, or by a management policy.
    State string
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    SystemTags Dictionary<string, string>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The date and time the backup request was received, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z
    TimeUpdated string
    The date and time the backup was updated, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z
    BackupSize int
    The size of the backup, in gigabytes.
    CompartmentId string
    The ID of the compartment in which to list resources.
    DbSystemDetails []GetBackupsBackupCollectionItemDbSystemDetail
    Information about the database system associated with a backup.
    DbSystemId string
    The OCID of the backup's source database system.
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    Description string
    A description for the backup.
    DisplayName string
    A filter to return only resources that match the entire display name given.
    FreeformTags map[string]string
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Id string
    A unique identifier for the database system.
    LastAcceptedRequestToken string
    lastAcceptedRequestToken from MP.
    LastCompletedRequestToken string
    lastCompletedRequestToken from MP.
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    RetentionPeriod int
    Backup retention period in days.
    SourceType string
    Specifies whether the backup was created manually, or by a management policy.
    State string
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    SystemTags map[string]string
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The date and time the backup request was received, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z
    TimeUpdated string
    The date and time the backup was updated, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z
    backupSize Integer
    The size of the backup, in gigabytes.
    compartmentId String
    The ID of the compartment in which to list resources.
    dbSystemDetails List<GetBackupsBackupCollectionItemDbSystemDetail>
    Information about the database system associated with a backup.
    dbSystemId String
    The OCID of the backup's source database system.
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description String
    A description for the backup.
    displayName String
    A filter to return only resources that match the entire display name given.
    freeformTags Map<String,String>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id String
    A unique identifier for the database system.
    lastAcceptedRequestToken String
    lastAcceptedRequestToken from MP.
    lastCompletedRequestToken String
    lastCompletedRequestToken from MP.
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    retentionPeriod Integer
    Backup retention period in days.
    sourceType String
    Specifies whether the backup was created manually, or by a management policy.
    state String
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    systemTags Map<String,String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The date and time the backup request was received, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z
    timeUpdated String
    The date and time the backup was updated, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z
    backupSize number
    The size of the backup, in gigabytes.
    compartmentId string
    The ID of the compartment in which to list resources.
    dbSystemDetails GetBackupsBackupCollectionItemDbSystemDetail[]
    Information about the database system associated with a backup.
    dbSystemId string
    The OCID of the backup's source database system.
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description string
    A description for the backup.
    displayName string
    A filter to return only resources that match the entire display name given.
    freeformTags {[key: string]: string}
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id string
    A unique identifier for the database system.
    lastAcceptedRequestToken string
    lastAcceptedRequestToken from MP.
    lastCompletedRequestToken string
    lastCompletedRequestToken from MP.
    lifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    retentionPeriod number
    Backup retention period in days.
    sourceType string
    Specifies whether the backup was created manually, or by a management policy.
    state string
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    systemTags {[key: string]: string}
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated string
    The date and time the backup request was received, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z
    timeUpdated string
    The date and time the backup was updated, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z
    backup_size int
    The size of the backup, in gigabytes.
    compartment_id str
    The ID of the compartment in which to list resources.
    db_system_details Sequence[psql.GetBackupsBackupCollectionItemDbSystemDetail]
    Information about the database system associated with a backup.
    db_system_id str
    The OCID of the backup's source database system.
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description str
    A description for the backup.
    display_name str
    A filter to return only resources that match the entire display name given.
    freeform_tags Mapping[str, str]
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id str
    A unique identifier for the database system.
    last_accepted_request_token str
    lastAcceptedRequestToken from MP.
    last_completed_request_token str
    lastCompletedRequestToken from MP.
    lifecycle_details str
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    retention_period int
    Backup retention period in days.
    source_type str
    Specifies whether the backup was created manually, or by a management policy.
    state str
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    system_tags Mapping[str, str]
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created str
    The date and time the backup request was received, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z
    time_updated str
    The date and time the backup was updated, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z
    backupSize Number
    The size of the backup, in gigabytes.
    compartmentId String
    The ID of the compartment in which to list resources.
    dbSystemDetails List<Property Map>
    Information about the database system associated with a backup.
    dbSystemId String
    The OCID of the backup's source database system.
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description String
    A description for the backup.
    displayName String
    A filter to return only resources that match the entire display name given.
    freeformTags Map<String>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id String
    A unique identifier for the database system.
    lastAcceptedRequestToken String
    lastAcceptedRequestToken from MP.
    lastCompletedRequestToken String
    lastCompletedRequestToken from MP.
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    retentionPeriod Number
    Backup retention period in days.
    sourceType String
    Specifies whether the backup was created manually, or by a management policy.
    state String
    A filter to return only resources if their lifecycleState matches the given lifecycleState.
    systemTags Map<String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The date and time the backup request was received, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z
    timeUpdated String
    The date and time the backup was updated, expressed in RFC 3339 timestamp format. Example: 2016-08-25T21:10:29.600Z

    GetBackupsBackupCollectionItemDbSystemDetail

    DbVersion string
    The major and minor versions of the database system software.
    SystemType string
    Type of the database system.
    DbVersion string
    The major and minor versions of the database system software.
    SystemType string
    Type of the database system.
    dbVersion String
    The major and minor versions of the database system software.
    systemType String
    Type of the database system.
    dbVersion string
    The major and minor versions of the database system software.
    systemType string
    Type of the database system.
    db_version str
    The major and minor versions of the database system software.
    system_type str
    Type of the database system.
    dbVersion String
    The major and minor versions of the database system software.
    systemType String
    Type of the database system.

    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.18.0 published on Friday, Nov 22, 2024 by Pulumi