oracle.oci.oci_sch_service_connector_actions – Perform actions on a ServiceConnector resource in Oracle Cloud Infrastructure

Note

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

New in version 2.9.0: of oracle.oci

Synopsis

  • Perform actions on a ServiceConnector resource in Oracle Cloud Infrastructure

  • For action=activate, activates the specified service connector. After you send your request, the service connector’s state is temporarily UPDATING. When the state changes to ACTIVE, data begins transferring from the source service to the target service. For instructions on activating service connectors, see To activate a service connector.

  • For action=change_compartment, moves a service connector into a different compartment within the same tenancy. For information about moving resources between compartments, see Moving Resources to a Different Compartment. When provided, If-Match is checked against ETag values of the resource.

  • For action=deactivate, deactivates the specified service connector. After you send your request, the service connector’s state is temporarily UPDATING and any data transfer stops. The state then changes to INACTIVE. For instructions on deactivating service connectors, see To deactivate a service connector.

Requirements

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

Parameters

Parameter Choices/Defaults Comments
action
string / required
    Choices:
  • activate
  • change_compartment
  • deactivate
The action to perform on the ServiceConnector.
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 to move the service connector to.
Required for action=change_compartment.
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.
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.
service_connector_id
string / required
The OCID of the service connector.

aliases: id
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
wait
boolean
    Choices:
  • no
  • yes ←
Whether to wait for create or delete operation to complete.
wait_timeout
integer
Time, in seconds, to wait when wait=yes. Defaults to 1200 for most of the services but some services might have a longer wait timeout.

Examples

- name: Perform action activate on service_connector
  oci_sch_service_connector_actions:
    # required
    service_connector_id: "ocid1.serviceconnector.oc1..xxxxxxEXAMPLExxxxxx"
    action: activate

- name: Perform action change_compartment on service_connector
  oci_sch_service_connector_actions:
    # required
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
    service_connector_id: "ocid1.serviceconnector.oc1..xxxxxxEXAMPLExxxxxx"
    action: change_compartment

- name: Perform action deactivate on service_connector
  oci_sch_service_connector_actions:
    # required
    service_connector_id: "ocid1.serviceconnector.oc1..xxxxxxEXAMPLExxxxxx"
    action: deactivate

Return Values

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

Key Returned Description
service_connector
complex
on success
Details of the ServiceConnector resource acted upon by the current operation

Sample:
{'compartment_id': 'ocid1.compartment.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_state': 'CREATING', 'lifecyle_details': 'lifecyle_details_example', 'source': {'cursor': {'kind': 'LATEST'}, 'kind': 'logging', 'log_sources': [{'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'log_group_id': 'ocid1.loggroup.oc1..xxxxxxEXAMPLExxxxxx', 'log_id': 'ocid1.log.oc1..xxxxxxEXAMPLExxxxxx'}], 'monitoring_sources': [{'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'namespace_details': {'kind': 'selected', 'namespaces': [{'metrics': {'kind': 'all'}, 'namespace': 'namespace_example'}]}}], 'stream_id': 'ocid1.stream.oc1..xxxxxxEXAMPLExxxxxx'}, 'system_tags': {}, 'target': {'batch_rollover_size_in_mbs': 56, 'batch_rollover_time_in_ms': 56, 'bucket_name': 'bucket_name_example', 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'dimensions': [{'dimension_value': {'kind': 'jmesPath', 'path': 'path_example', 'value': 'value_example'}, 'name': 'name_example'}], 'enable_formatted_messaging': True, 'function_id': 'ocid1.function.oc1..xxxxxxEXAMPLExxxxxx', 'kind': 'functions', 'log_group_id': 'ocid1.loggroup.oc1..xxxxxxEXAMPLExxxxxx', 'log_source_identifier': 'log_source_identifier_example', 'metric': 'metric_example', 'metric_namespace': 'metric_namespace_example', 'namespace': 'namespace_example', 'object_name_prefix': 'object_name_prefix_example', 'stream_id': 'ocid1.stream.oc1..xxxxxxEXAMPLExxxxxx', 'topic_id': 'ocid1.topic.oc1..xxxxxxEXAMPLExxxxxx'}, 'tasks': [{'batch_size_in_kbs': 56, 'batch_time_in_sec': 56, 'condition': 'condition_example', 'function_id': 'ocid1.function.oc1..xxxxxxEXAMPLExxxxxx', 'kind': 'function'}], 'time_created': '2013-10-20T19:20:30+01:00', 'time_updated': '2013-10-20T19:20:30+01:00'}
 
compartment_id
string
on success
The OCID of the compartment containing the service connector.

Sample:
ocid1.compartment.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
The description of the resource. Avoid entering confidential information.

Sample:
description_example
 
display_name
string
on success
A user-friendly name. It does not have to be unique, and it is changeable. Avoid entering confidential information.

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
The OCID of the service connector.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
lifecycle_state
string
on success
The current state of the service connector.

Sample:
CREATING
 
lifecyle_details
string
on success
A message describing the current state in more detail. For example, the message might provide actionable information for a resource in a `FAILED` state.

Sample:
lifecyle_details_example
 
source
complex
on success

   
cursor
complex
on success

     
kind
string
on success
The type descriminator.

Sample:
LATEST
   
kind
string
on success
The type descriminator.

Sample:
logging
   
log_sources
complex
on success
The logs for this Logging source.

     
compartment_id
string
on success
The OCID of the compartment containing the log source.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
     
log_group_id
string
on success
The OCID of the log group.

Sample:
ocid1.loggroup.oc1..xxxxxxEXAMPLExxxxxx
     
log_id
string
on success
The OCID of the log.

