RESTCONF basics (not on blueprint)

Constructing RESTCONF URIs

https:// <ADDRESS> / <ROOT> / <DATA STORE> / <[YANG MODULE:]CONTAINER> / <LEAF>[?<OPTIONS>]

Main RESTCONF datastores:

HTTP headers

General information on “RESTCONF HTTP headers”:

Sample code for “RESTCONF HTTP headers”:

headers = {
  'Accept': 'application/yang-data+json',
  'Content-Type': 'application/yang-data+json'
}

Data serialization

General information on “RESTCONF Data serialization”:

Sample code for “RESTCONF Data serialization”:

import json

payload_raw = {
    "ietf-interfaces:interface": {
        "name": "Loopback1337",
        "description": "Configured by RESTCONF",
        "type": "iana-if-type:softwareLoopback",
        "enabled": True,
        "ietf-ip:ipv4": {
            "address": [
                {
                    "ip": "1.3.3.8",
                    "netmask": "255.255.255.255"
                }
            ]
        }
    }
}

payload_json = json.dumps(payload_raw, indent=4)