Garden irrigator System - system control module
npm install giri-system-controlgiri-system-control
===================
[![npm version][npm-badge]][npm-url]
[![Build Status][travis-badge]][travis-url]
[![Coveralls][BadgeCoveralls]][Coveralls]
This is a seneca plugin, that contains the system level microservices of the giri system.
None.
Run the install command:
npm install
Run tests:
npm test
To see the coverage, run:
npm run coverage
To load the plugin:
``JavaScript`
seneca.use('giri-system-control')
There are no options for this plugin.
All actions provide results via the standard callback format: function(error,data){ ... }.
#### role: giri-system-control, cmd: createSystem
Create a new system, with a generated unique id.name
If is not defined, then it will give the id as the name too.
_Parameters:_
- payload: The system object, to create:name
- : the system object may have a name property.
_Response:_
- The system object, incl. the id and the name properties.
#### role: giri-system-control, cmd: updateSystem
Updates the properties of a system, selected by its id.id
If there is no system found with the given , then it creates a new system with this id,
and sets its actual properties according to the input parameters.
_Parameters:_
- payload: The system object to be updated (or created):id
- : the unique id of the system,name
- : the system object may have a name property.
_Response:_
- The updated system object.
#### role: giri-system-control, cmd: getSystems
Get a list on all of the systems available.
_Parameters:_
- None
_Response:_
- The array of available system objects.
#### role: giri-system-control, cmd: getSystem
Get a system selected by its id.
_Parameters:_
- payload: An object, which holds the id of the system to find.id
- . The id of the system to find.
_Response:_
- The system found, or null if the system is not found.
#### role: giri-system-control, cmd: resetSystem
Reset the whole system selected by its id.
Clusters and sectors belong to the system will be reset.
_Parameters:_
- payload: An object, which holds the id of the system to reset.id
- . The id of the system to reset.
_Response:_
- An empty {} object.
#### role: giri-system-control, cmd: getTime
Get the actual time used by the systems.
_Parameters:_
- None
_Response:_
- An object, with time property, which contains the actual time in UTC.
#### role: giri-system-control, cmd: setTime
Set the actual time to use by the systems.
_Parameters:_
- An object, with time property, which contains the actual time to set in UTC.
_Response:_
- An object, with time` property, which contains the actual time in UTC.
[npm-badge]: https://badge.fury.io/js/giri-system-control.svg
[npm-url]: https://badge.fury.io/js/giri-system-control
[travis-badge]: https://api.travis-ci.org/tombenke/giri-system-control.svg
[travis-url]: https://travis-ci.org/tombenke/giri-system-control
[Coveralls]: https://coveralls.io/github/tombenke/giri-system-control?branch=master
[BadgeCoveralls]: https://coveralls.io/repos/github/tombenke/giri-system-control/badge.svg?branch=master