Table of Contents

Search

  1. Preface
  2. Introduction to Edge Data Streaming Custom Entity Types
  3. Managing Custom Entity Types
  4. Custom Entities from Maven Archetypes
  5. REST APIs
  6. HTTP Request and Response Parameters
  7. Sample JSON Requests and Responses
  8. Glossary

Developer Guide

Developer Guide

Create Nodes

Create Nodes

Use the POST method to create a node in EDS.

POST Request in JSON Format

Generate a POST request. For example, the following POST request creates a node:
POST /api/nodes Content-Type: application/json Accept: application/json

POST Body in JSON Format

{ "nodes": [ {"name": "MyNode1"}, {"name": "MyNode2", "nodeGroups": [1]}, ] }

POST Response in JSON Format

The following is a sample response for the 201 Created code:
{ "total": 1, "count": 1, "success": true, "items": [ { "id": {node-id}, "name": {node-name}, "nodeGroups": [{"id": {nodegroup-id}, "name": {nodegroup-name}, "type": "static"}] } ] }
{ "total": 1, "count": 1, "success": true, "items": [ { "id": {node-id}, "name": {node-name}, "nodeGroups": [{"id": {nodegroup-id}, "name": {nodegroup-name}, "type": "dynamic", "pattern": {node-pattern-regex}}] } ] }
The following are sample responses for the 400 Bad Request code:
{ "success": false, "errors": [ { "code": NAME_FIELD_MISSING, "parameters": null, "errorMessage": "'name' field is missing in request" } ] }
{ "success": false, "errors": [ { "code": NODE_NAME_ALREADY_EXISTS, "parameters": null, "errorMessage": "Node name already exists." } ] }
The following is a sample response for the 404 Not Found code:
{ "success": false, "errors": [ { "code": NODEGROUP_NOT_FOUND, "parameters": [{nodegroup-id}], "errorMessage": "Nodegroup not found with Id: {nodegroup-id}" } ] }
The following is a sample response for the 500 Internal Server Error code:
{ "success": false, "errors": [ { "code": INTERNAL_SERVER_ERROR, "parameters": [{error-message}], "errorMessage": "Failed to create node. Exception: {error-message}" } ] }

0 COMMENTS

We’d like to hear from you!