Monitoring OCI Data Integration Tasks using the OCI CLI

One of the simplest ways to work with Oracle Cloud Infrastructure is via the CLI. This lets you do all kinds of interesting stuff with OCI Data Integration, Data Catalog and all other services! This post is a follow on to the post on ‘Executing Tasks using OCI CLI in Oracle Cloud Infrastructure Data Integration’, here we will see how to monitor them.

In that post we saw how you could execute tasks in Data Integration using the OCI CLI, here we will execute the Data Integration task;

oci data-integration task-run create --workspace-id YOUR_WORKSPACE_OCID --application-key YOUR_APPLICATION_KEY --registry-metadata '{"aggregator-key":"YOUR_TASK_KEY"}'

The response for this will have a key for the task run that you will need to monitor the run;

The jq command is available in Cloud Shell so you can get the task run key easily from payloads for example, using jq and .data.key below will return only the key value;

oci data-integration task-run create --workspace-id YOUR_WORKSPACE_OCID --application-key YOUR_APPLICATION_KEY --registry-metadata '{"aggregator-key":"YOUR_TASK_KEY"}' | jq '.data.key'

Then another to monitor the task run;

oci data-integration task-run get --workspace-id YOUR_WORKSPACE_OCID --application-key YOUR_APPLICATION_KEY --task_run_key YOUR_TASK_RUN_KEY

You can get the status and other interesting information from the response;

The jq command is available in Cloud Shell so you can get the status easily from payloads for example, using jq and .data.status below will return only the status value;

oci data-integration task-run get --workspace-id YOUR_WORKSPACE_OCID --application-key YOUR_APPLICATION_KEY --task_run_key YOUR_TASK_RUN_KEY | jq '.data.status'

These functions can be used to execute tasks and monitor status, remember the jobs can also be monitored in the OCI Console as below;

All of the CLI OCI Data Integration operations are defined here. In this example I used the Cloud Shell from within OCI Console to execute this, wherever you have the CLI installed this can also be done. Remember, test and call the CLI from Cloud Shell— easy and always there!

Very cool, and what makes it better is that as new functionality is added into the OCI Data Integration service and any other service, the CLIs are automatically updated.

See here for more information on OCI Data Integration;

https://www.oracle.com/middleware/data-integration/oracle-cloud-infrastructure-data-integration

Have fun, check out the CLI!

Architect at @Oracle developing cloud services for data. Connect on Twitter @i_m_dave