{ "$id": "networkDocument", "title": "networkDocument", "description": "A single network", "type": "object", "properties": { "_id": { "$ref": "common#/definitions/mongoObjectId" }, "name": { "$ref": "common#/definitions/standardName" }, "description": { "$ref": "common#/definitions/standardDescription" }, "addressType": { "$ref": "common#/definitions/addressType" }, "canonical": { "oneOf": [ { "type": "string", "pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$", "examples": [ "192.168.0.92/32", "192.168.000.92/24", "192.168.0.92/8" ] }, { "type": "string", "pattern": "^(?=(.*:.*){2,7}$)((:|(([0-9a-fA-F]{1,4}:){1,6}))(((:[0-9a-fA-F]{1,4}){1,6})|:))(\\/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))?$", "examples": [ "2001:db8:a0b:12f0::1/64" ] }, { "type": "string", "pattern": "^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$", "examples": [ "00:1B:44:11:3A:B7" ] }, { "$comment": "Allow newly created networks to have empty address until updating in the UI", "type": "string", "enum": [ "" ] } ] }, "address": { "oneOf": [ { "type": "string", "pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}$", "examples": [ "192.168.0.92", "192.168.000.92", "192.168.0.92" ] }, { "type": "string", "pattern": "^(?=(.*:.*){2,7}$)((:|(([0-9a-fA-F]{1,4}:){1,6}))(((:[0-9a-fA-F]{1,4}){1,6})|:))$", "examples": [ "2001:db8:a0b:12f0::1" ] }, { "type": "string", "pattern": "^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$", "examples": [ "00:1B:44:11:3A:B7" ] } ] }, "prefixLength": { "type": "integer", "minimum": 0, "maximum": 128 }, "netmask": { "type": "string" }, "hostmask": { "type": "string" } }, "required": [ "name", "canonical", "addressType" ], "additionalProperties": true }