Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status: 2020-06-27: under construction

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

  1. RFC8040 defines RESTCONF
  2. The latest open-source implementation of RFC8040 is today in OpenDaylight Aluminium. However OpenDaylight Sodium and OpenDaylight Magnesium are good enough for our purposes.
  3. 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
Content-Type:application/json

(currently not found... 404 (wink) )

Get NetConf Topology from configuration datastore

GET {{baseUrl}}/restconf/config/network-topology:network-topology/topology-netconf

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

  1. RFC8040 defines RESTCONF
  2. The latest open-source implementation of RFC8040 is today in OpenDaylight Aluminium. However OpenDaylight Sodium and OpenDaylight Magnesium are good enough for our purposes.
  3. 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/jsonGET {{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": {
    "filter": [{
      "property": "status",
      "filtervalue": "Connecting"
      }
    ],
    "sortorder": [{
      "property": "node-id",
      "sortorder": "descending"
      }
    ],
    "pagination": {
      "size": 5,
      "page": 3
     }
  }
}

POST {{baseUrl}}/restconfrests/operationaloperations/networkdata-topologyprovider:read-network-topology/topology/topology-netconf-element-connection-list
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Content-Type:application/yang-data+jsonGET {{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/jsonGet only the node-ids from both datastores{
  "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?fields=node(node-id)
Authorization:Basic /node={{usermountPoint}} {{password}}
Accept:application/json
Content-Type:application/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/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+jsonContent-Type:application/json

Get only the node-ids and their connection-status

n/a

GETEdit Config operation:merge

@node=Core14-ONF-NTS-Manager

PUT {{baseUrl}}/restsrestconf/dataconfig/network-topology:network-topology/topology=/topology-netconf?fields=node(node-id;netconf-node-topology:connection-status) /node/{{node}}/yang-ext:mount/network-topology-simulator:simulator-config/notification-config
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type:application/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/json
Content-Type:application/json

Get  capabilities of a given node-id

GET

{
  "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}}/restconfrests/operationaldata/networknetwork-topology:network-topology/topology/topologytopology=topology-netconf/node/={{mountPointnode}}/netconf-nodeyang-ext:mount/network-topology:available-capabilities-simulator:simulator-config/notification-config
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json
Content-Type:application/yang-data+json

GET {{baseUrl}}/rests/data/{
  "network-topology-simulator:network-topology/topology=topology-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.

POSTnotification-config": {
    "is-netconf-available": true,
    "ves-heartbeat-period": 0,
    "is-ves-available": false,
    "fault-notification-delay-period": [
      60, 50, 40, 10
    ]
  }
}

# Pay attention to the namespaces!!!

Create MountPoint

@node=my-new-mount-point-2
PUT {{baseUrl}}/restconf/operationsconfig/datanetwork-providertopology:create-network-element-connectionnetwork-topology/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",
      "datanetconf-node-providertopology:usernamepassword": "netconf",
      "datanetconf-node-providertopology:passwordusername": "netconf",
      "datanetconf-node-providertopology:issleep-requiredfactor": "true"
  }
}

# Note: the http body is the same!

POST {{baseUrl}}/rests/operations/data-provider:create-network-element-connection
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type:application/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",
    "data-provider:username": "netconf",
    "data-provider: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-list1.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

{
  "input": {network-topology:node": [
    {
      "node-id": "{{node}}",
      "host": "127.0.0.1",
      "filterport": [{830,
      "propertypassword": "statusnetconf",
      "filtervalueusername": "Connectingnetconf",
      }
    ],
    "sortorder": [{"sleep-factor": 1.5,
      "tcp-only": false,
      "reconnect-on-changed-schema": true,
      "propertydefault-request-timeout-millis": "node-id"60000,
      "connection-timeout-millis": 20000,
      "sortordermax-connection-attempts": "descending"100,
      }
    ],
"between-attempts-timeout-millis": 2000,
      "paginationkeepalive-delay": {120,
      "sizeconcurrent-rpc-limit": 50,
      "pageactor-response-wait-time": 35
     }
  ]
}
}POST

Delete MountPoint

@node=my-new-mount-point-2
DELETE {{baseUrl}}/restsrestconf/operationsconfig/datanetwork-providertopology:read-network-element-connection-listtopology/topology/topology-netconf/node/{{node}}
Authorization:Basic {{user}} {{password}}
Accept:application/json
Content-Type
Accept:application/json

{
  "input": {
    "filter": [{
      "property": "status",
      "filtervalue": "Connecting"
      }
    ],
    "sortorder": [{
      "property": "node-id",
      "sortorder": "descending"
      }
    ],
    "pagination": {
      "size": 5,
      "page": 3
     }
  }
}@node=my-new-mount-point-2
DELETE {{baseUrl}}/rests/data/network-topology:network-topology/topology=topology-netconf/node={{node}}
Authorization:Basic {{user}} {{password}}
Accept:application/yang-data+json