oracle.oci.oci_mysql_backup_facts – Fetches details about one or multiple Backup resources in Oracle Cloud Infrastructure

Note

This plugin is part of the oracle.oci collection (version 5.3.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install oracle.oci.

To use it in a playbook, specify: oracle.oci.oci_mysql_backup_facts.

New in version 2.9.0: of oracle.oci

Synopsis

  • Fetches details about one or multiple Backup resources in Oracle Cloud Infrastructure

  • Get a list of DB System backups.

  • If backup_id is specified, the details of a single Backup will be returned.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
api_user
string
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
string
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
string
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
string
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_purpose
string
    Choices:
  • service_principal
The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None.
auth_type
string
    Choices:
  • api_key ←
  • instance_principal
  • instance_obo_user
  • resource_principal
  • security_token
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
backup_id
string
The OCID of the Backup
Required to get a specific backup.

aliases: id
cert_bundle
string
The full path to a CA certificate bundle to be used for SSL verification. This will override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE variable, if any, is used.
compartment_id
string
The compartment OCID.
Required to list multiple backups.
config_file_location
string
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
string
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
creation_type
string
    Choices:
  • MANUAL
  • AUTOMATIC
  • OPERATOR
Backup creationType
db_system_id
string
The DB System OCID.
display_name
string
A filter to return only the resource matching the given display name exactly.

aliases: name
lifecycle_state
string
    Choices:
  • CREATING
  • ACTIVE
  • INACTIVE
  • UPDATING
  • DELETING
  • DELETED
  • FAILED
Backup Lifecycle State
realm_specific_endpoint_template_enabled
boolean
    Choices:
  • no
  • yes
Enable/Disable realm specific endpoint template for service client. By Default, realm specific endpoint template is disabled. If not set, then the value of the OCI_REALM_SPECIFIC_SERVICE_ENDPOINT_TEMPLATE_ENABLED variable, if any, is used.
region
string
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
sort_by
string
    Choices:
  • timeCreated
  • timeUpdated
  • displayName
The field to sort by. Only one sort order may be provided. Time fields are default ordered as descending.
sort_order
string
    Choices:
  • ASC
  • DESC
The sort order to use (ASC or DESC).
tenancy
string
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm

Examples

- name: Get a specific backup
  oci_mysql_backup_facts:
    # required
    backup_id: "ocid1.backup.oc1..xxxxxxEXAMPLExxxxxx"

- name: List backups
  oci_mysql_backup_facts:
    # required
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    backup_id: "ocid1.backup.oc1..xxxxxxEXAMPLExxxxxx"
    lifecycle_state: CREATING
    db_system_id: "ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx"
    display_name: display_name_example
    creation_type: MANUAL
    sort_by: timeCreated
    sort_order: ASC

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
backups
complex
on success
List of Backup resources

Sample:
[{'backup_size_in_gbs': 56, 'backup_type': 'FULL', 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'creation_type': 'MANUAL', 'data_storage_size_in_gbs': 56, 'db_system_id': 'ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx', 'db_system_snapshot': {'admin_username': 'admin_username_example', 'availability_domain': 'Uocm:PHX-AD-1', 'backup_policy': {'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'freeform_tags': {'Department': 'Finance'}, 'is_enabled': True, 'pitr_policy': {'is_enabled': True}, 'retention_in_days': 56, 'window_start_time': 'window_start_time_example'}, 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'configuration_id': 'ocid1.configuration.oc1..xxxxxxEXAMPLExxxxxx', 'crash_recovery': 'ENABLED', 'data_storage_size_in_gbs': 56, 'database_management': 'ENABLED', 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'deletion_policy': {'automatic_backup_retention': 'DELETE', 'final_backup': 'SKIP_FINAL_BACKUP', 'is_delete_protected': True}, 'description': 'description_example', 'display_name': 'display_name_example', 'endpoints': [{'hostname': 'hostname_example', 'ip_address': 'ip_address_example', 'modes': [], 'port': 56, 'port_x': 56, 'resource_id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'resource_type': 'DBSYSTEM', 'status': 'ACTIVE', 'status_details': 'status_details_example'}], 'fault_domain': 'FAULT-DOMAIN-1', 'freeform_tags': {'Department': 'Finance'}, 'hostname_label': 'hostname_label_example', 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'ip_address': 'ip_address_example', 'is_highly_available': True, 'maintenance': {'window_start_time': 'window_start_time_example'}, 'mysql_version': 'mysql_version_example', 'port': 56, 'port_x': 56, 'shape_name': 'shape_name_example', 'subnet_id': 'ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx'}, 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'description': 'description_example', 'display_name': 'display_name_example', 'freeform_tags': {'Department': 'Finance'}, 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'lifecycle_details': 'lifecycle_details_example', 'lifecycle_state': 'CREATING', 'mysql_version': 'mysql_version_example', 'retention_in_days': 56, 'shape_name': 'shape_name_example', 'time_created': '2013-10-20T19:20:30+01:00', 'time_updated': '2013-10-20T19:20:30+01:00'}]
 
