Beebotte resource management provides the following operations:
Resource Management operations require authentication
using the account API and Secret Keys
.
You can create a new resource as follows:
bclient.addResource({
channel: 'channel1',
resource: {
name: 'resource1',
label:'test resource',
description: 'some description goes here',
vtype: 'string'
}
}, function(err, res) {
if(err) console.log(err);
// On success, res is set to true
});
## This operation is not available yet!
// This operation is not available yet!
var resource = new Resource("channel1", "resource1", "string");
bclient.CreateResource(resource);
You can get the description of a channel resource as follows:
bclient.getResource({
channel: 'channel1',
resource: 'resource1'
}, function(err, res) {
if(err) console.log(err);
// On success, res is the JSON description of the resource
});
resource = bclient.getResource('channel1', 'resource1')
// This operation is not available yet!
var resource = bclient.GetResource("channel1", "resource1");
You can get the list of all resources of a channel in one call as follows:
bclient.getResource({
channel: 'channel1',
resource: '*'
}, function(err, res) {
if(err) console.log(err);
// On success, res is an Array of JSON descriptions of the resources
});
resources = bclient.getResource('channel1')
// This operation is not available yet!
var resources = bclient.GetAllResources("channel1");
You can delete an existing channel resource as follows:
bclient.deleteResource({
channel: 'channel1',
resource: 'resource1'
}, function(err, res) {
if(err) console.log(err);
// On success, res is set to true
});
bclient.deleteResource('channel1', 'resource1')
// This operation is not available yet!
bclient.DeleteiResource("channel1", "resource1");