Wednesday, March 19, 2025

#1062 OCI Logging Analytics Dashboards for OIC - more details

I go into a bit more detail here - based on the following Billing Dashboard. The first section looks at linking a new widget to the dashboard filter.  

There are 4 dashboards for OIC, delivered OOTB with OCI Logging Analytics.

Each of these dashboards has the following filters -

The OIC Environment Filter enables fleet management and the ability to drill down into individual OIC instances.

So how do I link a new widget to this filter? Let's look at a simple example; I'll begin with the following widget, based on the OCI Service Metric , Consumed messages (Billed Messages for Integration)

I save the query for future use, but first, I add a new widget to my dashboard -

Let's replace the ocid with the following - BilledMessageCount[60m]{resourceId = $(params.oic-env)}.grouping().sum()

here we will link the oic-env parameter to the filter - 

Now we can run the query - 

Let's group on integration - 

Check out the table - 

Note, we are also seeing entries for hours where there are no billed messages. Also the column titles are not very user friendly.

I save the widget and return to the dashboard, where I save the dashboard as well.

I then export the dashboard definition, this is a .json file.

I now look for my new widget - I called mine BlogDemo. Here I can change the column titles and also suppress data for hours where there were no billable messages.

Now to changing the column titles - 

Finally, save and import - 

There is another way to edit the .json definition - 

Observability & Management -> Management Dashboard -> Dashboards

Open the BlogDemo widget - 
Click on {JSON} -























  











Friday, March 14, 2025

#1061 - OIC Projects - Copying Integrations

Starting point is two projects, A and B.

Both projects are private.

Project A contains 1 integration, that is not available to other projects -

I select the Copy Integration option in Project B -

I return to Project A and make the integration shareable - then back to Project B - 







 



Monday, February 24, 2025

#1060 - OIC3 - Projects API

Introduction

This post shows how you can use the OIC3 Factory apis to manage the lifecycle of your OIC projects. 

I cover creating a project, applying RBAC to a project, activating project integrations, updating project connection configuration data, cloning a project, creating project deployment and export.

So, without further ado, let's begin.



Creating a Project

/ic/api/integration/v1/projects?integrationInstance=yourOICInstance













Request payload - 

{"name": "MYPROJECT",
"code": "MYPROJECT",
"keyword": "createdViaAPI",
"description": "using Postman"}

Response - 

{
    "code": "MYPROJECT",
    "description": "using Postman",
    "id": "MYPROJECT",
    "keyword": "createdviaapi",
    "links": [],
    "name": "MYPROJECT",
    "origin": {},
    "state": {
        "assets": {},
        "created": {
            "by": "4b60...",
            "date": "2025-02-24T07:34:37.620+0000"
        },
        "latest": {
            "by": "4b60...",
            "date": "2025-02-24T07:34:37.620+0000"
        },
        "lockStatus": false,
        "locked": {},
        "projectRevisionId": 0,
        "serviceInstanceId": 0,
        "status": "DRAFT",
        "updated": {
            "by": "4b60...",
            "date": "2025-02-24T07:34:37.620+0000"
        }
    },
    "type": "DEVELOPED"
}

Check out the project is OIC - note that Created by is set to the client id of the confidential app, I'm using for OAuth.















Setting Project ACL

Here I want to specify my project as private, i.e. set myself as owner.

The api I will use is - 
















Note the highlighted id value. Net, net, I want to define who the project owner is. The id is the IDCS id of my user - niall.commiskey@oracle.com.

I can use the following api to retrieve the id - 

/ic/api/integration/v1/identifies?integrationInstance=yourOICInstance

Here is my id - 



















Now to the RBAC api call - 

/ic/api/integration/v1/projects/MYPROJECT/acl?integrationInstance=yourOICInstance

The Request payload - 

{"administrators":{"allowAll":false,
"allowed":[{"id":"9a1ab......",
"displayName":"Niall Commiskey",
"type":"user"}]}
}

There is no response.

I check out the project in the OIC Designtime - 

This is a private project, but I also want admins to be able to view the flows. Hence I need to set Can monitor.

Back to the same api - where I will specify who can monitor - here is the group I will use. This group data is also returned by the /identifies api mentioned above.


I could also allow everyone to monitor, but here, I assign a specific group -

{"administrators":{"allowAll":false,
"allowed":[{"id":"9a1a...",
"displayName":"Niall Commiskey",
"type":"user"}]}
,
"monitors":{"allowAll":false,
"allowed":[{"id":"cdc9...",
"displayName":"OICPM_Administrators",
"type":"group"}] }
}