backup_size_in_gbs
integer
on success
The size of the backup in base-2 (IEC) gibibytes. (GiB).

Sample:
56
 
backup_type
string
on success
The type of backup.

Sample:
FULL
 
compartment_id
string
on success
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
 
creation_type
string
on success
Indicates how the backup was created: manually, automatic, or by an Operator.

Sample:
MANUAL
 
data_storage_size_in_gbs
integer
on success
Initial size of the data volume in GiBs.

Sample:
56
 
db_system_id
string
on success
The OCID of the DB System the backup is associated with.

Sample:
ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx
 
db_system_snapshot
complex
on success
Returned for get operation

   
admin_username
string
on success
The username for the administrative user.

Sample:
admin_username_example
   
availability_domain
string
on success
The Availability Domain where the primary DB System should be located.

Sample:
Uocm:PHX-AD-1
   
backup_policy
complex
on success

     
defined_tags
dictionary
on success
Usage of predefined tag keys. These predefined keys are scoped to namespaces.
Tags defined here will be copied verbatim as tags on the Backup resource created by this BackupPolicy.
Example: `{"foo-namespace": {"bar-key": "value"}}`

Sample:
{'Operations': {'CostCenter': 'US'}}
     
freeform_tags
dictionary
on success
Simple key-value pair applied without any predefined name, type or scope. Exists for cross-compatibility only.
Tags defined here will be copied verbatim as tags on the Backup resource created by this BackupPolicy.
Example: `{"bar-key": "value"}`

Sample:
{'Department': 'Finance'}
     
is_enabled
boolean
on success
If automated backups are enabled or disabled.

Sample:
True
     
pitr_policy
complex
on success

       
is_enabled
boolean
on success
Specifies if PITR is enabled or disabled.

Sample:
True
     
retention_in_days
integer
on success
The number of days automated backups are retained.

Sample:
56
     
window_start_time
string
on success
The start of a 30-minute window of time in which daily, automated backups occur.
This should be in the format of the "Time" portion of an RFC3339-formatted timestamp. Any second or sub-second time data will be truncated to zero.
At some point in the window, the system may incur a brief service disruption as the backup is performed.
If not defined, a window is selected from the following Region-based time-spans: - eu-frankfurt-1: 20:00 - 04:00 UTC - us-ashburn-1: 03:00 - 11:00 UTC - uk-london-1: 06:00 - 14:00 UTC - ap-tokyo-1: 13:00 - 21:00 - us-phoenix-1: 06:00 - 14:00

Sample:
window_start_time_example
   
compartment_id
string
on success
The OCID of the compartment the DB System belongs in.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
   
configuration_id
string
on success
The OCID of the Configuration to be used for Instances in this DB System.

Sample:
ocid1.configuration.oc1..xxxxxxEXAMPLExxxxxx
   
crash_recovery
string
on success
Whether to run the DB System with InnoDB Redo Logs and the Double Write Buffer enabled or disabled, and whether to enable or disable syncing of the Binary Logs.

Sample:
ENABLED
   
data_storage_size_in_gbs
integer
on success
Initial size of the data volume in GiBs that will be created and attached.

Sample:
56
   
database_management
string
on success
Whether to enable monitoring via the Database Management service.

Sample:
ENABLED
   
defined_tags
dictionary
on success
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace": {"bar-key": "value"}}`

Sample:
{'Operations': {'CostCenter': 'US'}}
   
deletion_policy
complex
on success

     
automatic_backup_retention
string
on success
Specifies if any automatic backups created for a DB System should be retained or deleted when the DB System is deleted.

Sample:
DELETE
     
final_backup
string
on success
Specifies whether or not a backup is taken when the DB System is deleted. REQUIRE_FINAL_BACKUP: a backup is taken if the DB System is deleted. SKIP_FINAL_BACKUP: a backup is not taken if the DB System is deleted.

Sample:
SKIP_FINAL_BACKUP
     
is_delete_protected
boolean
on success
Specifies whether the DB System can be deleted. Set to true to prevent deletion, false (default) to allow.

