Constructor
new GenericNodeProvider(optionsopt)
Constructor
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Options for the instance. Properties
|
Methods
getNodesFromUri(uri, optionsopt) → {Promise}
Gets nodes from the provided URI. The resource should be in JSON format as an array of objects. JSON strings that parse to an array of objects are also supported.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
uri |
String | The URI of the resource. |
|
options |
Object |
<optional> |
http/https request options |
Returns:
A promise which will be resolved with an array of instances. Each instance value should be:
{
id: Node ID,
ip: {
public: public IP,
private: private IP
}
}
- Type
- Promise
init(providerOptions, optionsopt) → {Promise}
Initialize class
Override for implementation specific initialization needs (read info from cloud provider, read database, etc.). Called at the start of processing.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
providerOptions |
Object | Provider specific options. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Options for this instance. |
Returns:
A promise which will be resolved when init is complete.
- Type
- Promise