giri-cluster-control

2.3.2 • Public • Published

giri-cluster-control

npm version Build Status Coveralls

This is a seneca plugin, that contains the sector level microservices of the giri system.

Prerequisites

None

Installation

Run the install command:

npm install

Run tests:

npm test

To see the coverage, run:

npm run coverage

Usage

To load the plugin:

    seneca.use('giri-cluster-control')

Options

There are no options for this plugin.

Actions

All actions provide results via the standard callback format: function(error, data){ ... }.

role: giri-cluster-control, cmd: createCluster

Create a new cluster, with a generated unique id. If name is not defined, then it will give the id as the name too.

Parameters:

  • payload: The cluster object, to create.
    • name: the cluster object may have a name property,
    • systemId: the cluster object may have a systemId property.

Response:

  • The cluster object:
    • id: the unique id of the created cluster,
    • name: the cluster object may have a name property,
    • systemId: the cluster object may have a systemId property.

role: giri-cluster-control, cmd: updateCluster

Updates the properties of a cluster, selected by its id. If there is no cluster found with the given id, then it creates a new cluster with this id, and sets its actual properties according to the input parameters.

Parameters:

  • payload: The cluster object to be updated (or created):
    • id: the unique id of the created cluster,
    • name: the cluster object may have a name property,
    • systemId: the cluster object may have a systemId property.

Response:

  • The updated cluster object:
    • id: the unique id of the created cluster,
    • name: the cluster object may have a name property,
    • systemId: the cluster object may have a systemId property.

role: giri-cluster-control, cmd: getClusters

Get a list on all of the clusters available.

Parameters:

  • None

Response:

  • The array of available cluster objects.

role: giri-cluster-control, cmd: getCluster

Get a cluster selected by its id.

Parameters:

  • payload: object to select the.
    • id: The id of the cluster to find.

Response:

  • The cluster object found, or null if it is not found.

role: giri-cluster-control, cmd: getSystemClusters

Get a list of clusters, that belong to the same system, that is identified by the id.

Parameters:

  • payload: object to select the.
    • systemId: The id of the system which the cluster to find belongs to.

Response:

  • The list of cluster object found, or an empty array if no one is found.

role: giri-cluster-control, cmd: resetCluster

Reset the whole cluster selected by its id. Sectors belong to the cluster will be reset.

Parameters:

  • payload: An object, which holds the id of the cluster to reset.
    • id. The id of the cluster to reset.

Response:

  • An empty {} object.

References


This project was generated from the seneca-plugin-archetype by the kickoff utility.

Readme

Keywords

none

Package Sidebar

Install

npm i giri-cluster-control

Weekly Downloads

1

Version

2.3.2

License

MIT

Last publish

Collaborators

  • tombenke