Update adapter configuration fromItential Platform

The iapUpdateAdapterConfiguration method lets you update adapter configuration from withinItential Platform rather than editing files directly on the server. It can update endpoint configuration files (such as action.json and schema files), mock data files, and package.json.

Do not use iapUpdateAdapterConfiguration in the Itential SaaS platform. Changes made to the file system are lost the next timeItential Platform restarts, because the environment is rebuilt from an image that does not include those changes.

Run the task in a workflow

InItential Platform, navigate to Automation Studio and open Workflow Builder. Find the adapter you want to update, then add the iapUpdateAdapterConfiguration task to your workflow.

Input parameters

InputRequiredDescription
configFileYesThe name of the file to update.
changesYesAn object containing the changes to apply, formatted to match the structure of the target configuration file.
entityNoThe entity the file belongs to — required when updating an action, schema, or mock data file.
typeNoThe type of entity file to update: action, schema, or mock.
actionNoThe action the file is associated with — required when updating an action or mock data file.
callbackReturns the result of the call.

When type is mock, an additional replace input controls whether the existing mock data is replaced by the contents of changes (true) or merged with it (false).

Example: updating a mock data file

Set configFile to the name of the mock data file you want to update and changes to the new data. Set type to mock and replace to true to overwrite the existing content rather than merging it. Set entity and action to identify which entity and action the mock data file belongs to.

The task writes the changes to the file in the adapter’s directory, so the updated mock data is available immediately without a restart or any direct file system access.