{	
    "id" : "link_v2.json",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "$ref" : "#/definitions/link",
    "links" : [
	{
	    "title" : "get all links",
	    "href" : "/",
	    "method" : "GET",
	    "rel" : "instances",
	    "schema" : {"$ref" : "#/definitions/linkList"}
	},
        {
	    "title" : "get all links utilization",
	    "href" : "/utilization",
	    "method" : "GET",
	    "schema" : {"$ref" : "#/definitions/linkList"}
	},
	{
	    "title" : "get link based on filter",
	    "href" : "/search?name={nameFilter}&address={ipv4Address}&queryType=OR",
	    "method" : "GET",
	    "rel" : "search",
	    "schema" : {"$ref" : "#/definitions/linkList"}
	},
        {"title" : "get SSE notification stream", "href" : "/stream","method" : "GET"},
	{
	    "title" : "get a link",
	    "href" : "/{linkIndex}",
	    "method" : "GET",
	    "rel" : "self",
	    "schema" : {"$ref" : "#/definitions/link"}
	},
        {
	    "title" : "Modify a link",
	    "href" : "/{linkIndex}",
	    "method" : "PATCH",
	    "rel" : "self",
	    "schema" : {"$ref" : "json-patch.json"},
	    "targetSchema" : {"$ref" : "#/definitions/link"}
	},
        {
	    "title" : "get the information retrieved from device collection or ML",
	    "href" : "/{linkIndex}/device",
	    "method" : "GET",
	    "rel" : "self",
	    "schema" : {"$ref" : "#/definitions/link"}
	},
        {
	    "title" : "Modify the link information on the device via Netconf",
	    "href" : "/{linkIndex}/device",
	    "method" : "PUT",
	    "rel" : "self",
	    "schema" : {"$ref" : "#/definitions/updateConfigLink"},
            "targetSchema" : {"$ref" : "#/definitions/link"}
	},
        {
	    "title" : "PATCH a link",
	    "href" : "/{linkIndex}",
	    "description" : "Update an existing link, accepting a RFC6902 document producing a  #/definitions/updateLink",
	    "method" : "PATCH",
	    "rel" : "self",
            "schema" : {"$ref" : "json-patch.json"},
	    "targetSchema" : {"$ref" : "#/definitions/link"}
	},
        {
	    "title" : "PATCH a link",
	    "href" : "/{linkIndex}/user",
	    "description" : "Update an existing link user properties, accepting a RFC6902 document producing a  #/definitions/updateLink",
	    "method" : "PATCH",
	    "rel" : "self",
            "schema" : {"$ref" : "json-patch.json"},
	    "targetSchema" : {"$ref" : "#/definitions/link"}
	},
        {
	    "title" : "PATCH a link",
	    "href" : "/{linkIndex}/device",
	    "description" : "Update an existing link user properties, accepting a RFC6902 document producing a  #/definitions/updateLink",
	    "method" : "PATCH",
	    "rel" : "self",
            "schema" : {"$ref" : "json-patch.json"},
	    "targetSchema" : {"$ref" : "#/definitions/link"}
	 },
        {
	    "title" : "get the information retrieved from bgp-ls collection",
	    "href" : "/{linkIndex}/bgp-ls",
	    "method" : "GET",
	    "rel" : "self",
	    "schema" : {"$ref" : "#/definitions/link"}
	},
        {
	    "title" : "get the information defined by the user (i.e set from REST interface)",
	    "href" : "/{linkIndex}/user",
	    "method" : "GET",
	    "rel" : "self",
	    "schema" : {"$ref" : "#/definitions/link"}
	},
        {
	    "title" : "Update a link",
	    "href" : "/{linkIndex}/user",
	    "description" : "Update an existing link.",
	    "method" : "PUT",
	    "rel" : "self",
	    "schema" : {"$ref" : "#/definitions/updateLink"},
            "targetSchema" : {"$ref" : "#/definitions/link"}
	},
	{
	    "title" : "get a link event history",
	    "href" : "/{linkIndex}/history?start={startTimeStamp}&end={endTimeStamp}",
	    "description" : "Provide the history of events for the Link, it can be optionally filtered by start (inclusive) and end (exclusive) timestamp",
	    "method" : "GET",
	    "rel" : "self",
	    "schema" : {"$ref" : "#/definitions/linkHistoryEventList"}
	},
	{
	    "title" : "create a new link",
	    "description" : "Create a new link, schema on request is #/definitions/createLink",
	    "href" : "/",
	    "method" : "POST",
	    "rel" : "create",
	    "schema" : {"$ref" : "#/definitions/createLink"},
            "targetSchema" : {"$ref" : "#/definitions/link"}
	},
	{
	    "title" : "Update a link (same as user)",
	    "href" : "/{linkIndex}",
	    "description" : "Update an existing link, schema on request is #/definitions/updateLink",
	    "method" : "PUT",
	    "rel" : "self",
	    "schema" : {"$ref" : "#/definitions/updateLink"},
            "targetSchema" : {"$ref" : "#/definitions/link"}
	},
	{
	    "title" : "delete a link",
	    "href" : "/{linkIndex}",
	    "method" : "DELETE"
	}
    ],
    "definitions" : {
	"linkHistoryEventList" : {
	    "type" : "array",
	    "items" : { "$ref" : "#/definitions/linkHistoryEvent"}	    
	},
	"linkHistoryEvent" : {
	    "description" : "An entry in the Link history, which consists of the information received from Topology acquisition",
            "type" :"object",
            "properties" : {
		"timestamp" : {
		    "description" :"Event Timestamp.",
		    "type" : "integer"
		}		
            },
	    "oneOf" : [
		{"$ref" :"#/definitions/link"}
            ]
	},
	"linkList" : {
	    "type" : "array",
	    "items" : {"$ref" : "#/definitions/link"}	    
	},
        "UndefinedInterface":{
	    "id": "#/definitions/UndefinedInterface",
            "type" : "object",
	    "description" : "Interface where correlation failed",
            "required":["interfaceIndex","address","topoObjectType"],
            "properties":{
		"topoObjectType" : {"type" : "string","enum" : ["UndefinedInterface"]},
                "interfaceIndex":{"type":"integer","enum" : [0]},
                "address" : {"type":"string"},
                "node" : {"$ref" : "node_v2.json#/definitions/node"}
            }
        },
	"ipv4Reference" : {
	    "type" : "object",
	    "description" : "a numbered reference, not correlated to any object type",
	    "required" : ["address","topoObjectType"],
	    "properties" : {
		"topoObjectType" : {"type" : "string","enum" : ["ipv4"]},
		"address" : {"type":"string"},                
                "linkIndex" : {"description" : "Optional attribute, refer to the link index","type" : "integer"}
	    }	    
	},
        "ipv4TaggedAddress" : {
	    "type" : "object",
	    "description" : "a numbered reference, not correlated to any object type, with an optional tag",
	    "required" : ["address","topoObjectType"],
            "additionalProperties" : false,
	    "properties" : {
		"topoObjectType" : {"type" : "string","enum" : ["ipv4"]},
		"address" : {"type":"string","format" : "ipv4"},
                "tag" : {"type":"string"}
	    }
	},

	"unnumberedIfReference" : {
	    "type" : "object",
	    "description" : "a unnumbered reference, not correlated to any object type",
	    "required" : ["node","topoObjectType","ifIndex"],
	    "properties" : {
		"topoObjectType" : {"type" : "string","enum" : ["unnumberedIfId"]},
		"node"    : {"type":"string"},
		"ifIndex" : {"type":"integer"},
                "address"   : {"type":"string", "description" : "The Link name, if present"},
                "linkIndex" : {"description" : "Optional attribute, refer to the link index","type" : "integer"}
	    }	    
	},
	"interfaceSwCap" : {
	    "description" : "description of the interface type, based on transport topology",
	    "type" :"object",
	    "additionalProperties" : false,
	    "properties" :{
		"switchingCapability" : {
		    "enum": [
			"switching-packet",
			"switching-dcsc",
			"switching-otn",
			"switching-psc1",
			"switching-lsc",
			"switching-evpl",
			"switching-tdm",
			"switching-fsc",
			"switching-l2sc"
		    ],
		    "type": "string"
		},
		"encoding" : {
		    "enum": [
			"lsp-encoding-pdh",
			"lsp-encoding-optical-channel",
			"lsp-encoding-sdh",
			"lsp-encoding-packet",
			"lsp-encoding-digital-wrapper",
			"lsp-encoding-fiber",
			"lsp-encoding-line",
			"lsp-encoding-ethernet",
			"lsp-encoding-fiber-channel",
			"lsp-encoding-oduk",
			"lsp-encoding-lambda"
		    ],
		    "type": "string"
		}
	    }
	},
	"LinkInterfaceRef" : {
            "description" :"reference to an interface on a link",
	    "type" : "object",
            "additionalProperties" : false,
	    "required" : ["topoObjectType"],
	    "properties" : {
		"linkName"       : {"type" : "string"},
		"topoObjectType" : {"type" : "string","enum" : ["interfaceRef"]},
		"ipv4Address" : {"description":"interface Ipv4 Address",
				 "$ref" : "#/definitions/ipv4Reference"},
                "ifIndex" : { 
                    "description" : "node local interface index",
                    "type" : "integer"
                },
		"node"    : { "$ref" : "node_v2.json#/definitions/node"}
	    }
	},
        "SIDList" : {            
            "type" : "array",
            "items" : {"$ref" : "#/definitions/adjacencySegmentIdentifiers"}            
        },
        "adjacencySegmentIdentifiers" : {
            "type" : "object",
            "properties" :  {
                "weight" : {"type" : "number","description":""},
                "sid"    : {"type" : "number","description":""},
                "flags"  : {"type" : "number","description":"ISIS-Flags, the OSPF are mapped to the ISIS "}
            }
        },
        "interfaceUtilization" : {
            "description" : "The current utilization calculated by the Path Computation Server. Its accounting for all the LSPs and demands in the model",
            "type" : "object",
            "additionalProperties" : false,
            "properties" : {
                "utilization"           : {"type" : "number","minimum":0, "maximum": 100,"description":"link utilization  (utilAZ in IP/MPLSView)"},
                "availableBandwidth"    : {"type" : "number", "description":"link available bandwidth used for the calculation (in bps) ", "$comment" : "availableBw"},
                "usedBandwidth"         : {"type" : "number", "description":"link used bandwidth ((in bps))", "$comment" : "usedBw"},
                "tunnelUtilization"     : {"type" : "number","minimum":0, "description":"link utilization percentage by Tunnels (Based on intended BW) (rsvpUtilAZ in IP/MPLSView)","$comment" : "new field if SR/RSVP "},
                "tunnelLiveUtilization" : {"type" : "number","minimum":0, "description":"link utilization percentage by Tunnels ( Based on live/actual network state) (rsvpLiveUtilAZ in IP/MPLSView)", "$comment" : "new field if SR/RSVP"},
                "measuredDelay"         : {"type" : "number","minimum":0, "description":"measured delay in ms (measuredDelayAZin IP/MPLSView)"},
                "lossPercentage"        : {"type" : "number","minimum":0, "maximum": 100, "description":"loss percentage (lossPercentageAZ in IP/MPLSView)"},
                "interfaceUtilization"  : {"type" : "number","minimum":0, "maximum": 100, "description":"interface utilization percentage (intfUtilAZ in IP/MPLSView)"},
                "interfaceTraffic"      : {"type" : "number","minimum":0, "description":"Measured traffic on the interface, in 100 of bps"},
                "peakUtilization"       : {"type" : "number","minimum":0, "description": "Worst link utilization reached during failure simulations. This is not available on live topology"},
                "RSVP" : {
                    "type"       : "object",
                    "description" : "RSVP Tunnel utilization, if separate SR and RSVP bandwidth accounting is used (by default both are accounted in the space).",
                    "properties" : {
                        "utilization" : {"type" : "number","description":"link utilization by RSVP tunnels (Based on intended BW)", "$comment" : "linkLoadRSVP"},
                        "liveUtilization" : {"type" : "number","description":"link utilization by RSVP tunnels (Based on actual BW)", "$comment" : "linkLoadLiveRSVP"}
                    }
                },
                "SR" : {
                    "type"       : "object",
                    "description" : "SR Tunnel utilization, if separate SR and RSVP bandwidth accounting is used, (by default both are accounted in the space).",
                    "properties" : {
                        "utilization" : {"type" : "number","description":"link utilization by RSVP tunnels (Based on intended BW)", "$comment" : "linkLoadSR"}
                    }
                },
                "lastUpdate" : {"type": "string","format" : "date-time","description": "Timestamp of last update"}
            }
        },
        "interface" : {
            "description" :"interface, can be part of a link",
            "type" : "object",
            "additionalProperties" : false,
	    "required" : ["topoObjectType","node"],
            "properties" : {		
		"topoObjectType" : {"type" : "string","enum" : ["interface"]},
                "name"    : { "$ref" : "common.json#/definitions/name"},
                "interfaceIndex"   : { "$ref" : "common.json#/definitions/index"},
                "utilization" : {"$ref" : "#/definitions/interfaceUtilization"},
		"ipv4Address" : {"description":"interface Ipv4 Address",
				 "$ref" : "#/definitions/ipv4Reference"},
                "ifIndex" : { 
                    "description" : "node local interface index",
                    "type" : "integer"
                },
                "node"    : { "$ref" : "node_v2.json#/definitions/node"},
                "TEmetric"    : {"description":"aggregated TE metric","type" : "integer"},
		"unreservedBw": {"description":"aggregated unreservedBw","$ref" : "common.json#/definitions/unreservedBw"},
		"interfaceSwitchingCapabilities" : {"description" : "description of the interface type", "$ref" : "#/definitions/interfaceSwCap"},
                "protocols": {
                    "description" : "protocols configuration and information",
                    "type" : "object",
                    "additionalProperties" : false,
                    "properties" : {
                        "OSPF" : {
                            "type" : "object",
                            "additionalProperties" : false,
                            "properties" : {
                                "metric"   : {"type" : "integer"},
                                "TEMetric" : {"type" : "integer"},
                                "area"     : {"type" : "integer"},
				"srlgs"    : {"$ref" : "common.json#/definitions/srlgList"}
                            }
                        },								
                        "OSPFv3" : {
                            "type" : "object",
                            "additionalProperties" : false,
                            "properties" : {
                                "metric"   : {"type" : "integer"},
                                "TEMetric" : {"type" : "integer"},
                                "area"     : {"type" : "integer"},
				"srlgs"    : {"$ref" : "common.json#/definitions/srlgList"}

                            }
                        },                        
                        "ISIS": {
                            "type" : "object",
                            "additionalProperties" : false,
                            "properties" : {
                                "metric"   : {"type" : "integer", "description" : "aggregated metric, if both level are present this is L2"},
                                "TEMetric" : {"type" : "integer"},
                                "level"    : {"type" : "string", "enum" : ["L1","L2","L1L2"]},
                                "metricL1"   : {"type" : "integer"},
                                "metricL2"   : {"type" : "integer"},
				"srlgs"    : {"$ref" : "common.json#/definitions/srlgList"}
                            }								
                        },								
                        "RSVP": {
                            "type" : "object",
                            "additionalProperties" : false,
                            "properties" : {								
                                "bandwidth" : {"$ref" : "common.json#/definitions/Bandwidth" }
                            }
                        },
			"transport" : {
			    "type" : "object",
                            "additionalProperties" : false,
                            "properties" : {
				"clientReference" : {
                                    "$ref" : "#/definitions/ipv4Reference",
                                    "description" : "For Transport inter-layer link, this contains the IP address of the interface the access link is connected to. " 
                                },
                                "remoteLinkInfo" : {
				    "description" : "Transport inter-layer link that is connected to that link through the transport network. This information is calculated from connectivity matrix",
				    "$ref" : "#/definitions/LinkInterfaceRef"
				}
                            }
			},
                        "SR" : {
                            "type" : "object",
                            "description" : "SR properties",
                            "properties" : {
                                "SIDs" : {"$ref": "#/definitions/SIDList"}
                            }
                        },
                        "LDP" : {
                            "type" : "object",
                            "description" : "LDP protocol properties, placeholder",
                            "properties" : {}
                        }
                    }
                }, 
                "adminStatus" : {"$ref" : "common.json#/definitions/adminStatus"},		
                "bandwidth" : {"$ref" : "common.json#/definitions/Bandwidth"},
                "localProtection" : {
                    "description" : "MPLS local protection",
                    "type" : "string",					
                    "enum" : ["link","nodelink"]
                },
		"linkProtection" : {"$ref" : "#/definitions/linkProtectionType","description" : "Link protection, if derived from transport topology it does also set the canFail parameter to false"},
                "TEcolor" : {
                    "description" : "Coloring, Attributes, Affinity",
                    "type" : "integer"
                },					
                "delay" : {
                    "description" : "Link delay in millisecond",
                    "type" : "number"
                },
		"srlgs"    : {"$ref" : "common.json#/definitions/srlgList"},
                "designParameters" : {
                    "description" : "User defined design properties",
                    "type" : "object",
                    "properties" : {
                        "userCost":	{"type" : "integer","description" : "User metric"},
                        "canFail" :     {"type" : "boolean","default" : true,"description" : "Indicate if the link can fail or not. This parameter is evaluated when routing LSP with useProtectedLinks set to Protected."},
                        "distance" :    {"type" : "integer","description" : "link distance, unit:?"},
                        "trafficRerouteThreshold" : {"type" : "integer","description" : "The percentage of utilization that trigger a reroute based on analytics","minimum":0,"maximum":100},
                        "latencyIncrementThreshold" : {"type" : "integer","description" : "Unit: milliseconds. Latency increment that trigger LSP rerouting. If the link latency increase more than the value between two collection, the LSPs on that link will be rerouted ","minimum":0},                
                        "packetLossThreshold" : {"type" : "integer","description" : "If the packet loss on the link exceed the value, the LSPs on the link will be rerouted.","minimum":0,"maximum":100}
                    }
                },
		"comment"           : {"description" : "Comment" , "type" : "string"},
                "interfaceName"     : {"description" : "interfaceName deduced from router configuration" , "type" : "string"},
                "userProperties" : {"$ref" : "userProperties.json#/definitions/linkInterfaceUserProperties"},
                "epeProperties": {"$ref": "epeProperties.json#/definitions/epeProperties"}
            }
        },
	"linkType" : {
	    "description" : "summarized link type information.",
	    "type" : "string"	   	    
	},
	"linkProtectionType":  {
	    "description": "Link Protection Type desired for this link",
            "enum": [
                "unprotected",
                "extra-traffic",
                "shared",
                "1-for-1",
                "1-plus-1",
                "enhanced"
            ],
	    "type": "string"},
        "updateLink" : {
            "description" : "set of properties that can be updated (PUT) on a link",
            "type" : "object",
	    "required" : ["topologyIndex","topoObjectType","linkIndex","endA","endZ"],
	    "additionalProperties" : false,
            "properties" : {
		"topoObjectType" : {"type" : "string","enum" : ["link"]},
		"topologyIndex" : { "$ref" : "topology.json#/definitions/topologyIndex"},
                "id": {
                    "description": "link identifier, generated by NorthStar",
                    "$ref" : "common.json#/definitions/name255"},
                "name": {
                    "description": "link name, which can be modified",
                    "$ref" : "common.json#/definitions/name255"},
                "linkIndex" : {
                    "description" : "program ID for link",
                    "type" : "integer"
                },
                "linkType" : {
                    "description" : "link type",
                    "$ref" : "#/definitions/linkType"
                },
                "endA": {
                    "description": "link information from A side",		    
                    "$ref"  :"#/definitions/interface"
                },
                "endZ": {
                    "description": "link information from Z side",
                    "$ref"  :"#/definitions/interface"
		},
                "comment"           : {"description" : "Comment" , "type" : "string"},
                "interfaceSwitchingCapabilities" : {"description" : "Aggregated Link switching capabilites", "$ref" : "#/definitions/interfaceSwCap"},
                "userProperties" : {"$ref" : "userProperties.json#/definitions/linkUserProperties"},
                "epeProperties": {"$ref": "epeProperties.json#/definitions/epeProperties"}
	    }
        },
        "updateConfigLink" : {
            "description" : "set of properties that can be updated (PUT) on a link (config on the device only, which is more restricted )",
            "type" : "object",
	    "required" : ["topologyIndex","topoObjectType","linkIndex","endA","endZ"],
	    "additionalProperties" : false,
            "properties" : {
		"topoObjectType" : {"type" : "string","enum" : ["link"]},
		"topologyIndex" : { "$ref" : "topology.json#/definitions/topologyIndex"},
                "id": {
                    "description": "link identifier, generated by NorthStar",
                    "$ref" : "common.json#/definitions/name255"},
                "linkIndex" : {
                    "description" : "program ID for link",
                    "type" : "integer"
                },
                "endA": {
                    "description": "link information from A side",		    
                    "$ref"  :"#/definitions/interfaceConfigUpdate"
                },
                "endZ": {
                    "description": "link information from Z side",
                    "$ref"  :"n#/definitions/interfaceConfigUpdate"
		},
                "comment"           : {"description" : "Comment" , "type" : "string"},
                "userProperties" : {"$ref" : "userProperties.json#/definitions/linkUserProperties"},
                "epeProperties": {"$ref": "epeProperties.json#/definitions/epeProperties"}
	    }
        },
        "interfaceConfigUpdate" : {
            "description" :"interface config parameters that can be modified on the device, if NETCONF is active ",
            "type" : "object",
            "additionalProperties" : false,
	    "required" : ["topoObjectType","node"],
            "properties" : {		
		"topoObjectType" : {"type" : "string","enum" : ["interface"]},
                "interfaceIndex" : { "description" : "used for reference only, this parameter cannot be modified", "$ref" : "common.json#/definitions/index"},
                "node"    : { "description" : "used for reference only, this parameter cannot be modified","$ref" : "node_v2.json#/definitions/node"},                
                "protocols": {
                    "description" : "Protocols parameters that can be changed using NETCONF",
                    "type" : "object",
                    "additionalProperties" : false,
                    "properties" : {
                        "OSPF" : {
                            "type" : "object",
                            "additionalProperties" : false,
                            "properties" : {
                                "metric"   : {"type" : "integer"},
                                "TEMetric" : {"type" : "integer"},
                                "area"     : {"description" : "used for reference only, this parameter cannot be modified","type" : "integer"},
                                "srlgs"    : {"description" : "used for reference only, this parameter cannot be modified", "$ref" : "common.json#/definitions/srlgList"}

                            }
                        },
                         "OSPFv3" : {
                            "type" : "object",
                             "additionalProperties" : false,
                             "description" : "used for reference only, this parameter cannot be modified",
                            "properties" : {
                                "metric"   : {"type" : "integer"},
                                "TEMetric" : {"type" : "integer"},
                                "area"     : {"type" : "integer"},
				"srlgs"    : {"$ref" : "common.json#/definitions/srlgList"}

                            }
                        }, 
                        "ISIS": {
                            "description" : "Modify the interface metric, either by indicating the metric and the levels, or by specifying the individual level. If the both a specific metric and metric+level is specified, the specif level override the general level.",
                            "oneOf" : [
                                {
                                    "type" : "object",
                                    "required" : ["level"],
                                    "properties" : {
                                        "metric"   : {"type" : "integer","description" : "set the metric on L1 or L2, depending on the level. metricL1 and metricL2 override that attribute"},                                       
                                        "level"    : {"description" : "used for reference only, this parameter cannot be modified","type" : "string", "enum" : ["L1","L2","L1L2"]},
                                        "TEMetric" : {"type" : "integer"},
                                        "metricL1"   : {"type" : "integer"},
                                        "metricL2"   : {"type" : "integer"},
                                        "srlgs"    : {"description" : "used for reference only, this parameter cannot be modified", "$ref" : "common.json#/definitions/srlgList"}
                                    }
                                },{
                                    "type" : "object",
                                    "additionalProperties" : false,
                                    "properties" : {                                            
                                        "TEMetric" : {"type" : "integer"},
                                        "metricL1"   : {"type" : "integer"},
                                        "metricL2"   : {"type" : "integer"},
                                        "srlgs"    : {"description" : "used for reference only, this parameter cannot be modified", "$ref" : "common.json#/definitions/srlgList"}
                                    }
                                }]
                        },
                        "RSVP": {
                            "type" : "object",
                            "description" : "used for reference only, this parameter cannot be modified"
                        },
                        "transport": {
                            "type" : "object",
                            "description" : "used for reference only, this parameter cannot be modified"
                        },
                        "SR": {
                            "type" : "object",
                            "description" : "used for reference only, this parameter cannot be modified"
                        },
                        "LDP": {
                            "type" : "object",
                            "description" : "used for reference only, this parameter cannot be modified"
                        }
                    }
                },
                "TEmetric"    : {"description":"aggregated TE metric","type" : "integer"},
       	        "comment"           : {"description" : "Comment" , "type" : "string"},
                "userProperties" : {"$ref" : "userProperties.json#/definitions/linkInterfaceUserProperties"},
		"epeProperties": {"$ref": "epeProperties.json#/definitions/epeProperties"},
                "name"    : {"description" : "used for reference only, this parameter cannot be modified", "$ref" : "common.json#/definitions/name"},
                "utilization" : {"description" : "used for reference only, this parameter cannot be modified","$ref" : "#/definitions/interfaceUtilization"},
		"ipv4Address" : {"description" : "used for reference only, this parameter cannot be modified","description":"interface Ipv4 Address",
				 "$ref" : "#/definitions/ipv4Reference"},
                "unreservedBw": {"description":"used for reference only, this parameter cannot be modified","$ref" : "common.json#/definitions/unreservedBw"},
		"interfaceSwitchingCapabilities" : {"description" : "used for reference only, this parameter cannot be modified", "$ref" : "#/definitions/interfaceSwCap"},
                "adminStatus" : {"description" : "used for reference only, this parameter cannot be modified","$ref" : "common.json#/definitions/adminStatus"},		
                "bandwidth" : {"description" : "used for reference only, this parameter cannot be modified","$ref" : "common.json#/definitions/Bandwidth"},
                "localProtection" : {
                    "description" : "used for reference only, this parameter cannot be modified",
                    "type" : "string",					
                    "enum" : ["link","nodelink"]
                },
		"linkProtection" : {"description" : "used for reference only, this parameter cannot be modified","$ref" : "#/definitions/linkProtectionType"},
                "TEcolor" : {
                    "description" : "used for reference only, this parameter cannot be modified",
                    "type" : "integer"
                },					
                "delay" : {
                    "description" : "used for reference only, this parameter cannot be modified",
                    "type" : "number"
                },
		"srlgs"    : {"description" : "used for reference only, this parameter cannot be modified","$ref" : "common.json#/definitions/srlgList"},
                "designParameters" : {
                    "description" : "used for reference only, this parameter cannot be modified",
                    "type" : "object"
                },
                "interfaceName"     : {"description" : "used for reference only, this parameter cannot be modified" , "type" : "string"}
                
            }
         },
        "createLink" : {
            "description" : "set of parameters accepted when creating, using POST, a planned link",
            "type" : "object",
	    "required" : ["topologyIndex","topoObjectType","endA","endZ"],
	    "additionalProperties" : false,
            "properties" : {
		"topoObjectType" : {"type" : "string","enum" : ["link"]},
		"topologyIndex" : { "$ref" : "topology.json#/definitions/topologyIndex"},
                "name": {
                    "description": "link name, which can be modified",
                    "$ref" : "common.json#/definitions/name255"},
                "linkType" : {
                    "description" : "link type",
                    "$ref" : "#/definitions/linkType"
                },
                "endA": {		    
                    "description": "link information from A side",
                    "$ref"  :"#/definitions/interface"
                },
                "endZ": {
                    "description": "link information from Z side",
                    "$ref"  :"#/definitions/interface"                    		    
		},
                "comment"           : {"description" : "Comment" , "type" : "string"},
                "interfaceSwitchingCapabilities" : {"description" : "Aggregated Link switching capabilites", "$ref" : "#/definitions/interfaceSwCap"},
                "userProperties" : {"$ref" : "userProperties.json#/definitions/linkUserProperties"},
		"epeProperties": {"$ref": "epeProperties.json#/definitions/epeProperties"}
	    }
        },
        "link" : {
	    "description" : "represents a single link",
	    "type" : "object",
	    "required" : ["topologyIndex","topoObjectType"],
            "properties" : {
		"topoObjectType" : {"type" : "string","enum" : ["link"]},
		"topologyIndex" : { "$ref" : "topology.json#/definitions/topologyIndex"},
                "id": {
                    "description": "link identifier, generated by NorthStar",
                    "$ref" : "common.json#/definitions/name255"},
                "name": {
                    "description": "link name, which can be modified",
                    "$ref" : "common.json#/definitions/name255"},
                "linkIndex" : {
                    "description" : "link program ID",
                    "type" : "integer"
                },
                "linkType" : {
                    "description" : "link type",
                     "$ref" : "#/definitions/linkType"
                },
		"serverLayerReference" : {
		    "description"  : "for links that are supported by a path in a bidirectional server layer this attribute reference a LSP index that represent that path in the server layer, this is the reference to the lspIndex",
		    "type"         : "number" 
		}, 
		"operationalStatus" : {
		    "description" : "link operational status",
		    "$ref" : "common.json#/definitions/operStatusAndPlanned"
		},
		"linkProtection" : {"$ref" : "#/definitions/linkProtectionType"},
                "endA": {
                    "description": "link information from A side",
                    "$ref"  :"#/definitions/interface"
                },
                "endZ": {
                    "description": "link information from Z side",
                    "oneOf" : [
                        {"$ref"  :"#/definitions/interface"},
                        {"$ref"  :"#/definitions/UndefinedInterface"}
                    ]
                },
                "comment"           : {"description" : "Comment" , "type" : "string"},
                "interfaceSwitchingCapabilities" : {"description" : "Aggregated Link switching capabilites", "$ref" : "#/definitions/interfaceSwCap"},
                "live" : {
                          "description" : "indicate if the link has properties coming from topology acquisition",
		          "type" : "boolean"
                },
                "userProperties" : {"$ref" : "userProperties.json#/definitions/linkUserProperties"},
		"epeProperties": {"$ref": "epeProperties.json#/definitions/epeProperties"}
        }
    },
     "linkReference" : {
            "description" : "Minimal reference to a link.. Only the linkIndex is processed unless explicitely mentioned by the refering schema.",
            "type" :"object",
            "additionalProperties" : true,
            "required" : ["linkIndex"],
            "properties" : {
                "linkIndex": {
                    "description": "Program ID for the link",
                    "$ref" : "common.json#/definitions/index"                    
                }
            }            
     },
        "linkReferenceTyped" : {
            "description" : "Minimal reference to a link.. Only the linkIndex is processed unless explicitely mentioned by the refering schema.",
            "type" :"object",
            "additionalProperties" : true,
            "required" : ["linkIndex", "topoObjectType" ],
            "properties" : {
                "topoObjectType" : {"type" : "string","enum" : ["link"]},
                "linkIndex": {
                    "description": "Program ID for the link",
                    "$ref" : "common.json#/definitions/index"                    
                }
            }            
        },
        "scopedLinkReferenceTyped" : {
            "description" : "Link end reference with explicit type.",
            "type" :"object",
            "additionalProperties" : true,
            "required" : ["linkIndex", "nodeIndex", "topoObjectType"],
            "properties" : {
                "topoObjectType" : {
                    "type" : "string", "enum": ["linkEnd"]
                },
                "linkIndex": {
                    "description": "Program ID for the link",
                    "$ref" : "common.json#/definitions/index"                    
                },
                "nodeIndex": {
                    "description": "Program ID for the source node",
                    "$ref" : "common.json#/definitions/index"                    
                }
            }
        },
        "scopedLinkReference" : {
            "description" : "Minimal reference to a link end",
            "type" :"object",
            "additionalProperties" : true,
            "required" : ["linkIndex", "nodeIndex"],
            "properties" : {
                "linkIndex": {
                    "description": "Program ID for the link",
                    "$ref" : "common.json#/definitions/index"                    
                },
                "nodeIndex": {
                    "description": "Program ID for the source node for that link end",
                    "$ref" : "common.json#/definitions/index"                    
                }
            }
        } 
    }
}
