Wednesday, June 16, 2021

#861 Some Ideas for OIC Fleet Management

 










As you can see, the above graphic is WIP.

I am getting some ideas together on this and seeing how the OIC Monitoring APIs can help me out here.

Use case is I have a fleet of OIC instances and need some intel on them.


Connections 

Here I want a list of my configured connections and their status - I will write the salient data to a file -

Here is an excerpt from the output file - 

























I use the following apis - 


 

















I test these in Postman to get the response JSON for use in defining the OIC Invokes - 

I orchestrate the calls via an OIC integration - creating a REST connection to my OIC instance.













The above part creates the output file using the FILE STAGE action.














I now invoke the OIC REST api to get the configured connections -
















The Map for q is as follows - I am looking for all configured connections with the prefix AA- (these all belong to me)





I then write the connection name to the file (WriteConnectionDetails) -



















Then I test the individual connections (TestConnection) - Invoke configured as follows -














Now to the Scope Fault Handler -


 
















As you can see, I specifically check for Locked Connections - 

Final step is to write the file created by STAGE FILE to an ftp directory - I am using the embedded OIC File Server here.

Connectivity Agents











Here I check the status of OIC agents, using the following api -


 

 

This returns a list of agents within their agent groups -

Let's look at one of my agents - 












Here is the relevant json - 






...







All the salient info is here - agent group, agent name and status.

Output file extract - 





I won't go into great detail on the integration here - suffice to say I use the same OIC REST connection as follows -


 

notice the 2 For Each Loops - 

The first loop -








The second loop - 









Integration Errors

Here I call the following 2 apis - 















First I invoke Retrieve Errored Instances and iterate over the errored instances, invoking Retrieve an Errored Integration Instance.














The output file is as follows - 











Conclusion

I got these basic samples together very quickly. Naturally, I could have written the data to a DB instead of to a file. Essentially, I could have pushed this data anywhere. 

I mentioned fleet in the title, i.e. more than 1 OIC instance. My REST api connection for leveraging the OIC Monitoring included the hardcoded OIC instance url, so I would need such a connection for each OIC instance, or else use another form of authentication.

 


Sunday, June 6, 2021

#859 OIC - SFDC -Bulk api








Simple example here - I use the bulk api to load data from an Oracle DB into an SFDC custom object.

Here is my DB table - 





Here is my SFDC custom object -









The integration is simple - 














The SFDC invoke is configured as follows - 










Here is the content of the DB table - 






Activate and test - review in SFDC - 



















The job stays here - remaining in progress.

I need to revisit the integration and add the following invoke to SFDC - 






 











Activate and Test - 














Now let's look at the response from CompleteBulkLoad shown above - 












2 records failed - now this is because I have already done a successful import for these 2 rows - 

I check in SFDC - 










The job is completed, but failed for the aforementioned reason.

I update the DB rows and re-test - 





















Naturally, I can also model the integration as follows, i.e. without the loop -


 












The Map to BulkLoadCustomObject is then as follows - 












I update the DB rows to ensure no duplicates on load - 


 







I activate and test the integration - 










Leveraging UPSERT option

Ensure the SFDC custom object has a field with the following box checked - External Id

































I need to map an extra field, apart from my 4 fields - 










I set this to the external id field name, concatenated with an empty string e.g.
concat ("field1Required__c", "" )

Activate, test -