Versions Compared

Key

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

...

Given an eci, get the pico_id that owns that channel.

ParameterDatatypeRequired
<eci><string>YES


Code Block
titleremoveChannel
pico_id = engine:getPicoIDByECI(eci)
/*
    "some_pico_id"
*/

...

List all the channels for the given pico_id.

ParameterDatatypeRequired
<pico_id><string>YES


Code Block
titlenewChannel
channels = engine:listChannels(pico_id)
/*
	[
      {
		"id" : "eci-0...",
		"name": "name 0",
		"type": "type 0"
 	  },
      {
		"id" : "eci-1...",
		"name": "name 1",
		"type": "type 1"
 	  }
    ]
*/

...

Given a ruleset id, get more information about it.

ParameterDatatypeRequired
<rid><string>YES


Code Block
titleintall ruleset
desc = engine:describeRuleset("io.picolabs.hello_world");
/*
    {
        "rid": "io.picolabs.hello_world",
        "src": "ruleset io.picolabs.hello_world{ ...<cut for brevity> ... }",
        "hash": "a096f2f3bfbd63e54bf4f39081814dbc895f3f003ae9918dbe24aec8acc097b9",
        "url": "https://raw.githubusercontent.com/Picolab/node-pico-engine-core/master/test-rulesets/hello-world.krl",
        "timestamp_stored": "2017-05-17T21:31:21.663Z",
        "timestamp_enable": "2017-05-17T21:31:21.663Z",
        "meta": {
            "name": "Hello World",
            "description": "\nA first ruleset for the Quickstart\n    ",
            "author": "Phil Windley"
        }
    }
*/

...

Code Block
titlenewChannel
engine:newChannel(id, "channel_name", "channel_type") setting(resp)
/*
	{
		"id" : id<new_eci>,
		"name": "channel_name",
		"type": "channel_type"
 	}
*/

Note: "id" in the resp body is the given pico's new channel eci, not the original id passed into the function.

removeChannel

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

...