new Node(id, version, label, href, hostname, caps, services)
Describes a Node. Immutable value.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | Globally unique UUID identifier for the Node. |
version |
string | String formatted PTP timestamp (<seconds>:<nanoseconds>) indicating precisely when an attribute of the resource last changed. |
label |
string | Freeform string label for the Node. |
href |
string | HTTP access href for the Node's API. |
hostname |
string | Node hostname - set to null when not present. |
caps |
Object | Capabilities (not yet defined). |
services |
Array.<Object> | Array of objects containing a URN format type and href. |
- Source:
Extends
Members
(readonly) caps :Object
Capabilities (not yet defined).
Type:
- Object
- Source:
(readonly) hostname :string
Node hostname - set to null when not present.
Type:
- string
- Source:
(readonly) href :string
HTTP access href for the Node's API.
Type:
- string
- Source:
(readonly) id :string
Globally unique UUID identifier for the resource.
Type:
- string
- Overrides:
- Source:
(readonly) label :string
Freeform string label for the resource.
Type:
- string
- Overrides:
- Source:
(readonly) services :Array.<Object>
Array of objects containing a URN format type and href.
Type:
- Array.<Object>
- Source:
(readonly) version :string
String formatted PTP timestamp (<seconds>:<nanoseconds>)
indicating precisely when an attribute of the resource last changed.
Type:
- string
- Overrides:
- Source:
Methods
generateID(idopt) → {string}
Generate an identifier when one is not provided,
otherwise pass this one through. No validation takes place.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
id |
string |
<optional> |
Identifier to pass through. |
- Overrides:
- Source:
Returns:
Value passed to the method or a generated pseudo-random
UUID for no arguments, null or undefined.
- Type
- string
generateLabel(labelopt) → {string}
Generate a label when one is not provided, otherwise
pass the given one through. No validation takes place.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
label |
string |
<optional> |
Label to pass through. |
- Overrides:
- Source:
Returns:
Value passed to the method or an empty string for
no arguments, null or undefined.
- Type
- string
generateVersion(versionopt) → {string}
Generate a version number when one is not provided,
otherwise pass the given one through. No validation takes place.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
version |
string |
<optional> |
Version number to pass through. |
- Overrides:
- Source:
Returns:
Value passed to the method or a generated version
number from the current clock with no arguments,
null or undefined.
- Type
- string
valid() → {boolean}
Checks that all the properties of this resource are valid. The is a syntactic
check and does not check semantics such as references to other objects can be
checked. Valid includes:
- Required properties are defined and not null.
- Identifiers a valid UUIDs.
- Enumerations are known values and/or match expected patterns.
- Values are of the expected type.
- Overrides:
- Source:
Returns:
Is the resource valid?
- Type
- boolean