Monday, November 18, 2019

OIC: Monitoring REST APIs examples using curl

Continuing the series of my previous posts on examples of OIC rest apis in this blog I will provide some additional examples of using curl to retrieve monitoring data.  

Getting logs

curl -X GET -H 'Authorization: Bearer access_token' -o <ics_log>.zip https://instance-name.us.oraclecloud.com/ic/api/integration/v1/monitoring/logs/{id}

 curl -u username@email.com:password -X GET  -H "Content-Type:application/json" -o flow_logs.zip https://instance-name.integration.ocp.oraclecloud.com/ic/api/integration/v1/monitoring/logs/icsflowlog

Valid values for log id: icsflowlog, icsdiagnosticlog, icsauditlog

You can provide additional parameter for filtering the result - for example following will return data for last one day. 

 curl -u username@email.com:password  -X GET  -H "Content-Type:application/json" -o flow_logs.log https://instance-name.integration.ocp.oraclecloud.com/ic/api/integration/v1/monitoring/logs/icsflowlog "q={timewindow: '1d'}"

For the next set of apis you can filter the result by time period, time window and also by the integration by adding following additional parameters

You can use time window as well - must be entered in - 'yyyy-MM-dd HH:mm:ss' UTC format

"q={startdate : '2016-09-23 07:07:07', enddate : '2016-09-23 08:17:07’}"

And filter the results for a given flow…

"q={timewindow: '3d', code: HELLO_WORLD, version: '01.02.0000'}” 


Friday, October 18, 2019

OIC: REST APIs Examples for managing Integrations

Expanding upon the last article I'm providing additional details and examples for using Oracle Integration Cloud REST APIs for managing your integrations. 

Note that for the examples below I will be using one of the pre-packaged integration named Hello World (version 1.2.000)

To limit the size of this posting I'm just providing examples only and limiting to common use-cases (small subset of the options). For additional details and completeness pls refer the official doc - REST API documentation


To get list of Integrations

curl -u username@email.password  -v -H "Content-Type:application/json" -H "Accept:application/json" -X GET https://instance-name.integration.ocp.oraclecloud.com/ic/api/integration/v1/integrations


Export one integration 

 curl -u username@email.password -X GET  -H "Content-Type:application/json" -o ./HELLO_WORLD_01.02.0000.iar_BAK https://instance-name.integration.ocp.oraclecloud.com/ic/api/integration/v1/integrations/HELLO_WORLD%7C01.02.0000/archive 


Friday, October 11, 2019

OIC: List of Integrations by Creator

Oracle Integration Cloud provides rich set of REST APIs to manage your connections/integration and life-cycle events. See details here for complete set.

There the APIs to get list of integration in JSON format but at this point there is no out of box API support for filtering out the results by creator or author of the artifact. One can use common programming language to parse the filter out the results but that require additional effort.

In this blog, I will provide simple command line means of achieving that. We will use curl and one command line library to parse JSON data - https://stedolan.github.io/jq/ 

The following was developed and tested on Mac OS (Mojave 10.14.6 ) and OIC version 19.3.1.0.0 (190624.1100.29533)

Install jq
brew install jq

Get list of integrations

Replace the highlighted (in blue) for your environment...

curl -u username@email.com:password -H "Content-Type:application/json" -H "Accept:application/json" -X GET https://instance-name.integration.ocp.oraclecloud.com/ic/api/integration/v1/integrations | jq '. |  {code: [.items[].code]}'


Understanding JavaScript Prototypal Inheritance for Java developers

Inheritance is a fundamental concept in programming languages. However, it is implemented differently in Object-Oriented Languages such as J...