Sample:
ocid1.log.oc1..xxxxxxEXAMPLExxxxxx
   
monitoring_sources
complex
on success
The list of metric namespaces to retrieve data from.

     
compartment_id
string
on success
The OCID of the compartment containing the metric namespaces you want to use for the Monitoring source.

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

       
kind
string
on success
The type discriminator.

Sample:
selected
       
namespaces
complex
on success
The namespaces for the compartment-specific list.

         
metrics
complex
on success

           
kind
string
on success
The type descriminator.

Sample:
all
         
namespace
string
on success
The source service or application to use when querying for metric data points. Must begin with `oci_`.
Example: `oci_computeagent`

Sample:
namespace_example
   
stream_id
string
on success
The OCID of the stream.

Sample:
ocid1.stream.oc1..xxxxxxEXAMPLExxxxxx
 
system_tags
dictionary
on success
The system tags associated with this resource, if any. The system tags are set by Oracle Cloud Infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: `{orcl-cloud: {free-tier-retain: true}}`

 
target
complex
on success

   
batch_rollover_size_in_mbs
integer
on success
The batch rollover size in megabytes.

Sample:
56
   
batch_rollover_time_in_ms
integer
on success
The batch rollover time in milliseconds.

Sample:
56
   
bucket_name
string
on success
The name of the bucket. Avoid entering confidential information.

Sample:
bucket_name_example
   
compartment_id
string
on success
The OCID of the compartment containing the metric.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
   
dimensions
complex
on success
List of dimension names and values.

     
dimension_value
complex
on success

       
kind
string
on success
The type of dimension value: static or evaluated.

Sample:
jmesPath
       
path
string
on success
The location to use for deriving the dimension value (evaluated). The path must start with `logContent` in an acceptable notation style with supported JMESPath selectors: expression with dot and index operator (`.` and `L(]`). Example with dot notation: `logContent.data` Example with index notation: `logContent.data[0].content` For information on valid dimension keys and values, see [MetricDataDetails Reference,https://docs.cloud.oracle.com/en- us/iaas/api/#/en/monitoring/latest/datatypes/MetricDataDetails). The returned value depends on the results of evaluation. If the evaluated value is valid, then the evaluated value is returned without double quotes. (Any front or trailing double quotes are trimmed before returning the value. For example, the evaluated value `"compartmentId"` is returned as `compartmentId`.) If the evaluated value is invalid, then the returned value is `SCH_EVAL_INVALID_VALUE`. If the evaluated value is empty, then the returned value is `SCH_EVAL_VALUE_EMPTY`.

Sample:
path_example
       
value
string
on success
The data extracted from the specified dimension value (passed as-is). Unicode characters only. For information on valid dimension keys and values, see MetricDataDetails Reference.

Sample:
value_example
     
name
string
on success
Dimension key. A valid dimension key includes only printable ASCII, excluding periods (.) and spaces. Custom dimension keys are acceptable. Avoid entering confidential information. Due to use by Service Connector Hub, the following dimension names are reserved: `connectorId`, `connectorName`, `connectorSourceType`. For information on valid dimension keys and values, see MetricDataDetails Reference. Example: `type`

Sample:
name_example
   
enable_formatted_messaging
boolean
on success
Whether to apply a simplified, user-friendly format to the message. Applies only when friendly formatting is supported by the service connector source and the subscription protocol.
Example: `true`

Sample:
True
   
function_id
string
on success
The OCID of the function.

Sample:
ocid1.function.oc1..xxxxxxEXAMPLExxxxxx
   
kind
string
on success
The type descriminator.

Sample:
functions
   
log_group_id
string
on success
The OCID of the Logging Analytics log group.

Sample:
ocid1.loggroup.oc1..xxxxxxEXAMPLExxxxxx
   
log_source_identifier
string
on success
Identifier of the log source that you want to use for processing data received from the service connector source. Applies to `StreamingSource` only. Equivalent to `name` at LogAnalyticsSource.

Sample:
log_source_identifier_example
   
metric
string
on success
The name of the metric.
Example: `CpuUtilization`

Sample:
metric_example
   
metric_namespace
string
on success
The namespace of the metric.
Example: `oci_computeagent`

Sample:
metric_namespace_example
   
namespace
string
on success
The namespace.

Sample:
namespace_example
   
object_name_prefix
string
on success
The prefix of the objects. Avoid entering confidential information.

Sample:
object_name_prefix_example
   
stream_id
string
on success
The OCID of the stream.

Sample:
ocid1.stream.oc1..xxxxxxEXAMPLExxxxxx
   
topic_id
string
on success
The OCID of the topic.

Sample:
ocid1.topic.oc1..xxxxxxEXAMPLExxxxxx
 
tasks
complex
on success
The list of tasks.

   
batch_size_in_kbs
integer
on success
Size limit (kilobytes) for batch sent to invoke the function.

Sample:
56
   
batch_time_in_sec
integer
on success
Time limit (seconds) for batch sent to invoke the function.

Sample:
56
   
condition
string
on success
A filter or mask to limit the source used in the flow defined by the service connector.

Sample:
condition_example
   
function_id
string
on success
The OCID of the function to be used as a task.

Sample:
ocid1.function.oc1..xxxxxxEXAMPLExxxxxx
   
kind
string
on success
The type descriminator.

Sample:
function
 
time_created
string
on success
The date and time when the service connector was created. Format is defined by RFC3339. Example: `2020-01-25T21:10:29.600Z`

Sample:
2013-10-20T19:20:30+01:00
 
time_updated
string
on success
The date and time when the service connector was updated. Format is defined by RFC3339. Example: `2020-01-25T21:10:29.600Z`

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


Authors

  • Oracle (@oracle)