Skip to content
This repository has been archived by the owner on May 1, 2021. It is now read-only.

Latest commit

 

History

History
466 lines (416 loc) · 29 KB

oci_search_resources_facts_module.rst

File metadata and controls

466 lines (416 loc) · 29 KB
source

cloud/oracle/oci_search_resources_facts.py

orphan

oci_search_resources_facts -- Finds resources in your cloud network

2.5

Synopsis

  • This module allows the user to finds resources in your cloud network. Queries any and all compartments in the tenancy to find resources that match the specified criteria. Results include resources that you have permission to view and can span different resource types. You can also sort results based on a specified resource attribute.

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_type
string
    Choices:
  • api_key ←
  • instance_principal
  • instance_obo_user
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.
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.
matching_context_type
-
    Choices:
  • NONE ←
  • HIGHLIGHTS
The type of matching context returned in the response. If you specify HIGHLIGHTS, then the service will highlight fragments in its response. (See SearchContext in the RETURN section for more information.) The default setting is NONE.
query
-
The structured query describing which resources to search for. Required when structured search is desired, type="Structured".
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
text
-
The text to search for. Required when free text search is desired, type="FreeText".
type
- / required
    Choices:
  • FreeText
  • Structured
The type of SearchDetails, whether FreeText or Structured.

Notes

Examples

- name: Perform a free-text search
  oci_search_resources_facts:
    type: 'FreeText'
    text: "MyVCN1"
    matching_context_type: "HIGHLIGHTS"

- name: Perform a structured search to find a "user" resource whose display name is "Jane"
  oci_search_resources_facts:
    type: "Structured"
    query: "query user resources where displayName = 'jane'"

Return Values

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

Key Returned Description
search_resources
complex
On successful operation
A resource that exists in the user's cloud network.

Sample:
[{'definedTags': {}, 'resourceType': 'User', 'availabilityDomain': None, 'displayName': 'Jane.Doe', 'lifecycleState': 'ACTIVE', 'timeCreated': '2016-12-12T19:31:03.749Z', 'identifier': 'ocid1.user.oc1..examplea..xxxxxEXAMPLExxxxx', 'compartmentId': 'ocidv1:tenancy:oc1:phx:1457636318783:examp..xxxxxEXAMPLExxxxx', 'searchContext': {'highlights': {'description': ["<h1>Jane</h1> Doe's account"]}}, 'freeformTags': {}}, {'definedTags': {}, 'resourceType': 'Compartment', 'availabilityDomain': None, 'displayName': 'JanesCompartment', 'lifecycleState': 'ACTIVE', 'timeCreated': '2017-01-20T00:18:14.236Z', 'identifier': 'ocid1.compartment.oc1....xxxxxEXAMPLExxxxx', 'compartmentId': 'ocidv1:tenancy:oc1:phx:1457636318783:..xxxxxEXAMPLExxxxx', 'searchContext': {'highlights': {'description': ['Compartment for <h1>Jane</h1> Doe to use']}}, 'freeformTags': {}}]
  availability_domain
string
always
The availability domain this resource is located in, if applicable.

  compartment_id
string
always
The OCID of the compartment that contains this resource.

  defined_tags
string
always
The defined tags associated with this resource, if any.

  display_name
string
always
The display name (or name) of this resource, if one exists.

  freeform_tags
string
always
The freeform tags associated with this resource, if any.

  identifier
string
always
The unique identifier for this particular resource, usually an OCID.

  lifecycle_state
string
always
The lifecycle state of this resource, if applicable.

  resource_type
string
always
The resource type name.

  search_context
complex
always
Contains search context, such as highlighting, for found resources.

    highlights
-

    returned
-

    type
-

  time_created
string
always
The time this resource was created.



Status

  • This module is not guaranteed to have a backwards compatible interface. [preview]
  • This module is maintained by the Ansible Community <modules_support>. [community]

Authors

  • Sivakumar Thyagarajan (@sivakumart)

Hint

If you notice any issues in this documentation you can edit this document to improve it.