Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Creates a new pico and returns it's id. No parameters are given.

ParameterDatatypeRequired
--------------
----
----------------
-----
-------------
----


Code Block
titlenewPico
response = engine:newPico().klog("Response Structure: ")
/*
  Response Structure:
	{
		"id" : <new_pico_id>
	}
*/

...

Info
titleDisclaimer

removePico does not accept a map, but a single id value as its parameter.


ParameterDatatypeRequired
<id><string>YES


Code Block
titleremovePico
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
*/

...

Removes a channel whose eci matches the provided eci. This comparison and deletion takes place on the pico with the provided id.

ParameterDatatypeRequired
<pico_id><string>YES
<eci><string>YES


Code Block
titleremoveChannel
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
*/

...

installRuleset( )

Installs rulesets ruleset(s) into a pico.  


ParameterDatatypeRequired
<pico_id><string> YES
<rid>string | arrayYES

NO

<base><string>NO
<url><string>NO

The "base" key will have a value that contains the domain name where your krl file is located. ex:  "http://raw.githubusercontent.com"

The "url" key will complete the path appended to the base. ex: "/repository1/file.txt"

There are three options provided for a successful install with these parameters:
1) You may provide the "rid" (excluding the "base" and "url" keys) if you know that the ruleset is already registered with the engine.
2) Provide the base and url in their respective parts as described above.
3) Just provide the full url (in the "url" key) where your ruleset is located, leaving the "base" undefined or as an empty string.

Do not provide the "rid" key if you want to retrieve the krl file from a remote repository (just provide the "base" and "url" keys). If you provide the "rid" key at all, this function will assume the ruleset is already registered with the engine and will simply throw an error if it is not found, ignoring the "base" and "url" as if they were not submitted.

Code Block
titleintall ruleset
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> } );


/*
 Response Structure:
	"myRuleset"
 Simply returns the rulesetID as a string. The rulesetID is the ruleset's name. 
*/


engine:uninstallRuleset( ) - Not Implemented yet.

...