{
  "id": "vrfs.json",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$ref": "#/definitions/vrfSummaryList",
  "links": [
    {
      "title": "get a summary of the vrfs entries:list of nodes with vrfs entries",
      "href": "/",
      "method": "GET",
      "rel": "self",
      "schema": {
        "$ref": "#/definitions/vrfSummaryList"
      }
    },
    {
      "title": "get all vrf entries from a node",
      "href": "/{nodeIndex}",
      "method": "GET",
      "rel": "self",
      "schema": {
        "$ref": "#/definitions/vrfList"
      }
    }
  ],
  "definitions": {
    "vrfList": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/vrf"
      }
    },
    "vrfSummaryList": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/vrfSummary"
      }
    },    
    "vrfSummary": {
      "description": "Summary view of the routing entries learned from PRPD client",
        "type": "object",
        "additionalProperties" : false,
      "required": [
        "topologyIndex",
        "topoObjectType",
        "node",
        "entries"
      ],
      "properties": {
        "topoObjectType": {
          "type": "string",
          "enum": ["vrfSummary"]
        },
        "topologyIndex": {"$ref": "topology.json#/definitions/topologyIndex"},
        "node": {"$ref" : "node_v2.json#/definitions/node"},
        "entries": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of vrf entries"
        },
          "links": {"$ref" :"common.json#/definitions/APILinkList"}
      }
    },
      "vrfPolicy" : {
          "description" : "Reference to vrf import/export policy",
          "type" : "object",
          "additionalProperties" : false,
          
          "required" : ["policyName"],
          "properties" : {
              "policyName"     : { "type" : "string"}
          }
      },
      "vrf": {
          "description" : "Represent a single vrf data",
          "type": "object",
          "additionalProperties" : false,
          "required": [
              "topologyIndex",
              "topoObjectType",
              "node",
              "instanceName",
              "routeDistinguisher"              
          ],
          "properties": {
              "topoObjectType": {"type": "string","enum": ["vrf"]},
              "topologyIndex" : {"$ref": "topology.json#/definitions/topologyIndex"},
              "node"          : {"$ref" : "node_v2.json#/definitions/node"},
              "instanceName"  : {"type": "string"},
              "routeDistinguisher": {"type": "string"},
              "interfaces"    : {
                  "type": "array",
                  "items": {
                      "description" : "Reference to an interface on the node. In this release this is the interface name, but it may be extended to interface indexes in future releases.",
                      "type" : "object",
                      "additionalProperties" : false,
                      "required" : ["interfaceName"],
                      "properties" : {
                          "interfaceName"     : {"description" : "interfaceName deduced from router configuration" , "type" : "string"}
                      }
                  }
              },
              "VLANID"         : {"type": "integer", "description" : "VLAN ID attached to the VRF"},
              "importPolicies" : {"type": "array","items": {"$ref": "#/definitions/vrfPolicy"}},
              "exportPolicies" : {"type": "array","items": {"$ref": "#/definitions/vrfPolicy"}},
              "siteId"         : {"type": "integer","description" : "good question"},
              "site"           : {"description" : "node site ID","type": "string"}, 
              "lspMatchRegex"  : {"type": "string"}              
          }
      }
  }
}
