Functions
All parameters (if any) are passed into any given engine method as a map. The parameters given in the tables are the keys in the map that will represent the given values.
newPico
Creates a new pico and returns it's id. No parameters are given.
Parameter | Datatype | Required |
---|
------------------ | --------------------- | ----------------- |
response = engine:newPico().klog("Response Structure: ")
/*
Response Structure:
{
"id" : <new_pico_id>
}
*/ |
removePico
removePico does not accept a map, but a single id value as its parameter. |
Parameter | Datatype | Required |
---|
<id> | <string> | YES |
response = engine:removePico(id).klog("engine:removePico Response Structure: ")//id is just a string variable
/*
Response Structure:
undefined
//engine:removePico(id) does not return anything
*/ |
newChannel
Creates a new channel for a pico (identified to the engine by the pico_id parameter).
Parameter | Datatype | Required |
---|
<pico_id> | <string> | YES |
<name> | <string> | YES |
<type> | <string> | YES |
response = engine:newChannel({ "name": "channel_name", "type": "channel_type", "pico_id": id }).klog("Response Structure: ")
/*
Response Structure:
{
"id" : id,
"name": "channel_name",
"type": "channel_type"
}
*/ |
removeChannel
Removes a channel whose eci matches the provided eci. This comparison and deletion takes place on the pico with the provided id.
Parameter | Datatype | Required |
---|
<pico_id> | <string> | YES |
<eci> | <string> | YES |
response = engine:removeChannel({"pico_id": id, "eci": eci_of_channel}).klog("Response Structure: ")
/*
Response Structure:
undefined
//engine:removeChannel({"pico_id": id, "eci": eci_of_channel}) does not return anything
*/ |
registerRuleset
unregisterRuleset(rid)
Unregisters the ruleset given by the rid. It will throw an error if the ruleset is installed on any picos, or depended on by another ruleset.
installRuleset( )
Installs rulesets into a pico.
Parameter | Datatype | Required |
---|
<pico_id> | <string> | YES |
<rid> | string | array | YES |
response = engine:installRuleset( { "pico_id": ent:id, "rid": "wrangler" } );
response = engine:installRuleset( { "pico_id": ent:id, "rid": ["wrangler","Pds"] } );
response = engine:installRuleset( { "pico_id": ent:id, "base": <base>, "url": <url> } ); |