|
114 | 114 | },
|
115 | 115 | "description": "A bad request."
|
116 | 116 | },
|
| 117 | + "Conflict": { |
| 118 | + "content": { |
| 119 | + "application/json": { |
| 120 | + "example": { |
| 121 | + "code": 409, |
| 122 | + "msg": "Conflict" |
| 123 | + }, |
| 124 | + "schema": { |
| 125 | + "$ref": "#/components/schemas/Error" |
| 126 | + } |
| 127 | + } |
| 128 | + }, |
| 129 | + "description": "A conflict has occurred." |
| 130 | + }, |
117 | 131 | "Forbidden": {
|
118 | 132 | "content": {
|
119 | 133 | "application/json": {
|
|
250 | 264 | "properties": {
|
251 | 265 | "defaultNameservers": {
|
252 | 266 | "items": {
|
253 |
| - "$ref": "#/components/schemas/IPv4" |
| 267 | + "$ref": "#/components/schemas/IP" |
254 | 268 | },
|
255 | 269 | "maxItems": 3,
|
256 | 270 | "type": "array"
|
|
354 | 368 | "minProperties": 1,
|
355 | 369 | "properties": {
|
356 | 370 | "ipv4": {
|
357 |
| - "$ref": "#/components/schemas/CreateNetworkIPv4" |
| 371 | + "$ref": "#/components/schemas/CreateNetworkIPv4Body" |
358 | 372 | },
|
359 | 373 | "ipv6": {
|
360 |
| - "$ref": "#/components/schemas/v1CreateNetworkIPv6" |
| 374 | + "$ref": "#/components/schemas/CreateNetworkIPv6Body" |
361 | 375 | }
|
362 | 376 | },
|
363 | 377 | "type": "object"
|
|
393 | 407 | },
|
394 | 408 | "type": "object"
|
395 | 409 | },
|
396 |
| - "CreateNetworkIPv4": { |
| 410 | + "CreateNetworkIPv4Body": { |
397 | 411 | "description": "The config object for a IPv4 network.",
|
398 | 412 | "properties": {
|
| 413 | + "gateway": { |
| 414 | + "$ref": "#/components/schemas/v1NetworkGateway" |
| 415 | + }, |
399 | 416 | "nameservers": {
|
400 | 417 | "$ref": "#/components/schemas/Nameserver"
|
401 | 418 | },
|
|
409 | 426 | },
|
410 | 427 | "type": "object"
|
411 | 428 | },
|
| 429 | + "CreateNetworkIPv6Body": { |
| 430 | + "description": "The config object for a IPv6 network.", |
| 431 | + "properties": { |
| 432 | + "gateway": { |
| 433 | + "$ref": "#/components/schemas/v1NetworkGateway" |
| 434 | + }, |
| 435 | + "nameservers": { |
| 436 | + "$ref": "#/components/schemas/Nameserverv6" |
| 437 | + }, |
| 438 | + "prefixLength": { |
| 439 | + "default": 64, |
| 440 | + "example": 64, |
| 441 | + "maximum": 128, |
| 442 | + "minimum": 56, |
| 443 | + "type": "integer" |
| 444 | + } |
| 445 | + }, |
| 446 | + "type": "object" |
| 447 | + }, |
412 | 448 | "CreateNetworkPayload": {
|
| 449 | + "description": "Object that represents the request body for a network create.", |
413 | 450 | "properties": {
|
414 | 451 | "addressFamily": {
|
415 | 452 | "$ref": "#/components/schemas/CreateNetworkAddressFamily"
|
416 | 453 | },
|
417 | 454 | "name": {
|
418 | 455 | "$ref": "#/components/schemas/GenericName"
|
| 456 | + }, |
| 457 | + "routed": { |
| 458 | + "$ref": "#/components/schemas/v1Routed" |
419 | 459 | }
|
420 | 460 | },
|
421 | 461 | "required": [
|
|
448 | 488 | "pattern": "^[A-Za-z0-9]+((-|_|\\s|\\.)[A-Za-z0-9]+)*$",
|
449 | 489 | "type": "string"
|
450 | 490 | },
|
451 |
| - "IPv4": { |
452 |
| - "description": "Object that represents an IPv4 address.", |
| 491 | + "IP": { |
| 492 | + "description": "Object that represents an IP address.", |
453 | 493 | "example": "10.1.2.10",
|
454 | 494 | "pattern": "((^\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\s*$)|(^\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$))",
|
455 | 495 | "type": "string"
|
|
467 | 507 | "50.60.70.80"
|
468 | 508 | ],
|
469 | 509 | "items": {
|
470 |
| - "$ref": "#/components/schemas/IPv4" |
| 510 | + "$ref": "#/components/schemas/IP" |
471 | 511 | },
|
472 | 512 | "maxItems": 3,
|
473 | 513 | "type": "array"
|
|
487 | 527 | "Network": {
|
488 | 528 | "description": "Object that represents a network.",
|
489 | 529 | "properties": {
|
| 530 | + "gateway": { |
| 531 | + "$ref": "#/components/schemas/v1NetworkGateway" |
| 532 | + }, |
490 | 533 | "name": {
|
491 | 534 | "example": "My network",
|
492 | 535 | "type": "string"
|
|
519 | 562 | "type": "array"
|
520 | 563 | },
|
521 | 564 | "publicIp": {
|
522 |
| - "$ref": "#/components/schemas/IPv4" |
| 565 | + "$ref": "#/components/schemas/IP" |
| 566 | + }, |
| 567 | + "routed": { |
| 568 | + "$ref": "#/components/schemas/v1Routed" |
523 | 569 | },
|
524 | 570 | "state": {
|
525 | 571 | "$ref": "#/components/schemas/ResourceState"
|
|
662 | 708 | "type": "object"
|
663 | 709 | },
|
664 | 710 | "PartialUpdateNetworkPayload": {
|
| 711 | + "description": "Object that represents the request body for a network update.", |
665 | 712 | "properties": {
|
666 | 713 | "addressFamily": {
|
667 | 714 | "$ref": "#/components/schemas/UpdateNetworkAddressFamily"
|
668 | 715 | },
|
669 | 716 | "name": {
|
670 | 717 | "$ref": "#/components/schemas/GenericName"
|
| 718 | + }, |
| 719 | + "routed": { |
| 720 | + "$ref": "#/components/schemas/v1Routed" |
671 | 721 | }
|
672 | 722 | },
|
673 | 723 | "type": "object"
|
|
786 | 836 | "description": "Object represents a network route.",
|
787 | 837 | "properties": {
|
788 | 838 | "nexthop": {
|
789 |
| - "$ref": "#/components/schemas/IPv4" |
| 839 | + "$ref": "#/components/schemas/IP" |
790 | 840 | },
|
791 | 841 | "prefix": {
|
792 | 842 | "$ref": "#/components/schemas/CIDR"
|
|
849 | 899 | "properties": {
|
850 | 900 | "defaultNameservers": {
|
851 | 901 | "items": {
|
852 |
| - "$ref": "#/components/schemas/IPv4" |
| 902 | + "$ref": "#/components/schemas/IP" |
853 | 903 | },
|
854 | 904 | "maxItems": 3,
|
855 | 905 | "type": "array"
|
|
871 | 921 | "minProperties": 1,
|
872 | 922 | "properties": {
|
873 | 923 | "ipv4": {
|
874 |
| - "$ref": "#/components/schemas/UpdateNetworkIPv4" |
| 924 | + "$ref": "#/components/schemas/UpdateNetworkIPv4Body" |
875 | 925 | },
|
876 | 926 | "ipv6": {
|
877 |
| - "$ref": "#/components/schemas/v1UpdateNetworkIPv6" |
| 927 | + "$ref": "#/components/schemas/UpdateNetworkIPv6Body" |
878 | 928 | }
|
879 | 929 | },
|
880 | 930 | "type": "object"
|
881 | 931 | },
|
882 |
| - "UpdateNetworkIPv4": { |
| 932 | + "UpdateNetworkIPv4Body": { |
883 | 933 | "description": "The config object for a IPv4 network update.",
|
884 | 934 | "properties": {
|
| 935 | + "gateway": { |
| 936 | + "$ref": "#/components/schemas/v1NetworkGateway" |
| 937 | + }, |
885 | 938 | "nameservers": {
|
886 | 939 | "$ref": "#/components/schemas/Nameserver"
|
887 | 940 | }
|
888 | 941 | },
|
889 | 942 | "type": "object"
|
890 | 943 | },
|
891 |
| - "v1CreateNetworkIPv6": { |
892 |
| - "description": "The config object for a IPv6 network.", |
| 944 | + "UpdateNetworkIPv6Body": { |
| 945 | + "description": "The config object for a IPv6 network update.", |
893 | 946 | "properties": {
|
| 947 | + "gateway": { |
| 948 | + "$ref": "#/components/schemas/v1NetworkGateway" |
| 949 | + }, |
894 | 950 | "nameservers": {
|
895 | 951 | "$ref": "#/components/schemas/Nameserverv6"
|
896 |
| - }, |
897 |
| - "prefixLength": { |
898 |
| - "default": 64, |
899 |
| - "example": 64, |
900 |
| - "maximum": 128, |
901 |
| - "minimum": 56, |
902 |
| - "type": "integer" |
903 | 952 | }
|
904 | 953 | },
|
905 | 954 | "type": "object"
|
906 | 955 | },
|
907 |
| - "v1UpdateNetworkIPv6": { |
908 |
| - "description": "The config object for a IPv6 network update.", |
909 |
| - "properties": { |
910 |
| - "nameservers": { |
911 |
| - "$ref": "#/components/schemas/Nameserverv6" |
| 956 | + "v1NetworkGateway": { |
| 957 | + "allOf": [ |
| 958 | + { |
| 959 | + "$ref": "#/components/schemas/IP" |
912 | 960 | }
|
913 |
| - }, |
914 |
| - "type": "object" |
| 961 | + ], |
| 962 | + "description": "The gateway of a network. If not specified the first ip of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.", |
| 963 | + "nullable": true |
| 964 | + }, |
| 965 | + "v1Routed": { |
| 966 | + "default": true, |
| 967 | + "description": "Shows if the network is routed and therefore accessible from other networks.", |
| 968 | + "example": true, |
| 969 | + "type": "boolean" |
915 | 970 | }
|
916 | 971 | }
|
917 | 972 | },
|
|
1069 | 1124 | "$ref": "#/components/responses/NotFound"
|
1070 | 1125 | },
|
1071 | 1126 | "409": {
|
1072 |
| - "content": { |
1073 |
| - "application/json": { |
1074 |
| - "example": { |
1075 |
| - "code": 409, |
1076 |
| - "msg": "Areas must no longer be referenced by any project to be deleted" |
1077 |
| - }, |
1078 |
| - "schema": { |
1079 |
| - "$ref": "#/components/schemas/Error" |
1080 |
| - } |
1081 |
| - } |
1082 |
| - }, |
1083 |
| - "description": "Tried to delete an area that was still in use by a project." |
| 1127 | + "$ref": "#/components/responses/Conflict" |
1084 | 1128 | },
|
1085 | 1129 | "500": {
|
1086 | 1130 | "$ref": "#/components/responses/InternalServerError"
|
|
1287 | 1331 | "$ref": "#/components/responses/NotFound"
|
1288 | 1332 | },
|
1289 | 1333 | "409": {
|
1290 |
| - "content": { |
1291 |
| - "application/json": { |
1292 |
| - "example": { |
1293 |
| - "code": 409, |
1294 |
| - "msg": "Network ranges must not overlap with other network ranges or transfer networks" |
1295 |
| - }, |
1296 |
| - "schema": { |
1297 |
| - "$ref": "#/components/schemas/Error" |
1298 |
| - } |
1299 |
| - } |
1300 |
| - }, |
1301 |
| - "description": "Tried to add a network range that conflicts with an existing network range or transfer range." |
| 1334 | + "$ref": "#/components/responses/Conflict" |
1302 | 1335 | },
|
1303 | 1336 | "500": {
|
1304 | 1337 | "$ref": "#/components/responses/InternalServerError"
|
|
1339 | 1372 | "$ref": "#/components/responses/NotFound"
|
1340 | 1373 | },
|
1341 | 1374 | "409": {
|
1342 |
| - "content": { |
1343 |
| - "application/json": { |
1344 |
| - "example": { |
1345 |
| - "code": 409, |
1346 |
| - "msg": "Network ranges must no longer be used to be deleted" |
1347 |
| - }, |
1348 |
| - "schema": { |
1349 |
| - "$ref": "#/components/schemas/Error" |
1350 |
| - } |
1351 |
| - } |
1352 |
| - }, |
1353 |
| - "description": "Tried to delete a network range that is still in use." |
| 1375 | + "$ref": "#/components/responses/Conflict" |
1354 | 1376 | },
|
1355 | 1377 | "500": {
|
1356 | 1378 | "$ref": "#/components/responses/InternalServerError"
|
|
1539 | 1561 | "$ref": "#/components/responses/NotFound"
|
1540 | 1562 | },
|
1541 | 1563 | "409": {
|
1542 |
| - "content": { |
1543 |
| - "application/json": { |
1544 |
| - "example": { |
1545 |
| - "code": 409, |
1546 |
| - "msg": "routes must not overlap with other network ranges or transfer networks" |
1547 |
| - }, |
1548 |
| - "schema": { |
1549 |
| - "$ref": "#/components/schemas/Error" |
1550 |
| - } |
1551 |
| - } |
1552 |
| - }, |
1553 |
| - "description": "Tried to add a route that conflicts with an existing network range or transfer range." |
| 1564 | + "$ref": "#/components/responses/Conflict" |
1554 | 1565 | },
|
1555 | 1566 | "500": {
|
1556 | 1567 | "$ref": "#/components/responses/InternalServerError"
|
|
1774 | 1785 | "$ref": "#/components/responses/NotFound"
|
1775 | 1786 | },
|
1776 | 1787 | "409": {
|
1777 |
| - "content": { |
1778 |
| - "application/json": { |
1779 |
| - "example": { |
1780 |
| - "code": 409, |
1781 |
| - "msg": "Can not allocate prefixes for network. Ensure the area has sufficient space in the configured network ranges" |
1782 |
| - }, |
1783 |
| - "schema": { |
1784 |
| - "$ref": "#/components/schemas/Error" |
1785 |
| - } |
1786 |
| - } |
1787 |
| - }, |
1788 |
| - "description": "Can not allocate prefixes for network." |
| 1788 | + "$ref": "#/components/responses/Conflict" |
1789 | 1789 | },
|
1790 | 1790 | "500": {
|
1791 | 1791 | "$ref": "#/components/responses/InternalServerError"
|
|
1823 | 1823 | "$ref": "#/components/responses/NotFound"
|
1824 | 1824 | },
|
1825 | 1825 | "409": {
|
1826 |
| - "content": { |
1827 |
| - "application/json": { |
1828 |
| - "example": { |
1829 |
| - "code": 409, |
1830 |
| - "msg": "Can not delete network. It is still has systems connected to it." |
1831 |
| - }, |
1832 |
| - "schema": { |
1833 |
| - "$ref": "#/components/schemas/Error" |
1834 |
| - } |
1835 |
| - } |
1836 |
| - }, |
1837 |
| - "description": "Can not delete network that is still in use." |
| 1826 | + "$ref": "#/components/responses/Conflict" |
1838 | 1827 | },
|
1839 | 1828 | "500": {
|
1840 | 1829 | "$ref": "#/components/responses/InternalServerError"
|
|
0 commit comments