...
Code Block |
---|
|
pico_id = engine:getPicoIDByECI(eci)
/*
"some_pico_id"
*/ |
...
getParent
List all the channels Get the parent's pico_id for the current or given pico_id.
Parameter | Datatype | Required | Default |
---|
<pico_id> | <string> | NO | the running pico_id |
Code Block |
---|
|
parent_id = engine:getParent(pico_id)
/*
"the parent's pico_id"
*/ |
listChildren
List the pico's children pico_ids.
Parameter | Datatype | Required | Default |
---|
<pico_id> | <string> |
YES
Code Block |
---|
|
children = engine:listChildren(pico_id)
/*
[
"child 0 pico_id",
"child 1 pico_id",
...
]
*/ |
listChannels
List the pico's channels.
Parameter | Datatype | Required | Default |
---|
<pico_id> | <string> | NO | the running pico_id |
Code Block |
---|
|
channels = engine:listChannels(pico_id)
/*
[
{
"id" : "eci-0...",
"pico_id": <pico_id>,
"name": "name 0",
"type": "type 0"
},
{
"id" : "eci-1...",
"pico_id": <pico_id>,
"name": "name 1",
"type": "type 1"
}
]
*/ |
listInstalledRIDs
List the rid's installed on the pico.
Parameter | Datatype | Required | Default |
---|
<pico_id> | <string> | NO | the running pico_id |
Code Block |
---|
|
rids = engine:listInstalledRIDs(pico_id)
/*
["io.picolabs.pico", ...]
*/ |
List all enabled ruleset ids. No parameters are given.
...
newPico
Creates a new pico. No parameters are given.
Parameter | Datatype | Required | Default |
---|
<parent_id> | <string> | NO | the running pico_id |
Code Block |
---|
|
engine:newPico() setting(resp)
/*
{
"id" : <new_pico_id>,
"parent_id" : <current pico_id>,
}
*/ |
Note: newPico does not provide an eci. This action is used in conjunction with engine:createChannel to create a pico with both an id and eci. See wranglerNPE.krl for an example of how to fully create a pico according to a given prototype.
removePico
Parameter | Datatype | Required |
---|
<pico_id>YES
Code Block |
---|
|
engine:removePico(id) |
...
Creates a new channel for a pico (identified to the engine by the pico_id parameter).
Parameter | Datatype | Required | Default |
---|
<pico_id> | <string> |
YESNO | the running pico_id |
<name> | <string> | YES |
|
<type> | <string> | YES |
|
Code Block |
---|
|
engine:newChannel(id,name = "channel_name", type = "channel_type") setting(resp)
/*
{
"id" : <new_eci>,
"pico_id": <pico_id>,
"name": "channel_name",
"type": "channel_type"
}
*/ |
...
Installs ruleset(s) into a pico.
Parameter | Datatype | Required | Default |
---|
<pico_id> | <string> |
YESNO | the running pico_id |
<rid> | string | array | NO |
|
<url> | <string> | NO |
|
<base> | <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"
...
uninstall a ruleset from a pico.
Parameter | Datatype | Required | Default |
---|
<pico_id> | <string> |
YES | NO | the running pico_id |
<rid> | string | array | YES |
|
This does not return anything
Code Block |
---|
|
engine:uninstallRuleset( meta:picoId, rid = "myRuleset")
engine:uninstallRuleset( meta:picoId, ["rid.1", "rid.2"]) |
...