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.
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
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
(currently not found... 404 )
Get NetConf Topology from configuration datastore
GET {{baseUrl}}/restconf/config/network-topology:network-topology/topology-netconf
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type:application/json
GET {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf?content=config
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type:application/json
Get NetConf Topology from operational datastore
GET{
"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
Get only the node-ids from both datastores
n/a
POST {{baseUrl}}/restconfrestconf/operationaloperations/networkdata-topologyprovider:read-network-topology/topology/topology-netconf-element-connection-list
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type:application/json
GET {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf?content=nonconfig
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type:application/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/json
Content-Type:application/json
GET{
"data-provider:input": {
"filter": [{
"property": "status",
"filtervalue": "Connecting"
}
],
"sortorder": [{
"property": "node-id",
"sortorder": "descending"
}
],
"pagination": {
"size": 5,
"page": 3
}
}
}
POST {{baseUrl}}/rests/operations/data/network-topologyprovider:read-network-topology/topology=topology-netconf?fields=node(node-id) element-connection-list
Authorization:Basic {{user}} {{password}}
Accept:application//yang-data+json
Content-Type: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
Content-Type:application/jsonGet only the node-ids and their connection-status
{
"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/topology=topology-netconf?fields=node(node-id;netconf-node-topology:connection-status-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
Content-Type:application/json
Get only the node-ids and their capabilities
n/a
GETEdit Config operation:merge
@node=Core14-ONF-NTS-Manager
PUT {{baseUrl}}/
restsrestconf/
dataconfig/network-topology:network-topology/topology
=/topology-netconf
?content=nonconfig&fields=node(node-id;netconf-node-topology:available-capabilities/available-capability/capability) /node/{{node}}/yang-ext:mount/network-topology-simulator:simulator-config/notification-config
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type:application/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
Content-Type:application/jsonGET
{
"network-topology-simulator:notification-config": {
"network-topology-simulator:is-netconf-available": true,
"network-topology-simulator:ves-heartbeat-period": 0,
"network-topology-simulator:is-ves-available": false,
"network-topology-simulator:fault-notification-delay-period": [
60, 50, 40, 10
]
}
}
# Pay attention to the namespaces!!!
@node=Core14-ONF-NTS-Manager
PUT
{{baseUrl}}/rests/data/
networkn
etwork-topology:network-topology/topologytopology=topologytopology-netconf/node={{mountPoint}}/netconf-node-topology:available-capabilities?fields=available-capability(capability)
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type:application/json
Create new NetworkElement connection with SDN-R data-provider.
POST {{baseUrl}}/restconf/operations/data-provider:create-network-element-connectionyang-ext:mount/network-topology-simulator:simulator-config/notification-config
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Content-Type:application/yang-data+json
{
"data-provider:input": {
"data-provider:id": "new-mountpoint-name",
"data-provider:node-id": "new-mountpoint-name",
"data-provider:host": "10.10.10.10",
"data-provider:port": "830"network-topology-simulator:notification-config": {
"is-netconf-available": true,
"data-provider:usernameves-heartbeat-period": "netconf"0,
"data-provider:passwordis-ves-available": "netconf"false,
"data-provider:is-required": "true"fault-notification-delay-period": [
60, 50, 40, 10
]
}
}
# Note: the http body is the same!
POSTPay attention to the namespaces!!!
Create MountPoint
@node=my-new-mount-point-2
PUT {{baseUrl}}/restsrestconf/operationsconfig/datanetwork-providertopology:create-network-element-connectiontopology/topology/topology-netconf/node/{{node}}
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type:application/json
{
"datanetwork-providertopology:inputnode": {[
"data-provider:id": "new-mountpoint-name",
{
"data-provider:node-id": "new-mountpoint-name{{node}}",
"datanetconf-node-providertopology:host": "10127.100.100.101",
"datanetconf-node-providertopology:port": "830",
"data-provider:username": "netconf",
"data-providernetconf-node-topology:password": "netconf",
"data-provider: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
{
"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/json
Content-Type:application/json
{
"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 "netconf-node-topology:username": "netconf",
"netconf-node-topology:sleep-factor": 1.5,
"netconf-node-topology:tcp-only": false,
"netconf-node-topology:reconnect-on-changed-schema": true,
"netconf-node-topology:default-request-timeout-millis": 60000,
"netconf-node-topology:connection-timeout-millis": 20000,
"netconf-node-topology:max-connection-attempts": 100,
"netconf-node-topology:between-attempts-timeout-millis": 2000,
"netconf-node-topology:keepalive-delay": 120,
"netconf-node-topology:concurrent-rpc-limit": 0,
"netconf-node-topology:actor-response-wait-time": 5
}
]
}
@node=my-new-mount-point-2
PUT {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf/node={{node}}
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Content-Type:application/yang-data+json
{
"network-topology:node": [
{
"node-id": "{{node}}",
"host": "127.0.0.1",
"port": 830,
"password": "netconf",
"username": "netconf",
"sleep-factor": 1.5,
"tcp-only": false,
"reconnect-on-changed-schema": true,
"default-request-timeout-millis": 60000,
"connection-timeout-millis": 20000,
"max-connection-attempts": 100,
"between-attempts-timeout-millis": 2000,
"keepalive-delay": 120,
"concurrent-rpc-limit": 0,
"actor-response-wait-time": 5
}
]
}
Delete MountPoint
@node=my-new-mount-point-2
DELETE {{baseUrl}}/restconf/config/network-topology:network-topology/topology=topologytopology/topology-netconf/node/node={{node}}
Authorization:Basic {{user}} {{mountPointpassword}}/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)
Accept:application/json
@node=my-new-mount-point-2
DELETE {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf/node={{node}}
Authorization:Basic {{user}} {{password}}
Accept:Content-Type:application/application/json
yang-data+json