A payload is serialized to a json file that all SDKs can desacralize. The file contains instructions to the plugin regarding attributes, input data sources, and output data sources that will define the overall job assigned to a plugin.


type Payload struct {
	IOManager
	Actions    []Action          `json:"actions"`
}
CODE


When payloads are loaded by the PluginManager, the SDK updates the payload to dynamically replace information in the payload based on Environment Variables and Payload Attributes. A payload can have a file path, data path, or datasource name with the appropriate information based on the following syntax. Environment variables will be updated if {ENV::<variablename>} is inserted into an updateable element, and the variable name is present in the Environment Variables of the container. Likewise attributes will be updated if {ATTR::<attributename>}  is updated if the PayloadAttributes contain the specified attribute name. If an attribute name or a environment variable is used in substitution but not provided at compute time, the PluginManager will fatally fail.


Example Payload

{
    "stores": [
        {
            "name":      "FFRD",
            "store_type": "S3",
            "profile": "FFRD",
            "params": {
                "root": "/model-library"
            }
        }
    ],
    "payloadAttributes": {
      "modelPrefix": "modelname",
      "modelPath": "model-directory"
	  "outputPath": "simulations"
    },
    "inputs":{
	    {
           "name": "{ATTR::modelPrefix}.json",
           "paths": {
               "default":"{ATTR::modelPath}/{ATTR::modelPrefix}.json"
            },
			"store_name": "FFRD"   
        } 
    },
    "outputs": [
        {
            "name": "output.json",
            "paths": {
                    "default":"{ATTR::outputPath}/{ENV::CC_EVENT_NUMBER}/{ATTR::modelPath}/output.json"
            },
            "store_name": "FFRD"   
        }
    ],
    "actions":[
        {
            "name":        "compute_json",
            "type":        "compute_json",
            "description": "compute something",
            "params": {
                "parameter1":      true,
                "parameter2":      "parametervalue2",
                "parameter3": "2.3"
            }
        } 
    ]   
}
CODE