Channel Functions
Function | Use |
---|---|
channel | List a set of channels depending on what parameters are past. |
channelAttributes | Lists a channels attributes |
channelPolicy | Lists a channels policy |
channelType | Lists a channels type |
All channel functions return an object with a status and an return object. Documentation will referance the return object only.
Channel Actions
Event Domain | Event Type | Actions | Use |
---|---|---|---|
wrangler | channel_creation_requested | createChannel | Creates a new channel |
wrangler | channel_deletion_requested | deleteChannel | Deletes a channel |
wrangler | update_channel_attributes_requested | updateAttributes | Updates a channel attributes |
wrangler | update_channel_policy_requested | updatePolicy | Updates a channel policy |
wrangler | update_channel_type_requested | updateType | Updates a channel type |
channel
returns an array of channels keyed to channel. Each channel is owned by the pico which calls this function.
Parameter | Datatype | Required |
---|---|---|
<id> | <string> |
|
<collection> | <string> | |
<filtered> | <string> |
- <id> = <channel_name> | <channel_eci>
- <collection> = <type> | <name> | <cid>(will be eci soon) | <last_active> | <attributes>(may break)
- <filtered> = <desired value of collection>
On success
key | value |
---|---|
channels | [{ "last_active":<number>, "policy":<null>, //not implemented yet
}, },..{}n] |
response = v1_wrangler:channel("flipper",null,null){"channels"}; // all channels response = v1_wrangler:channel("flipper",null,null){"channels"}; // single "flipper" channel response = v1_wrangler:channel(null,"type",null){"channels"}; // collection of channels by type response = v1_wrangler:channel(null,"type","OAUTH"){"channels"}; // collection of channels with "OAUTH" as type
channelAttributes
returns an attributes object keyed to attributes. channel_attributes is the main channels attribute key.
must provide at least one of the parameters.
Parameter | Datatype | Required |
---|---|---|
<eci> | <string> |
|
<name> | <string> |
|
- <eci> = <channel_eci>
- <name> = <channel_name>
On success
key | value |
---|---|
attributes | { "channel_attributes":<string> // for example "Time_hopping" } |
response = v1_wrangler:channelAttributes("532569A0-43BB-11E6-AA23-29E4C71C24B1",null){"attributes"}; // attributes by eci response = v1_wrangler:channelAttributes(null,"Dr.Who"){"attributes"}; // attributes by channel name
channelPolicy - not fully implemented
returns an policy object keyed to policy.
must provide at least one of the two parameters.
Parameter | Datatype | Required |
---|---|---|
<eci> | <string> |
|
<name> | <string> |
|
- <eci> = <channel_eci>
- <name> = <channel_name>
On success
key | value |
---|---|
policy | { "error":[""] } |
response = v1_wrangler:channelPolicy("532569A0-43BB-11E6-AA23-29E4C71C24B1",null){"policy"}; // policy by eci response = v1_wrangler:channelPolicy(null,"Dr.Who"){"policy"}; // policy by channel name
channelType
returns a type as a string keyed to type.
must provide at least one of the two parameters.
Parameter | Datatype | Required |
---|---|---|
<eci> | <string> |
|
<name> | <string> |
|
- <eci> = <channel_eci>
- <name> = <channel_name>
On success
key | value |
---|---|
type | <string> // for example "Time_wizard" |
response = v1_wrangler:channelType("532569A0-43BB-11E6-AA23-29E4C71C24B1",null){"type"}; // type by eci response = v1_wrangler:channelType(null,"Dr.Who"){"type"}; // type by channel name
createChannel
creates a new channel from an events provided attributes inside the desired Pico. fails on duplicate channel name provided. fails on empty name??
Event Domain | Event Type |
---|---|
wrangler | channel_creation_requested |
Attribute | Datatype | Required |
---|---|---|
<eci> | <string> | //defaults to eci used to raise event |
<channel_name> | <string> | √ |
<channel_type> | <string> | //defaults to Unkown |
<attributess> | <string> | |
<policy> | <string> | //not fully implemented |
Event raised on success
Event Domain | Event Type | Attributes |
---|---|---|
wrangler | channel_created | all attributes from original event |
deleteChannel
removes a channel corresponding with the provided event attributes
Event Domain | Event Type |
---|---|
wrangler | channel_deletion_requested |
must provide at least one of the two event attributes.
Attribute | Datatype | Required |
---|---|---|
<eci> | <string> | |
<channel_name> | <string> |
|
Event raised on success // not being raised yet
Event Domain | Event Type | Attributes |
---|---|---|
wrangler | channel_deleted | all attributes from original event |
updateAttributes
updates attributes of a channel corresponding with the provided event attributes
Event Domain | Event Type |
---|---|
wrangler | update_channel_attributes_requested |
must provide at least one of the two, eci and channel_name event attributes.
Attribute | Datatype | Required |
---|---|---|
<eci> | <string> | |
<channel_name> | <string> |
|
<attributess> | <string> |
Event raised on success // not being raised yet
Event Domain | Event Type | Attributes |
---|---|---|
wrangler | channel_attributes_updated | all attributes from original event |
updateType
updates type of a channel corresponding with the provided event attributes
Event Domain | Event Type |
---|---|
wrangler | update_channel_type_requested |
must provide at least one of the two, eci and channel_name event attributes.
Attribute | Datatype | Required |
---|---|---|
<eci> | <string> | |
<channel_name> | <string> |
|
<channel_type> | <string> |
Event raised on success // not being raised yet
Event Domain | Event Type | Attributes |
---|---|---|
wrangler | channel_type_updated | all attributes from original event |
updatePolicy // not fully implamented
updates policy of a channel corresponding with the provided event attributes
Event Domain | Event Type |
---|---|
wrangler | update_channel_type_requested |
must provide at least one of the two, eci and channel_name event attributes.
Attribute | Datatype | Required |
---|---|---|
<eci> | <string> | |
<channel_name> | <string> |
|
<policy> | <string> |
Event raised on success // not being raised yet
Event Domain | Event Type | Attributes |
---|---|---|
wrangler | channel_policy_updated | all attributes from original event |