Status: 2020-06-27: under review
The OpenDaylight project has implemented the RestConf interface according RCF8040. The previous in OpenDaylight implemented RestConf(-like) interface is supported too and both interfaces can be installed in parallel within the Apache Karaf container. Please see the documentation of NetConf project of OpenDaylight.
This wiki shows difference between both interfaces based on examples.
The syntax is as defined by the vsCode/rest-client - sample code.
Info regarding RFC8040 and RFC8527
- RFC8040 defines RESTCONF
- The latest open-source implementation of RFC8040 is today in OpenDaylight Aluminium. However OpenDaylight Sodium and OpenDaylight Magnesium are good enough for our purposes.
- RFC8527 extends RFC8040 to support new datastores as defined in RFC8525, but RFC8527 does not make RFC8040 obsolete.
Description
Biermann
RestConf (RFC8040)
Get OpenDaylights YANG capabilities.
GET {{baseUrl}}/restconf/modules
Authorization:Basic {{user}} {{password}}
Accept:application/json
GET {{baseUrl}}/rests/data/ietf-yang-library:modules-state
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Get NetConf Topology from configuration datastore
GET {{baseUrl}}/restconf/config/network-topology:network-topology/topology-netconf
Authorization:Basic {{user}} {{password}}
Accept:application/json
GET {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf?content=config
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Get NetConf Topology from operational datastore
GET {{baseUrl}}/restconf/operational/network-topology:network-topology/topology/topology-netconf
Authorization:Basic {{user}} {{password}}Accept:application/json
GET {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf?content=nonconfig
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Get NetConf Topology from both datastores at the same time
n/a
GET {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Get only the node-ids from both datastores
n/a
GET {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf?fields=node(node-id)
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Get only the node-ids from operational datastores
n/a
GET {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf?content=nonconfig&fields=node(node-id)
Authorization:Basic {{user}} {{password}}
Accept:application/json
Get only the node-ids and their connection-status
n/a
GET {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf?fields=node(node-id;netconf-node-topology:connection-status)
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Get only the node-ids and their capabilities
n/a
GET {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf?content=nonconfig&fields=node(node-id;netconf-node-topology:available-capabilities/available-capability/capability)
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Get capabilities of a given node-id
GET {{baseUrl}}/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/{{mountPoint}}/netconf-node-topology:available-capabilities
Authorization:Basic {{user}} {{password}}
Accept:application/json
GET {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf/node={{mountPoint}}/netconf-node-topology:available-capabilities?fields=available-capability(capability)
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Create new NetworkElement connection with SDN-R data-provider.
POST {{baseUrl}}/restconf/operations/data-provider:create-network-element-connection
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type:application/json
{
"data-provider:input": {
"id": "new-mountpoint-name",
"node-id": "new-mountpoint-name",
"host": "10.10.10.10",
"port": "830",
"username": "netconf",
"password": "netconf",
"is-required": "true"
}
}
# Note: the http body is the same, but pay attention to the namespace of the input and output object.
POST {{baseUrl}}/rests/operations/data-provider:create-network-element-connection
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Content-Type:application/yang-data+json
{
"data-provider:input": {
"id": "new-mountpoint-name",
"node-id": "new-mountpoint-name",
"host": "10.10.10.10",
"port": "830",
"username": "netconf",
"password": "netconf",
"is-required": "true"
}
}
# Note: the http body is the same! Just the URL is different.
Read SDN-R Connection List
POST {{baseUrl}}/restconf/operations/data-provider:read-network-element-connection-list
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type:application/json
{
"data-provider:input": {
"filter": [{
"property": "status",
"filtervalue": "Connecting"
}
],
"sortorder": [{
"property": "node-id",
"sortorder": "descending"
}
],
"pagination": {
"size": 5,
"page": 3
}
}
}
POST {{baseUrl}}/rests/operations/data-provider:read-network-element-connection-list
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Content-Type:application/yang-data+json
{
"data-provider:input": {
"filter": [{
"property": "status",
"filtervalue": "Connecting"
}
],
"sortorder": [{
"property": "node-id",
"sortorder": "descending"
}
],
"pagination": {
"size": 5,
"page": 3
}
}
}
Some complex filtering
n/a
GET {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf/node={{mountPoint}}/yang-ext:mount/core-model-1-4:control-construct/logical-termination-point=e6c5831d-37ce-4ef4-b075-733f6791bde1/layer-protocol=pRppR4R/wire-interface-2-0:wire-interface-pac/wire-interface-configuration?fields=interface-name;problem-kind-severity-list(problem-kind-name)
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json