Create a Route
post
/v1/nodes/{srcNodeId}/route
Creates a route from the specified node ID to the destination node specified in the request payload.
Request
Path Parameters
-
srcNodeId(required): string
The source node identifier.
Supported Media Types
- application/json;charset=utf-8
Root Schema : schema
Type:
object
The payload schema to create a route between two nodes.
Show Source
-
destinationNodeID(required): string
The identifier of the destination node.Example:
z8kfsx-16it-3res21sew
-
routingAttrs:
routingAttrs
-
routingField: string
The field defined in NPL used for routing.
-
routingFunction(required):
routingFunction
Nested Schema : routingAttrs
Match All
The attributes against which routing fields are compared using various operations.
Show Source
-
object
RouteUpdateRequestRoutingAttrs
The schema defining routing attributes for a route update request.
-
The attributes against which routing fields are compared using various operations.
Nested Schema : routingFunction
Match All
The routing function used for the channel.
Show Source
-
string
Allowed Values:
[ "DIRECTED", "MODULUS", "MULTICAST", "ROUND_ROBIN" ]
-
The routing function used for the channel.Example:
DIRECTED
Nested Schema : RouteUpdateRequestRoutingAttrs
Type:
object
The schema defining routing attributes for a route update request.
Show Source
-
operand1: array
operand1
The values against which the operator acts on the routing field.
-
operand2: array
operand2
The values against which the operator acts on the routing field, two operands are required when an operator is used which requires 3 variables, for example, IN_BETWEEN operator.
-
operator:
operator
Nested Schema : operand1
Type:
array
The values against which the operator acts on the routing field.
Show Source
Nested Schema : operand2
Type:
array
The values against which the operator acts on the routing field, two operands are required when an operator is used which requires 3 variables, for example, IN_BETWEEN operator.
Show Source
Nested Schema : operator
Match All
The expression representing action to be performed on routing field.
Show Source
-
string
Allowed Values:
[ "EQUALS", "GREATER_THAN", "IN_BETWEEN", "LESS_THAN", "LIST_EQUALS", "LIST_NOT_EQUALS", "NOT_EQUALS", "NOT_SUBSET_OF", "SUBSET_OF" ]
-
The expression representing action to be performed on routing field.Example:
EQUALS
Response
Supported Media Types
- application/json
201 Response
The requested route has been created.
Root Schema : RouteResponse
Type:
object
The response schema to get a route's information.
Show Source
-
destinationNodeID(required): string
The identifier of the destination node.Example:
z8kfsx-16it-3res21sew
-
routingAttrs:
routingAttrs
-
routingField: string
The field defined in NPL used for routing.
-
routingFunction(required):
routingFunction
-
sourceNodeID(required): string
The identifier of the source node.Example:
z8kfsx-16it-l0mbm95p
Nested Schema : routingAttrs
Match All
The attributes against which routing fields are compared using various operations.
Show Source
-
object
RoutingAttributes
The schema defining routing attributes for a route.
-
The attributes against which routing fields are compared using various operations.
Nested Schema : routingFunction
Match All
The routing function used for the channel.
Show Source
-
string
Allowed Values:
[ "DIRECTED", "MODULUS", "MULTICAST", "ROUND_ROBIN" ]
-
The routing function used for the channel.Example:
DIRECTED
Nested Schema : RoutingAttributes
Type:
object
The schema defining routing attributes for a route.
Show Source
-
operand1(required): array
operand1
The values against which the operator acts on the routing field.
-
operand2: array
operand2
The values against which operator acts on the routing field, two operands are required when an operator is used which requires 3 variables. For example, IN_BETWEEN operator.
-
operator(required):
operator
Nested Schema : operand1
Type:
array
The values against which the operator acts on the routing field.
Show Source
Nested Schema : operand2
Type:
array
The values against which operator acts on the routing field, two operands are required when an operator is used which requires 3 variables. For example, IN_BETWEEN operator.
Show Source
Nested Schema : operator
Match All
The expression representing action to be performed on routing field.
Show Source
-
string
Allowed Values:
[ "EQUALS", "GREATER_THAN", "IN_BETWEEN", "LESS_THAN", "LIST_EQUALS", "LIST_NOT_EQUALS", "NOT_EQUALS", "NOT_SUBSET_OF", "SUBSET_OF" ]
-
The expression representing action to be performed on routing field.Example:
EQUALS
400 Response
The request cannot be processed due to a client error.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
The cause of the exception.
-
code(required): string
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing the error.
401 Response
The client does not have the correct privileges.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
The cause of the exception.
-
code(required): string
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing the error.
403 Response
The request was not authorized.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
The cause of the exception.
-
code(required): string
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing the error.
404 Response
The requested resource cannot be found.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
The cause of the exception.
-
code(required): string
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing the error.
405 Response
This method is not allowed.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
The cause of the exception.
-
code(required): string
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing the error.
409 Response
The request cannot be processed due to a conflict in the existing state of the resource.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
The cause of the exception.
-
code(required): string
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing the error.
500 Response
The system has encountered an internal server error.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
The cause of the exception.
-
code(required): string
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing the error.
501 Response
The method is not supported.
Root Schema : Error
Type:
object
Used when an API encounters an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
-
@type: string
Defines the sub-class entity when sub-classing.
-
cause: string
The cause of the exception.
-
code(required): string
The application relevant details defined in the API or a common list.
-
message: string
The details and corrective actions for the error shown to the client user.
-
reason(required): string
The reason for the error, which is shown to a client user.
-
referenceError: string
(uri)
The URI of the documentation describing the error.
-
status: string
The HTTP error code describing the error.
Examples
The following example shows how to create a route from a source node to a destination node by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.
The -d option specifies the file to attach as the request body.
curl -X POST 'http://hostname:port/nodes/31eoen-otm-lne9hugk/route' -d @sampleCreateRoute.json
Example of Request Body
The following is an example of the contents of the sampleCreateRoute.json file sent as the request body.
{
"destinationNodeID": "31eoen-otm-lnejuqgh",
"routingAttrs": {
"operand1": [
"string"
],
"operand2": [
"string"
],
"operator": "EQUALS"
},
"routingField": "string",
"routingFunction": "MULTICAST"
}
Example of Response Body
If successful, the response code 201 is returned with the following response body.
{
"destinationNodeID": "31eoen-otm-lne9iglo",
"routingAttrs": {
"operand1": [
""
],
"operand2": [
""
]
},
"routingField": "",
"routingFunction": "MULTICAST",
"sourceNodeID": "31eoen-otm-lne9hugk"
}