On this page

# NodeManager

NodeManager

The manager for all the node operations.

## Constructor

### (private) new NodeManager(client, node, logger)

The NodeManager constructor.

Parameters:

Name | Type | Description
--- | --- | ---
`client` | ZxAIClient |
`node` | string |
`logger` | Logger |

Source
  - node.manager.js, line 16

## Classes

NodeManager

## Members

### (private) client :ZxAIClient

The network client reference.

Type:

- ZxAIClient

Source
  - node.manager.js, line 23

### (private) logger :Logger

The logger handler to be used for logging messages.

Type:

- Logger

Source
  - node.manager.js, line 31

### (private) node :string

The node this manager is attached to.

Type:

- string

Source
  - node.manager.js, line 39

### (private) pipelines :Array.<Pipeline>

The list of open Pipelines on this node.

Type:

- Array.<Pipeline>

Source
  - node.manager.js, line 47

### (private) pipelinesMarkedForClosing :Array.<string>

The list of Pipelines to be closed when commiting the pending changes.

Type:

- Array.<string>

Source
  - node.manager.js, line 55

## Methods

### (async, private) _getRunningPipelines() → {Promise.<Array.<Pipeline>>}

Returns the pipelines running on this node as they're reflected by the last received heartbeat.

Source
  - node.manager.js, line 691

Returns:

Type:
  Promise.<Array.<Pipeline>>

### (async) attachPluginInstance(pipelineOrId, instance) → {Promise.<NodeManager>}

Adds a new Plugin Instance to be deployed on the Pipeline.

Parameters:

Name | Type | Description
--- | --- | ---
`pipelineOrId` | Pipeline | string |
`instance` | PluginInstance |

Source
  - node.manager.js, line 399

Returns:

Type:
  Promise.<NodeManager>

### (async) closePipeline(pipelineOrId) → {Promise.<NodeManager>}

Closes the pipeline by queueing an Archive Config command for the NaeuralEdgeProtocol node.

Parameters:

Name | Type | Description
--- | --- | ---
`pipelineOrId` | Pipeline | string |

Source
  - node.manager.js, line 381

Returns:

Type:
  Promise.<NodeManager>

### (async) commit() → {Promise.<Array.<Object>>}

Commits the changes registered for the node.

Source
  - node.manager.js, line 579

Returns:

Type:
  Promise.<Array.<Object>>

### (async) createPipeline(dataSource, name) → {Promise.<Pipeline>}

Creates a pipeline on the managed node.

Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`dataSource` | Object |  |
`name` | string | null | null |

Source
  - node.manager.js, line 224

Returns:

Type:
  Promise.<Pipeline>

### createPluginInstance(signature, config, name) → {PluginInstance}

Method for creating a PluginInstance of a specific signature with the provided config. If no name is provided a generated name will be assigned.

Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`signature` | string |  |
`config` | Object |  |
`name` | string | null | null |

Source
  - node.manager.js, line 297

Returns:

Type:
  PluginInstance

### (async) getFullHeartbeatFromEdgeNode() → {Promise.<Object>}

Sends a request for a detailed heartbeat to the node.

Source
  - node.manager.js, line 209

Returns:

Type:
  Promise.<Object>

### (async) getHeartbeatFromEdgeNode() → {Promise.<Object>}

Sends a heartbeat request to the node.

Source
  - node.manager.js, line 196

Returns:

Type:
  Promise.<Object>

### (async) getPipeline(pipelineId) → {Promise.<(Pipeline|null)>}

Returns the pipeline with id `pipelineId` if it exists on this node.

Parameters:

Name | Type | Description
--- | --- | ---
`pipelineId` | string |

Source
  - node.manager.js, line 267

Returns:

Type:
  Promise.<(Pipeline|null)>

### (async) getPipelines() → {Promise.<Array.<Pipeline>>}

Returns all the pipelines associated with a node.

Source
  - node.manager.js, line 280

Returns:

Type:
  Promise.<Array.<Pipeline>>

### (async) getPluginInstance(pipelineOrId, instanceId) → {Promise.<(PluginInstance|null)>}

Returns the Plugin Instance identified by `instanceId` from the instances running on this pipeline. If no instance is found, then `null` is returned.

Parameters:

Name | Type | Description
--- | --- | ---
`pipelineOrId` | Pipeline | string |
`instanceId` | string |

Source
  - node.manager.js, line 328

Returns:

Type:
  Promise.<(PluginInstance|null)>

### (async) getPluginInstances() → {Promise.<Array.<PluginInstance>>}

Returns the list of plugin instances running on this pipeline.

Source
  - node.manager.js, line 346

Returns:

Type:
  Promise.<Array.<PluginInstance>>

