Hitachi

JP1 Version 12 JP1/Integrated Management 2 - Manager Command, Definition File and API Reference


4.1.1 Format of the user-created plug-in

The user-created plug-in is written in JavaScript and provides its functionality in the CommonJS module format. The following example shows the format of a user-created plug-in and how to write a method called when configuration information is retrieved.

Format
module.exports = {
          operations-of-the-user-created-plug-in
};
Example
module.exports = {
          // Operations performed when configuration information is retrieved
          __configurationGet : function(args) {
                 // Determine if the configuration collection should be processed with args.component
                 if (args.component !== "/HITACHI/JP1/PP/CONFINFO") {
                         return;
                 }
                 // If yes:
                 // When args.data contains configuration information in JSON format, pass it as it is
args.setResult(args.data);
          },
};

The following shows the rules for writing the user-created plug-in: