Overview
Updating an adapter using the iapUpdateAdapterConfiguration call allows users to update their adapter configuration from within the Itential Platform rather than having to make changes in the file system of the adapter.
The iapUpdateAdapterConfiguration call can be used to update connection settings, credentials, or other configuration parameters of an adapter from within the Itential Platform. This includes updating crucial data such as the Endpoint Configuration (action.json, schema.json) and Mock Data. Additionally, we can update the package.json of the adapter.
This is a generic method and has the capability to be performed in most Itential adapters.
Note: This should not be used in our SaaS Platform as the changes made to the file system would be removed the next time the Itential Platform is restarted as it will be rebuilt from the image which does not include the changes.
How to Run IAP Update Configuration in Adapters
The iapUpdateAdapterConfiguration is a task we can use in a workflow. Within the Itential Platform application, navigate to Automation Studio and then select workflow builder. Then, under the adapter you are trying to update, add the iapUpdateAdapterConfiguration task.
The example below demonstrates using the call to update a mock data file in an adapter.
Figure 1. Input Definitions
| Input | Description |
|---|---|
| configFile | the name of the file being updated (required) |
| changes | an object containing all of the changes = formatted like the configuration file (required) |
| Entity | the entity to be changed, if an action, schema or mock data file (optional) |
| type | the type of entity file to change, (action, schema, mock) (optional) |
| action | the action to be changed, if an action, or mock data file (optional) |
| callback | the results of the call |
An action is the task / call that has mock data that is being updated. The inputs to the task are what is needed to identify what file you want to change and what those changes will be.
The iapUpdateAdapterConfiguration task would run an update in the mock data file that is specified in the first variable (configFile) - with the data placed in changes. Because we selected true for the replace variable, the previous mock data is updated with the desired changes. Otherwise, the data would be combined with the existing file. The replace variable is only used when the type is mock.
The result leaves you with the desired changes in the adapter without having to make changes in the file system.