### (async) linkInstances(instances) → {Promise.<NodeManager>}

Links the instances provided as parameters.

Parameters:

Name | Type | Description
--- | --- | ---
`instances` | Array.<PluginInstance> |

Source
  - node.manager.js, line 475

Returns:

Type:
  Promise.<NodeManager>

### removeInstanceTag(instance, tag) → {NodeManager}

Removes a tag from the plugin instance.

Parameters:

Name | Type | Description
--- | --- | ---
`instance` | PluginInstance |
`tag` | string |

Source
  - node.manager.js, line 551

Returns:

Type:
  NodeManager

### (async) removePluginInstance(pipelineOrId, instance) → {Promise.<NodeManager>}

Removes a running plugin instance from the pipeline instance list.

Parameters:

Name | Type | Description
--- | --- | ---
`pipelineOrId` | Pipeline | string |
`instance` | PluginInstance |

Source
  - node.manager.js, line 419

Returns:

Type:
  Promise.<NodeManager>

### (async) restartEdgeNode() → {Promise.<Object>}

Sends a request to restart the node.

Source
  - node.manager.js, line 170

Returns:

Type:
  Promise.<Object>

### setInstanceSchedule(instance, schedule) → {NodeManager}

Sets the working hours schedule for the instance. This method accepts either a detailed schedule for each day of the week or a single schedule for all days.

Parameters:

Name | Type | Description
--- | --- | ---
`instance` | PluginInstance |
`schedule` | Object | Array | The schedule to set. If an object, it should map days to time intervals. If an array, it applies the same schedule to all days.

Source
  - node.manager.js, line 567

Returns:

The instance of PluginInstance to allow method chaining.

Type:
  NodeManager

### setInstanceTags(instance, tags) → {NodeManager}

Sets the provided tags on the instance.

Parameters:

Name | Type | Description
--- | --- | ---
`instance` | PluginInstance |
`tags` | Object |

Source
  - node.manager.js, line 524

Returns:

Type:
  NodeManager

### (async) shutdownEdgeNode() → {Promise.<Object>}

Sends a request to stop the node.

Source
  - node.manager.js, line 183

Returns:

Type:
  Promise.<Object>

### tagInstance(instance, tag, value) → {NodeManager}

Sets the value for a specific tag on the plugin instance.

Parameters:

Name | Type | Description
--- | --- | ---
`instance` | PluginInstance |
`tag` | string |
`value` | string |

Source
  - node.manager.js, line 538

Returns:

Type:
  NodeManager

### updateInstance(instance, update) → {NodeManager}

Updates the config for a provided instance.

Parameters:

Name | Type | Description
--- | --- | ---
`instance` | PluginInstance |
`update` | Object |

Source
  - node.manager.js, line 511

Returns:

Type:
  NodeManager

### (async) updatePipelineMetadata(pipelineOrId, metadata) → {Promise.<NodeManager>}

Updates the DataCaptureThread metadata for the specified pipeline.

Parameters:

Name | Type | Description
--- | --- | ---
`pipelineOrId` | Pipeline | string |
`metadata` | Object |

Source
  - node.manager.js, line 362

Returns:

Type:
  Promise.<NodeManager>

### (static) attachPluginInstanceToPipeline(pipeline, candidate, nowatch)

Static method that pushes a PluginInstance to a Pipeline. If the `nowatch` flag is set to true, this operation will not automatically append a watch on this instance in the next network request. This behavior is needed when attaching instances found on the received heartbeat, inside internal models, or when the watch is to be added manually, for supporting custom deployment mechanisms.

Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`pipeline` | Pipeline |  |
`candidate` | PluginInstance |  |
`nowatch` | boolean | false |

Source
  - node.manager.js, line 93

### (async, static) compilePipelineBatchUpdateInstances(pipeline) → {Promise.<Array.<ZxAIUpdateInstanceConfig>>}

Returns the change set list for all the plugin instances running on this pipeline.

Parameters:

Name | Type | Description
--- | --- | ---
`pipeline` | Pipeline |

Source
  - node.manager.js, line 150

Returns:

Type:
  Promise.<Array.<ZxAIUpdateInstanceConfig>>

### (static) compilePipelineUpdateConfig(pipeline)

Compiles the changeset for a given Pipeline.

Parameters:

Name | Type | Description
--- | --- | ---
`pipeline` | Pipeline |

Source
  - node.manager.js, line 119

### (static) getNodeManager(client, node, logger) → {NodeManager}

Returns an instance of a NodeManager for the requested `node`.

Parameters:

Name | Type | Description
--- | --- | ---
`client` | ZxAIClient |
`node` | string |
`logger` | Logger |

Source
  - node.manager.js, line 79

Returns:

Type:
  NodeManager

Type anything to view search result