{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Describes a list of endpoints.",
    "items": {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Describes an endpoint that is capable of sending or receiving network flows.",
        "properties": {
            "attached_network_device": {
                "description": "Peer network device (switch) details. This cannot be an endpoint.",
                "properties": {
                    "chassis_id": {
                        "anyOf": [
                            {
                                "description": "When the Chassis ID is a MAC address, use this format.",
                                "pattern": "^([0-9a-f]{2}-){5}([0-9a-f]{2})$",
                                "type": "string"
                            },
                            {
                                "description": "When the Chassis ID is anything other than a MAC address, a freeform string may be used.",
                                "pattern": "^.+$",
                                "type": "string"
                            }
                        ],
                        "description": "Matches the chassis_id of the peer network device. Where LLDP is implemented on the network device interfaces, the LLDP Chassis ID should match this value."
                    },
                    "port_id": {
                        "anyOf": [
                            {
                                "description": "When the Port ID is a MAC address, use this format.",
                                "pattern": "^([0-9a-f]{2}-){5}([0-9a-f]{2})$",
                                "type": "string"
                            },
                            {
                                "description": "When the Port ID is anything other than a MAC address, a freeform string may be used.",
                                "pattern": "^.+$",
                                "type": "string"
                            }
                        ],
                        "description": "Matches the port_id of the interface on the peer network device to which the endpoint is connected. Where LLDP is implemented on the network device interfaces, the LLDP Port ID should match this value."
                    }
                },
                "required": [
                    "chassis_id",
                    "port_id"
                ],
                "type": "object"
            },
            "chassis_id": {
                "anyOf": [
                    {
                        "description": "When the Chassis ID is a MAC address, use this format",
                        "pattern": "^([0-9a-f]{2}-){5}([0-9a-f]{2})$",
                        "type": "string"
                    },
                    {
                        "description": "When the Chassis ID is anything other than a MAC address, a freeform string may be used",
                        "pattern": "^.+$",
                        "type": "string"
                    },
                    {
                        "description": "When the Chassis ID is unavailable it should be set to null",
                        "type": "null"
                    }
                ],
                "description": "Chassis ID of the interface, as signalled in LLDP from this endpoint. Maybe null where LLDP is unsuitable for use (i.e. virtualised environments). Matches to IS-04 nodes' interfaces.chassis_id and should be same."
            },
            "id": {
                "description": "Globally unique identifier for the network endpoint",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
            },
            "ip_address": {
                "anyOf": [
                    {
                        "format": "ipv4"
                    },
                    {
                        "format": "ipv6"
                    }
                ],
                "description": "IP address on which the endpoint sends/receives flows. IP address must be unique in the network.",
                "type": "string"
            },
            "label": {
                "description": "Optional. Freeform string label for the endpoint",
                "type": "string"
            },
            "max_bandwidth": {
                "description": "Optional. Maximum bandwidth that the sender is allowed to send, formatted as a number followed by kbit/s, Mbit/s, Gbit/s. NB: Values should be formatted with no fraction component if possible, using the largest unit that allows that.",
                "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?[kMG]bit\\/s$",
                "type": "string"
            },
            "port_id": {
                "description": "MAC address of the endpoint. Where LLDP is implemented on the endpoint, the LLDP Port ID should match this value. Matches to IS-04 nodes' interfaces.port_id and should be same.",
                "pattern": "^([0-9a-f]{2}-){5}([0-9a-f]{2})$",
                "type": "string"
            },
            "role": {
                "default": "both",
                "description": "Optional with default. The role of the endpoint as a sender or receiver.",
                "enum": [
                    "sender",
                    "receiver",
                    "both"
                ],
                "type": "string"
            }
        },
        "required": [
            "id",
            "chassis_id",
            "port_id",
            "ip_address"
        ],
        "type": "object"
    },
    "minItems": 0,
    "title": "List of endpoints.",
    "type": "array",
    "uniqueItems": true
}
