Viewing protocol plug-ins and the contents of plug-in properties files

System administrators can view the protocol plug-ins that are on Eclipse Amlen and the contents of their properties files by using the Eclipse Amlen REST API GET method.

You can view the protocol plug-ins that are on Eclipse Amlen and the contents of their properties files. The contents of a properties file can be displayed only after the protocol plug-in server has been restarted after the protocol plug-in to which the properties file applies has been configured.

  1. To view the protocol plug-ins on Eclipse Amlen, use the Eclipse Amlen REST API GET method with the following Eclipse Amlen URI:

    http://<admin-endpoint-IP:Port>/ima/v1/configuration/Plugin

  2. To view the contents of the properties file for a specified protocol plug-in, use the Eclipse Amlen REST API GET method with the following Eclipse Amlen URI:

    http://<admin-endpoint-IP:Port>/ima/v1/configuration/Plugin/<PluginName>/PropertiesFile

    Where:
    <PluginName>
    Specifies the name of the protocol plug-in for which you want to view the contents of the properties file.

The following example shows a GET method to view the protocol plug-ins on Eclipse Amlen by using cURL:

curl -X GET http://127.0.0.1:9089/ima/v1/configuration/Plugin
The following example shows a successful example response to the GET method that was used to view the protocols on Eclipse Amlen.

 {
  "Version": "v1",
  "Plugin": {
    "json_msg": {
      "File": "jsonplugin.zip",
      "PropertiesFile": "jsonplugin.json"
    },
    "restmsg": {
      "File": "restmsg.zip",
      "PropertiesFile": "restmsg.json"
    }
  }
}
The following example shows the contents of the properties file of the plug-in named json_msg.
curl -X GET http://127.0.0.1:9089/ima/v1/configuration/Plugin/json_msg/PropertiesFile
An example response to the GET method, showing the contents of the properties file:

 /*
 * Copyright (c) 2015-2021 Contributors to the Eclipse Foundation
 * See the NOTICE file(s) distributed with this work for additional
 * information regarding copyright ownership.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * This file defined the Amlen plug-in for the json_msg sample protocol
 */
{
    /*
     * The name of the plug-in.  This must be unique among all installed plug-ins.  The name is limited
     * to 64 characters and must be a valid Java name.  It can start with any alphabetic character,
     * currency symbol, or underscore, and continue with any such character or a digit.
     */
    "Name":        "json_msg",

    /*
     * The protocol family against which to authorize.  Each plug-in represents a single protocol family,
     * but the same protocol family may be used by several plug-ins.  The plug-in can also use one of the
     * system protocol families.  All policy checking for protocol is done based on this protocol.
     * The name must be limited to 64 characters and must contain only ASCII-7 characters not including
     * control characters (0x00 to 0x1F and x07F), space, or the separator characters '()<>[]{},;:\/?=".
     */
    "Protocol":    "json_msg",

    /*
     * A set of jar files containing the Java classes needed for the plug-in as a JSON array of strings.
     * This must not include the path, and these jar files should be in the root directory of the zip file
     * used to define the plug-in.  These jar files are used only by this plug-in using a separate directory
     * and class loader for each plug-in.  The file must exist in the zip file used for install.
     */
    "Classpath":   [ "jsonprotocol.jar" ],

    /*
     * The name of the initial class to load for a plug-in.  This must be an instance of ImaPluginListener.
     * This must be a valid Java package name and class name separated by dots.
     */
    "Class":       "com.ibm.ima.samples.plugin.jsonmsg.JMPlugin",

    /*
     * An array of WebSockets sub-protocols supported by this plug-in.  These are checked in a case independent
     * manor.  These should be unique among the installed plug-in set.  If this property is missing or the array
     * is empty, then no WebSockets protocol will connect to this plug-in.  The name must be limited to 64 characters
     * and must contain only ASCII-7 characters not including control characters (0x00 to 0x1F and x07F),
     * space, or the separator characters '()<>[]{},;:\/?=".
     */
    "WebSocket":   [ "json-msg" ],

    /*
     * A set of initial bytes which can be specified as an array of strings of length 1 byte or as integers
     * of the value 0-255.  A single entry with the value "ALL" indicates that any initial byte will be selected.
     * If this is not specified or the array is empty, then TCP connections will not be accepted.
     */
    "InitialByte": [ "{" ],       /* The json_msg always starts with a JSON object */

    /*
     * Define the capabilities of the plug-in
     */
    "UseQueue":    false,         /* This plug-in does not implement queues */
    "UseTopic":    true,          /* This plug-in implemetns topics */

    /*
     * A set of properties which are sent to the plug-in as configuration.
     * The names and types of the properties are not known to the IBM WIoTP Message Gateway server
     */
    "Properties": {
        "Debug": true,
        "UpdatedConfigProperty": true
    }
}