oracle.oci.oci_stack_monitoring_monitored_resource_facts – Fetches details about a MonitoredResource resource 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_stack_monitoring_monitored_resource_facts.

New in version 2.9.0: of oracle.oci

Synopsis

  • Fetches details about a MonitoredResource resource in Oracle Cloud Infrastructure

  • Gets a monitored resource by identifier

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.
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.
display_name
string
Use display_name along with the other options to return only resources that match the given display name exactly.
monitored_resource_id
string / required
The OCID of monitored resource.

aliases: id
name
string
Use name along with the other options to return only resources that match the given name exactly.
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.
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 monitored_resource
  oci_stack_monitoring_monitored_resource_facts:
    # required
    monitored_resource_id: "ocid1.monitoredresource.oc1..xxxxxxEXAMPLExxxxxx"

Return Values

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

Key Returned Description
monitored_resource
complex
on success
MonitoredResource resource

Sample:
{'aliases': {'credential': {'name': 'name_example', 'service': 'service_example', 'source': 'source_example'}, 'name': 'name_example', 'source': 'source_example'}, 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'credentials': {'credential_type': 'EXISTING', 'description': 'description_example', 'key_id': 'ocid1.key.oc1..xxxxxxEXAMPLExxxxxx', 'name': 'name_example', 'properties': [{'name': 'name_example', 'value': 'value_example'}], 'source': 'source_example', 'type': 'type_example'}, 'database_connection_details': {'connector_id': 'ocid1.connector.oc1..xxxxxxEXAMPLExxxxxx', 'db_id': 'ocid1.db.oc1..xxxxxxEXAMPLExxxxxx', 'db_unique_name': 'db_unique_name_example', 'port': 56, 'protocol': 'TCP', 'service_name': 'service_name_example', 'ssl_secret_id': 'ocid1.sslsecret.oc1..xxxxxxEXAMPLExxxxxx'}, 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'display_name': 'display_name_example', 'external_id': 'ocid1.external.oc1..xxxxxxEXAMPLExxxxxx', 'freeform_tags': {'Department': 'Finance'}, 'host_name': 'host_name_example', 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'lifecycle_state': 'CREATING', 'management_agent_id': 'ocid1.managementagent.oc1..xxxxxxEXAMPLExxxxxx', 'name': 'name_example', 'properties': [{'name': 'name_example', 'value': 'value_example'}], 'resource_time_zone': 'resource_time_zone_example', 'system_tags': {}, 'tenant_id': 'ocid1.tenant.oc1..xxxxxxEXAMPLExxxxxx', 'time_created': '2013-10-20T19:20:30+01:00', 'time_updated': '2013-10-20T19:20:30+01:00', 'type': 'type_example'}
 
aliases
complex
on success

   
credential
complex
on success

     
name
string
on success
The name of the pre-existing source credential which alias cred should point to. This should refer to the pre-existing source attribute binded credential name.

Sample:
name_example
     
service
string
on success
The name of the service owning the credential. Ex stack-monitoring or dbmgmt

Sample:
service_example
     
source
string
on success
The source type and source name combination,delimited with (.) separator. This refers to the pre-existing source which alias cred should point to. Ex. {source type}.{source name} and source type max char limit is 63.

Sample:
source_example
   
name
string
on success
The name of the alias, within the context of the source.

Sample:
name_example
   
source
string
on success
The source type and source name combination,delimited with (.) separator. Ex. {source type}.{source name} and source type max char limit is 63.

Sample:
source_example
 
compartment_id
string
on success
Compartment Identifier OCID

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
 
credentials
complex
on success

   
credential_type
string
on success
Type of credentials specified in the credentials element. Three possible values - EXISTING, PLAINTEXT and ENCRYPTED. * EXISTING - Credential is already stored in agent and only credential name need to be passed for existing credential. * PLAINTEXT - The credential properties will have credentials in plain text format. * ENCRYPTED - The credential properties will have credentials stored in vault in encrypted format using KMS client which uses master key for encryption. The same master key will be used to decrypt the credentials before passing on to the management agent.

