Configuring Package Handler

Configure the name and installation path for the package handler.

About this task

Note: You must provide your own installer service, which monitors the installation directory you specify in the package handler configuration file.

Procedure

  1. Navigate to <Predix Machine runtime container location>/configuration/machine and make a copy of the default package handler configuration file com.ge.dspmicro.packagehandler.machine.config.
  2. Rename the file to include a different name or number after the hyphen, for example: com.ge.dspmicro.packagehandler-1.config.
  3. Configure the name and installation path for the package handler.
    PropertyDescriptionTypeDefault ValueRequired
    com.ge.dspmicro.packagehandler.handler.nameName of the handler processing the package received.StringmachineYes
    com.ge.dspmicro.packagehandler.installations.pathPackage Framework service will place downloaded package meant for this handler in this directory path may be absolute or relative to Predix Machine root.StringinstallationYes
    Example configuration values:
    com.ge.dspmicro.packagehandler.handler.name="myhandler"
    com.ge.dspmicro.packagehandler.installations.path="my-install-path"
  4. Once the package is processed by the installation service, you must drop a "status" JSON file in the <machine>/appdata/packageframework directory.
    Note: The <status>.json file must have the name of the downloaded package.

    For example:

    Name of downloaded package: A7F4FA68-B76E-4185-8C21-316CF57DAE2F.APPLICATION.deviceid-version.zip

    Expected JSON name: A7F4FA68-B76E-4185-8C21-316CF57DAE2F.APPLICATION.deviceid-version.json

    The JSON file must have the following four fields:
    FieldTypeDescription
    status StringThe status must be either "success" or "failure."
    Note: Only failure statuses are displayed in the EdgeManger UI.
    errorcodeIntegerThe error code should be zero (0) for success, or in the range of 50 - 255 for failure.

    See Upgrade Return Codes for more information.

    messageStringA message to display for the status. For example, "The configuration could not be updated."
    starttimeLongThe start time must be in seconds.
    endtimeLongThe end time must be in seconds.
    Note: The end time is not displayed in the Edge Manager UI.
    When you format values for properties in .config files (as opposed to .cfg files), use the type character followed by a quoted string representation of value. For example, a Boolean property=B"true". Lowercase type character implies primitives. The type can be omitted for a string. The types and corresponding type characters are shown in the following table:
    T = StringI = IntegerL = Long
    F = FloatD = DoubleX = Byte
    S = ShortC = CharacterB = Boolean
    Array format is property=<type>["<value1>","<value2>"]. For example, array of integer property=I["1", "2", "3"]. A backslash may be used to break up the line for clarity.
    Example:
    {
        "status" : "success",
        "message" : "The configuration was updated successfully.",
        "starttime" : 1489541848,
        "endtime" : 1489541855
    }
     
    Failure JSON example
    {
        "status" : "failure",
        "message" : "The configuration could not be updated.",
        "starttime" : 1489541848,
        "endtime" : 1489541855
    }