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
- 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.
- Rename the file to include a different name or number after the hyphen, for example: com.ge.dspmicro.packagehandler-1.config.
- Configure the name and installation path for the package handler.
Property Description Type Default Value Required com.ge.dspmicro.packagehandler.handler.name
Name of the handler processing the package received. String machine Yes com.ge.dspmicro.packagehandler.installations.path
Package Framework service will place downloaded package meant for this handler in this directory path may be absolute or relative to Predix Machine root. String installation Yes Example configuration values:com.ge.dspmicro.packagehandler.handler.name="myhandler" com.ge.dspmicro.packagehandler.installations.path="my-install-path"
- 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:Field Type Description status
String The status must be either "success" or "failure." Note: Only failure statuses are displayed in the EdgeManger UI.errorcode
Integer The error code should be zero (0) for success, or in the range of 50 - 255 for failure. See Upgrade Return Codes for more information.
message
String A message to display for the status. For example, "The configuration could not be updated."
starttime Long The start time must be in seconds. endtime Long The 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:
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.T = String I = Integer L = Long F = Float D = Double X = Byte S = Short C = Character B = Boolean 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 }