Sample:
True
   
description
string
on success
User-provided data about the DB System.

Sample:
description_example
   
display_name
string
on success
The user-friendly name for the DB System. It does not have to be unique.

Sample:
display_name_example
   
endpoints
complex
on success
The network endpoints available for this DB System.

     
hostname
string
on success
The network address of the DB System.

Sample:
hostname_example
     
ip_address
string
on success
The IP address the DB System is configured to listen on.

Sample:
ip_address_example
     
modes
list / elements=string
on success
The access modes from the client that this endpoint supports.

     
port
integer
on success
The port the MySQL instance listens on.

Sample:
56
     
port_x
integer
on success
The network port where to connect to use this endpoint using the X protocol.

Sample:
56
     
resource_id
string
on success
The OCID of the resource that this endpoint is attached to.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
     
resource_type
string
on success
The type of endpoint that clients and connectors can connect to.

Sample:
DBSYSTEM
     
status
string
on success
The state of the endpoints, as far as it can seen from the DB System. There may be some inconsistency with the actual state of the MySQL service.

Sample:
ACTIVE
     
status_details
string
on success
Additional information about the current endpoint status.

Sample:
status_details_example
   
fault_domain
string
on success
The name of the Fault Domain the DB System is located in.

Sample:
FAULT-DOMAIN-1
   
freeform_tags
dictionary
on success
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`

Sample:
{'Department': 'Finance'}
   
hostname_label
string
on success
The hostname for the primary endpoint of the DB System. Used for DNS. The value is the hostname portion of the primary private IP's fully qualified domain name (FQDN) (for example, "dbsystem-1" in FQDN "dbsystem-1.subnet123.vcn1.oraclevcn.com"). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123.

Sample:
hostname_label_example
   
id
string
on success
The OCID of the DB System.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
   
ip_address
string
on success
The IP address the DB System is configured to listen on. A private IP address of the primary endpoint of the DB System. Must be an available IP address within the subnet's CIDR. This will be a "dotted-quad" style IPv4 address.

Sample:
ip_address_example
   
is_highly_available
boolean
on success
Specifies if the DB System is highly available.

Sample:
True
   
maintenance
complex
on success

     
window_start_time
string
on success
The start time of the maintenance window.
This string is of the format: "{day-of-week} {time-of-day}".
"{day-of-week}" is a case-insensitive string like "mon", "tue", &c.
"{time-of-day}" is the "Time" portion of an RFC3339-formatted timestamp. Any second or sub-second time data will be truncated to zero.
If you set the read replica maintenance window to "" or if not specified, the read replica is set same as the DB system maintenance window.

Sample:
window_start_time_example
   
mysql_version
string
on success
Name of the MySQL Version in use for the DB System.

Sample:
mysql_version_example
   
port
integer
on success
The port for primary endpoint of the DB System to listen on.

Sample:
56
   
port_x
integer
on success
The network port on which X Plugin listens for TCP/IP connections. This is the X Plugin equivalent of port.

Sample:
56
   
shape_name
string
on success
The shape of the primary instances of the DB System. The shape determines resources allocated to a DB System - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes. To get a list of shapes, use (the ListShapes operation.

Sample:
shape_name_example
   
subnet_id
string
on success
The OCID of the subnet the DB System is associated with.

Sample:
ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx
 
defined_tags
dictionary
on success
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace": {"bar-key": "value"}}`

Sample:
{'Operations': {'CostCenter': 'US'}}
 
description
string
on success
A user-supplied description for the backup.

Sample:
description_example
 
display_name
string
on success
A user-supplied display name for the backup.

Sample:
display_name_example
 
freeform_tags
dictionary
on success
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`

Sample:
{'Department': 'Finance'}
 
id
string
on success
OCID of the backup itself

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
lifecycle_details
string
on success
Additional information about the current lifecycleState.
Returned for get operation

Sample:
lifecycle_details_example
 
lifecycle_state
string
on success
The state of the backup.

Sample:
CREATING
 
mysql_version
string
on success
The MySQL server version of the DB System used for backup.

Sample:
mysql_version_example
 
retention_in_days
integer
on success
Number of days to retain this backup.

Sample:
56
 
shape_name
string
on success
The shape of the DB System used for backup.

Sample:
shape_name_example
 
time_created
string
on success
The time the backup record was created.

Sample:
2013-10-20T19:20:30+01:00
 
time_updated
string
on success
The time at which the backup was updated.
Returned for get operation

Sample:
2013-10-20T19:20:30+01:00


Authors

  • Oracle (@oracle)