Sample:
EXISTING
   
description
string
on success
The user-specified textual description of the credential.

Sample:
description_example
   
key_id
string
on success
The master key OCID and applicable only for property value type ENCRYPTION. Key OCID is passed as input to Key management service decrypt API to retrieve the encrypted property value text.

Sample:
ocid1.key.oc1..xxxxxxEXAMPLExxxxxx
   
name
string
on success
The name of the credential, within the context of the source.

Sample:
name_example
   
properties
complex
on success
The credential properties list. Credential property values will be encrypted format.

     
name
string
on success
The name of the credential property, should confirm with names of properties of this credential's type. Ex. For JMXCreds type , credential property name for weblogic user is 'Username'.

Sample:
name_example
     
value
string
on success
The value of the credential property name. Ex. For JMXCreds type, credential property value for 'Username' property is 'weblogic'.

Sample:
value_example
   
source
string
on success
The source type and source name combination,delimited with (.) separator. {source type}.{source name} and source type max char limit is 63.

Sample:
source_example
   
type
string
on success
The type of the credential ( ex. JMXCreds,DBCreds).

Sample:
type_example
 
database_connection_details
complex
on success

   
connector_id
string
on success
Database connector Identifier

Sample:
ocid1.connector.oc1..xxxxxxEXAMPLExxxxxx
   
db_id
string
on success
dbId of the database

Sample:
ocid1.db.oc1..xxxxxxEXAMPLExxxxxx
   
db_unique_name
string
on success
UniqueName used for database connection requests.

Sample:
db_unique_name_example
   
port
integer
on success
Listener Port number used for connection requests.

Sample:
56
   
protocol
string
on success
Protocol used in DB connection string when connecting to external database service.

Sample:
TCP
   
service_name
string
on success
Service name used for connection requests.

Sample:
service_name_example
   
ssl_secret_id
string
on success
SSL Secret Identifier for TCPS connector in OCI VaultL(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)

Sample:
ocid1.sslsecret.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'}}
 
display_name
string
on success
Monitored resource display name.

Sample:
display_name_example
 
external_id
string
on success
External resource is any OCI resource identifier OCID which is not a Stack Monitoring service resource. Currently supports only following resource type identifiers - externalcontainerdatabase, externalnoncontainerdatabase, externalpluggabledatabase and OCI compute instance.

Sample:
ocid1.external.oc1..xxxxxxEXAMPLExxxxxx
 
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'}
 
host_name
string
on success
Monitored resource host name.

Sample:
host_name_example
 
id
string
on success
The OCID of monitored resource.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
lifecycle_state
string
on success
Lifecycle state of the monitored resource.

Sample:
CREATING
 
management_agent_id
string
on success
Management Agent Identifier OCID.

Sample:
ocid1.managementagent.oc1..xxxxxxEXAMPLExxxxxx
 
name
string
on success
Monitored resource name.

Sample:
name_example
 
properties
complex
on success
List of monitored resource properties

   
name
string
on success
property name

Sample:
name_example
   
value
string
on success
property value

Sample:
value_example
 
resource_time_zone
string
on success
Time zone in the form of tz database canonical zone ID.

Sample:
resource_time_zone_example
 
system_tags
dictionary
on success
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud": {"free-tier-retained": "true"}}`

 
tenant_id
string
on success
Tenancy Identifier OCID

Sample:
ocid1.tenant.oc1..xxxxxxEXAMPLExxxxxx
 
time_created
string
on success
The time the the resource was created. An RFC3339 formatted datetime string

Sample:
2013-10-20T19:20:30+01:00
 
time_updated
string
on success
The time the the resource was updated. An RFC3339 formatted datetime string

Sample:
2013-10-20T19:20:30+01:00
 
type
string
on success
Monitored resource type

Sample:
type_example


Authors

  • Oracle (@oracle)