Working with Nodes
Nodes provide a hierarchical structure for organizing time series within a repository. They are organized under attributes, forming a tree that can be used to group, browse, and filter time series. An attribute can have multiple root nodes assigned.
Listing All Nodes
Section titled “Listing All Nodes”To retrieve all nodes in a repository:
GET /repositories/{repository}/nodes| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
name |
string |
— | Filter by node name. | |
parent |
string |
— | Filter by parent node. | |
root |
string |
— | Filter by the root attribute the node belongs to. | |
order |
string |
— | Sort results (e.g., name, name,descending). |
|
Range |
string |
— | Paginate results with the Range request header (e.g., node=0-49). |
Find all nodes under a specific parent
Section titled “ Find all nodes under a specific parent”GET /repositories/{repository}/nodes?parent=id:123Loading a Specific Node
Section titled “Loading a Specific Node”GET /repositories/{repository}/nodes/{node}The {node} path segment only accepts a node ID prefixed with id: (e.g., id:42).
Managing Nodes Under an Attribute
Section titled “Managing Nodes Under an Attribute”Nodes are created and managed relative to their root attribute. The attribute defines the hierarchy to which the node belongs.
Listing Nodes Under an Attribute
Section titled “Listing Nodes Under an Attribute”GET /repositories/{repository}/attributes/{attribute}/nodesCreating a Root Node
Section titled “Creating a Root Node”The root is the attribute itself, which is not a node. A node can be directly assigned to the attribute, making it a node without a parent.
To define such a node the parent must be null and the identifier of the root property must be the id of the attribute:
Request
POST /repositories/{repository}/attributes/{attribute}/nodesRequest Body
[ { "root": { "identifier" : 1013, "storageInformation": { "repositoryName": "ExampleRepository" } }, "name" : "ChildNode.A", "parent": null }]Creating a Child Node
Section titled “Creating a Child Node”The body consists of a root and a parent. The root is always the underlying attribute and not the highest node that has no parent. To position a new node the id of the parent node must also be provided. The following body adds a node with the name ChildNode.A.1 to the attribute with the id 1013 as a child of the node with the id 4:
Request
POST /repositories/{repository}/attributes/{attribute}/nodesRequest Body
[ { "root": { "identifier" : 1013, "storageInformation": { "repositoryName": "ExampleRepository" } }, "name" : "ChildNode.A.1", "parent": { "identifier" : 4, "storageInformation": { "repositoryName": "ExampleRepository" } } }]Another way to create this node is to use the following endpoint:
POST /repositories/{repository}/attributes/{attribute}/nodes/{pathToNode}{pathToNode} would be a list of node children each specified by their id. It could look something like this: /id:7/children/id:8/children.
Note that the last node in {pathToNode} must be the same referenced in parent:
{ "root": { "identifier": 1014, "storageInformation": { "repositoryName": "TSM_SQLSERVER" } }, "name": "ChildNodeA.1.1", "parent": { "identifier": 8, "storageInformation": { "repositoryName": "ExampleRepository" } }, "children": {}}This second variant seems a bit redundant, because both the body and the {pathToNode} specify the exact position of the node. However, when editing the node’s position using PUT its usage becomes clear.
Updating a Node
Section titled “Updating a Node”PUT /repositories/{repository}/attributes/{attribute}/nodes/{pathToNode}Now, {pathToNode} can be different from the parent id. The former defines where the node that needs to be edited currently is. By changing the value of the parent identifier this position can be changed:
Request Body
{ "root": { "identifier": 1014, "storageInformation": { "repositoryName": "ExampleRepository" } }, "name": "ChildNodeOfChildNode2", "parent": { "identifier": 7, "storageInformation": { "repositoryName": "ExampleRepository" } }, "children": {}}Getting a Node by Path
Section titled “Getting a Node by Path”Get details on the node:
GET /repositories/{repository}/attributes/{attribute}/nodes/{pathToNode}Get details on all of the children of the node:
GET /repositories/{repository}/attributes/{attribute}/nodes/{pathToNode}/childrenDeleting All Nodes Under an Attribute
Section titled “Deleting All Nodes Under an Attribute”DELETE /repositories/{repository}/attributes/{attribute}/nodes