oracle.oci.oci_database_management_managed_database_facts – Fetches details about one or multiple ManagedDatabase resources in Oracle Cloud Infrastructure

Note

This plugin is part of the oracle.oci collection (version 4.11.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_database_management_managed_database_facts.

New in version 2.9.0: of oracle.oci

Synopsis

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

  • Gets the Managed Database for a specific ID or the list of Managed Databases in a specific compartment. Managed Databases can be filtered based on the name parameter. Only one of the parameters, ID or name should be provided. If neither of these parameters is provided, all the Managed Databases in the compartment are listed. Managed Databases can also be filtered based on the deployment type and management option. If the deployment type is not specified or if it is ONPREMISE, then the management option is not considered and Managed Databases with ADVANCED management option are listed.

  • If managed_database_id is specified, the details of a single ManagedDatabase 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
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.
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 OCID of the compartment.
Required to list multiple managed_databases.
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.
deployment_type
string
    Choices:
  • ONPREMISE
  • BM
  • VM
  • EXADATA
  • EXADATA_CC
  • AUTONOMOUS
A filter to return Managed Databases of the specified deployment type.
managed_database_id
string
The OCID of the Managed Database.
Required to get a specific managed_database.

aliases: id
management_option
string
    Choices:
  • BASIC
  • ADVANCED
A filter to return Managed Databases with the specified management option.
name
string
A filter to return only resources that match the entire name.
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
  • NAME
The field to sort information by. Only one sortOrder can be used. The default sort order for 'TIMECREATED' is descending and the default sort order for 'NAME' is ascending. The 'NAME' sort order is case-sensitive.
sort_order
string
    Choices:
  • ASC
  • DESC
The option to sort information in ascending ('ASC') or descending ('DESC') order. Ascending order is the default order.
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 managed_database
  oci_database_management_managed_database_facts:
    # required
    managed_database_id: "ocid1.manageddatabase.oc1..xxxxxxEXAMPLExxxxxx"

- name: List managed_databases
  oci_database_management_managed_database_facts:
    # required
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    name: name_example
    management_option: BASIC
    deployment_type: ONPREMISE
    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
managed_databases
complex
on success
List of ManagedDatabase resources

Sample:
[{'additional_details': {}, 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'database_status': 'UP', 'database_sub_type': 'CDB', 'database_type': 'EXTERNAL_SIDB', 'deployment_type': 'ONPREMISE', 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'instance_count': 56, 'instance_details': [{'host_name': 'host_name_example', 'id': 56, 'name': 'name_example', 'status': 'UP'}], 'is_cluster': True, 'managed_database_groups': [{'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'name': 'name_example'}], 'management_option': 'BASIC', 'name': 'name_example', 'parent_container_compartment_id': 'ocid1.parentcontainercompartment.oc1..xxxxxxEXAMPLExxxxxx', 'parent_container_id': 'ocid1.parentcontainer.oc1..xxxxxxEXAMPLExxxxxx', 'parent_container_name': 'parent_container_name_example', 'pdb_count': 56, 'pdb_status': [{'count': 56, 'status': 'UP'}], 'time_created': '2013-10-20T19:20:30+01:00', 'workload_type': 'OLTP'}]
 
additional_details
dictionary
on success
The additional details specific to a type of database defined in `{"key": "value"}` format. Example: `{"bar-key": "value"}`
Returned for get operation

 
compartment_id
string
on success
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
 
database_status
string
on success
The status of the Oracle Database. Indicates whether the status of the database is UP, DOWN, or UNKNOWN at the current time.
Returned for get operation

Sample:
UP
 
database_sub_type
string
on success
The subtype of the Oracle Database. Indicates whether the database is a Container Database, Pluggable Database, Non-container Database, Autonomous Database, or Autonomous Container Database.

Sample:
CDB
 
database_type
string
on success
The type of Oracle Database installation.

Sample:
EXTERNAL_SIDB
 
deployment_type
string
on success
The infrastructure used to deploy the Oracle Database.

Sample:
ONPREMISE
 
id
string
on success
The OCID of the Managed Database.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
instance_count
integer
on success
The number of Oracle Real Application Clusters (Oracle RAC) database instances.
Returned for get operation

Sample:
56
 
instance_details
complex
on success
The details of the Oracle Real Application Clusters (Oracle RAC) database instances.
Returned for get operation

   
host_name
string
on success
The name of the host of the Oracle RAC database instance.

Sample:
host_name_example
   
id
integer
on success
The ID of the Oracle RAC database instance.

Sample:
56
   
name
string
on success
The name of the Oracle RAC database instance.

Sample:
name_example
   
status
string
on success
The status of the Oracle RAC database instance.

Sample:
UP
 
is_cluster
boolean
on success
Indicates whether the Oracle Database is part of a cluster.

Sample:
True
 
managed_database_groups
complex
on success
A list of Managed Database Groups that the Managed Database belongs to.
Returned for get operation

   
compartment_id
string
on success
The OCID of the compartment in which the Managed Database Group resides.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
   
id
string
on success
The OCID of the Managed Database Group.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
   
name
string
on success
The name of the Managed Database Group.

Sample:
name_example
 
management_option
string
on success
The management option used when enabling Database Management.

Sample:
BASIC
 
name
string
on success
The name of the Managed Database.

Sample:
name_example
 
parent_container_compartment_id
string
on success
The OCID of the compartment in which the parent Container Database resides, if the Managed Database is a Pluggable Database (PDB).
Returned for get operation

Sample:
ocid1.parentcontainercompartment.oc1..xxxxxxEXAMPLExxxxxx
 
parent_container_id
string
on success
The OCID of the parent Container Database if Managed Database is a Pluggable Database.

Sample:
ocid1.parentcontainer.oc1..xxxxxxEXAMPLExxxxxx
 
parent_container_name
string
on success
The name of the parent Container Database.
Returned for get operation

Sample:
parent_container_name_example
 
pdb_count
integer
on success
The number of PDBs in the Container Database.
Returned for get operation

Sample:
56
 
pdb_status
complex
on success
The status of the PDB in the Container Database.
Returned for get operation

   
count
integer
on success
The number of PDBs with this status.

Sample:
56
   
status
string
on success
The status of the PDBs with this count.

Sample:
UP
 
time_created
string
on success
The date and time the Managed Database was created.

Sample:
2013-10-20T19:20:30+01:00
 
workload_type
string
on success
The workload type of the Autonomous Database.

Sample:
OLTP


Authors

  • Oracle (@oracle)