Generic Methods
  • 05 Dec 2022
  • Dark
    Light
  • PDF

Generic Methods

  • Dark
    Light
  • PDF

Article Summary

Generic Methods

These are adapter methods that IAP or you may use. There are other methods not shown here that can be used for internal adapter functionality.

NOTE: Each adapter should have a CALLS.md file for you to reference.

Method Signature Description Workflow?
connect() This call is run when the adapter is first loaded by the Itential Platform. It validates the properties have been provided correctly. No
healthCheck(callback) This call ensures that the adapter can communicate with Atlassian Jira. The actual call that is used is defined in the adapter properties and .system entities action.json file. No
refreshProperties(properties) This call provides the adapter the ability to accept property changes without having to restart the adapter. No
encryptProperty(property, technique, callback) This call will take the provided property and technique, and return the property encrypted with the technique. This allows the property to be used in the adapterProps section for the credential password so that the password does not have to be in clear text. The adapter will decrypt the property as needed for communications with Atlassian Jira. No
iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, callback) This call provides the ability to update the adapter configuration from IAP - includes actions, schema, mockdata and other configurations. Yes
iapFindAdapterPath(apiPath, callback) This call provides the ability to see if a particular API path is supported by the adapter. Yes
iapSuspendAdapter(mode, callback) This call provides the ability to suspend the adapter and either have requests rejected or put into a queue to be processed after the adapter is resumed. Yes
iapUnsuspendAdapter(callback) This call provides the ability to resume a suspended adapter. Any requests in queue will be processed before new requests. Yes
iapGetAdapterQueue(callback) This call will return the requests that are waiting in the queue if throttling is enabled. Yes
iapTroubleshootAdapter(props, persistFlag, adapter, callback) This call can be used to check on the performance of the adapter - it checks connectivity, healthcheck and basic get calls. Yes
iapRunAdapterHealthcheck(adapter, callback) This call will return the results of a healthcheck. Yes
iapRunAdapterConnectivity(callback) This call will return the results of a connectivity check. Yes
iapRunAdapterBasicGet(callback) This call will return the results of running basic get API calls. Yes
iapMoveAdapterEntitiesToDB(callback) This call will push the adapter configuration from the entities directory into the Adapter or IAP Database. Yes
genericAdapterRequest(uriPath, restMethod, queryData, requestBody, addlHeaders, callback) This call allows you to provide the path to have the adapter call. It is an easy way to incorporate paths that have not been built into the adapter yet. Yes
genericAdapterRequestNoBasePath(uriPath, restMethod, queryData, requestBody, addlHeaders, callback) This call is the same as the genericAdapterRequest only it does not add a base_path or version to the call. Yes
iapHasAdapterEntity(entityType, entityId, callback) This call verifies the adapter has the specific entity. No
iapVerifyAdapterCapability(entityType, actionType, entityId, callback) This call verifies the adapter can perform the provided action on the specific entity. No
iapUpdateAdapterEntityCache() This call will update the entity cache. No

ADAPTER.JS

constructor(prongid, properties) {
  // Instantiate the AdapterBase super class
  super(prongid, properties);

  // Uncomment if you have things to add to the constructor like using your own properties.
  // Otherwise the constructor in the adapterBase will be used.
  // Capture my own properties -they need to be defined in propertiesSchema.json
  if (this.allProps && this.allProps.myownproperty) {
    mypropvariable = this.allProps.myownproperty;
  }
}


healthCheck(reqObj, callback) {


hasEntity(entityType, entityId, callback) {


verifyCapability(entityType, actionType, entityId, callback) {


updateEntityCache() {

Adapter Broker Calls

These are adapter methods used to integrate with IAP Brokers.

Method Signature Description Workflow?
hasEntities(entityType, entityList, callback) This call is utilized by the IAP Device Broker to determine if the adapter has a specific entity and item of the entity. No
getDevice(deviceName, callback) This call returns the details of the requested device. Yes
getDevicesFiltered(options, callback) This call returns the list of devices that match the criteria provided in the options filter. Yes
isAlive(deviceName, callback) This call returns whether the device status is active Yes
getConfig(deviceName, format, callback) This call returns the configuration for the selected device. Yes
iapGetDeviceCount(callback) This call returns the count of devices. Yes

Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.