I validate in the OIC designtime - 














Updating Project ACL

Say I want to change the monitor setting to Everyone -

{
"monitors":{"allowAll":true,
"allowed":[] }
}

Note, I must also set the "allowed" field to [ ].

{"administrators":{"allowAll":false,
"allowed":[{"id":"9a1a...",
"displayName":"Niall Commiskey",
"type":"user"}]}
,
"monitors":{"allowAll":true,
"allowed":[] }
}



Validate the result in OIC designtime - 

Please note - the updateACL payload is expected to include all the different roles object like administrator, editor,  monitor etc. If you do not send the data for a particular role, then it will be initialised, under the assumption that you want to remove that particular role setting.

Importing integrations into the project 

Currently we can only export individual integrations from the global space, i.e. integrations not in projects.

The import api to use is the following - 
Validate in OIC designtime - 

Activating Integrations

The connection I imported is a REST Trigger, so is per default, configured. Ergo, I can go ahead and activate the integration - here I use the following api

/ic/api/integration/v1/projects/{projectId}/integrations/{id}


My url is as follows -

/ic/api/integration/v1/projects/MYPROJECT/integrations/AA_SIMPLE_SYNC_WITHCHIL|01.00.0000?integrationInstance=myOICInstance

Note, integration id contains the version number. The response -

{
    "apiDeploymentInprogress": false,
    "compatible": false,
    "links": [],
    "lockedFlag": false,
    "scheduleApplicableFlag": false,
    "scheduleDefinedFlag": false,
    "status": "ACTIVATION_INPROGRESS",
    "tempCopyExists": false,
    "totalEndPoints": 0
}

I validate in OIC designtime - 

Updating Connection Configuration

Now to another example - this integration writes an order to a database - 

I export / import the integration -

As you can see, the DB connection is in draft state. I open the connection and see the configuration has been wiped - 

These I need to reset - 


My url is as follows - 

/ic/api/integration/v1/projects/MYPROJECT/connections/ORCL_DB?integrationInstance=myOICInstance


The request payload - 

{  
        "connectionProperties": [{
         "propertyGroup": "CONNECTION_PROPS",
         "propertyName": "Host",  
         "propertyValue": "localhost"
        },
         {"propertyGroup": "CONNECTION_PROPS",
         "propertyName": "Port",  
         "propertyValue": "1521"        
        },
         {"propertyGroup": "CONNECTION_PROPS",
         "propertyName": "SID",  
         "propertyValue": "ORCL"        
        }],

        "securityPolicy": "USERNAME_PASSWORD_TOKEN",  
        "securityProperties":  [{
          "propertyGroup": "CREDENTIALS",
          "propertyName": "username",  
          "propertyValue": "myDBUser"  
        },  
        {"propertyGroup": "CREDENTIALS",
         "propertyName": "password",
         "propertyValue": "myPwd"
          }]  
   
}

Note, the connectivity agent setting has not been wiped, so I do not have to set it.
The DB connection has now the state = configured, so I can activate the integration - 

/ic/api/integration/v1/projects/MYPROJECT/integrations/CREATEORDERDB|01.00.0000?integrationInstance=myOICInstance

Integration is activated - 

Cloning a Project


POST
/ic/api/integration/v1/projects/MYPROJECT/clone?integrationInstance=myOICInstance


Request payload -

 {"code":"YOURPROJECT","name":"YOUPROJECT","description":"clone of template project, MYPROJECT"}
 

  
Validate in the OIC designtime - 

Project Deployments

My project currently contains 2 integrations - 

Let's create a deployment that includes just 1 of them - createOrderDB. This is simple to do via the UI, but now let's use the factory api.

Request payload - 

{"name":"MYProjectV1",
 "code":"MYPROJECTV1",
 "description":"V1 deployment",
 "integrations":[
    {"code":"CREATEORDERDB",
    "version":"01.00.0000"}
    ]
}  
 

Validate in OIC designtime - 

Now to the project export - when exporting a project via the UI, you can specify a specific deployment to use, or just export all.

Here we will leverage the factory api to export, based on a deployment. 

Here is the request payload - 

{"name":"MYPROJECT",
"code":"MYPROJECT",
"type":"DEVELOPED",
"builtBy":"",
"label":"MYPROJECTV1"}

I save the response to a local file -