{ "openapi": "3.0.0", "info": { "title": "My API", "version": "1.0" }, "paths": { "/opengnsys3/rest/dhcp/subnet": { "get": { "operationId": "ece42bc4084486aedf42734bdb0b84cb", "responses": { "200": { "description": "Devuelve todas las subredes", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Subnet" } } } } }, "400": { "description": "Error al obtener las subredes" } } }, "post": { "summary": "Add a new DHCP subnet", "operationId": "36e86a6932056e774180d074d3d63ad0", "requestBody": { "description": "JSON payload", "required": true, "content": { "application/json": { "schema": { "properties": { "subnetId": { "type": "integer", "example": 2 }, "mask": { "type": "string", "example": "255.255.255.0" }, "address": { "type": "string", "example": "192.168.1.0" }, "nextServer": { "type": "string", "example": "192.168.1.1" }, "bootFileName": { "type": "string", "example": "pxelinux.0" } }, "type": "object" } } } }, "responses": { "200": { "description": "Subnet added successfully", "content": { "application/json": { "schema": { "properties": { "success": { "type": "string" } }, "type": "object" } } } }, "400": { "description": "Error occurred", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string" } }, "type": "object" } } } } } } }, "/opengnsys3/rest/dhcp/subnet/{subnetId}": { "put": { "summary": "Modify a DHCP subnet", "operationId": "c002afa59d07660be24fda34e1498c13", "parameters": [ { "name": "subnetId", "in": "path", "description": "ID of the subnet to modify", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "description": "Data to modify the subnet", "required": true, "content": { "application/json": { "schema": { "properties": { "mask": { "type": "string" }, "address": { "type": "string" }, "nextServer": { "type": "string" }, "bootFileName": { "type": "string" } }, "type": "object" } } } }, "responses": { "200": { "description": "Subnet modified successfully", "content": { "application/json": { "schema": { "properties": { "success": { "type": "string" } }, "type": "object" } } } }, "400": { "description": "Error occurred", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string" } }, "type": "object" } } } } } }, "delete": { "summary": "Delete a DHCP subnet", "operationId": "299c4287d729ca98c47ef613720051f4", "parameters": [ { "name": "subnetId", "in": "path", "description": "ID of the subnet to delete", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Subnet deleted successfully", "content": { "application/json": { "schema": { "properties": { "success": { "type": "string" } }, "type": "object" } } } }, "400": { "description": "Error occurred", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string" } }, "type": "object" } } } } } } }, "/opengnsys3/rest/dhcp/subnet/{subnetId}/host": { "get": { "summary": "Get all hosts in a subnet", "operationId": "2511366de74accc3d7356814ced1cf50", "parameters": [ { "name": "subnetId", "in": "path", "description": "The ID of the subnet", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "List of hosts in the subnet", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Host" } } } } }, "400": { "description": "Error occurred", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string" } }, "type": "object" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string" } }, "type": "object" } } } } } }, "put": { "summary": "Update a DHCP host", "operationId": "6106fe2802e2f913ddb35df61b5fde35", "parameters": [ { "name": "subnetId", "in": "path", "description": "The ID of the subnet", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "description": "Data for the host to update", "required": true, "content": { "application/json": { "schema": { "properties": { "host": { "type": "string", "example": "pc11" }, "oldMacAddress": { "type": "string", "example": "56:6f:c7:4f:00:4f" }, "oldAddress": { "type": "string", "example": "192.168.1.11" }, "macAddress": { "type": "string", "example": "56:6f:c7:4f:01:01" }, "address": { "type": "string", "example": "192.168.1.11" } }, "type": "object" } } } }, "responses": { "200": { "description": "Host updated successfully", "content": { "application/json": { "schema": { "properties": { "success": { "type": "string" } }, "type": "object" } } } }, "400": { "description": "Error occurred", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string" } }, "type": "object" } } } } } }, "post": { "summary": "Add a DHCP host to a subnet", "operationId": "f5d3e1de64faa4e5b14cdc7d3bd0c427", "parameters": [ { "name": "subnetId", "in": "path", "description": "ID of the subnet to add the host to", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "description": "Data for the new host", "required": true, "content": { "application/json": { "schema": { "properties": { "host": { "type": "string", "example": "pc11" }, "macAddress": { "type": "string", "example": "56:6f:c7:4f:00:4f" }, "address": { "type": "string", "example": "172.30.4.11" } }, "type": "object" } } } }, "responses": { "200": { "description": "Host added successfully", "content": { "application/json": { "schema": { "properties": { "success": { "type": "string" } }, "type": "object" } } } }, "400": { "description": "Error occurred", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string" } }, "type": "object" } } } } } }, "delete": { "summary": "Delete a DHCP host from a specific subnet", "operationId": "542cc5fc093ff121c154504e9cad270f", "parameters": [ { "name": "subnetId", "in": "path", "description": "The ID of the subnet", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "description": "Data for the host to delete", "required": true, "content": { "application/json": { "schema": { "properties": { "host": { "type": "string", "example": "pc11" } }, "type": "object" } } } }, "responses": { "200": { "description": "Host deleted successfully", "content": { "application/json": { "schema": { "properties": { "success": { "type": "string" } }, "type": "object" } } } }, "400": { "description": "Error occurred", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string" } }, "type": "object" } } } } } } } }, "components": { "schemas": { "Subnet": { "properties": { "id": { "description": "The ID of the subnet", "type": "integer" }, "subnet": { "description": "The name of the subnet", "type": "string" }, "next-server": { "description": "The next server in the subnet", "type": "string" }, "boot-file-name": { "description": "The boot file name for the subnet", "type": "string" }, "reservations": { "type": "array", "items": { "description": "The reservations in the subnet", "type": "object" } } }, "type": "object" }, "Host": { "properties": { "host": { "type": "string", "example": "pc11" }, "macAddress": { "type": "string", "example": "56:6f:c7:4f:00:4f" }, "address": { "type": "string", "example": "172.30.4.11" } }, "type": "object" } } } }