[ { "type": "post", "url": "/containers", "title": "Create a container", "version": "0.8.0", "name": "CreateContainer", "group": "Container", "description": "
Creates a container. Returns 201 on success!
", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Api-Token", "description": "API token (from /etc/wf_node_api.conf)
" } ] } }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String
", "optional": false, "field": "name", "description": "Name of the container (must be unique per node)
" }, { "group": "Parameter", "type": "String
", "optional": false, "field": "ip_address", "description": "Valid IPv4 address
" }, { "group": "Parameter", "type": "Integer
", "optional": false, "field": "disk_size_gb", "description": "Container disk size in GB
" }, { "group": "Parameter", "type": "Integer
", "optional": false, "field": "memory_limit_mb", "description": "Memory limt in MB
" }, { "group": "Parameter", "type": "Integer
", "optional": false, "field": "cpu_core_count", "description": "Amount of Vcores assigned to the container
" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String
", "optional": false, "field": "success", "description": "Success message
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "output", "description": "STDOUT from container creation
" } ] } }, "filename": "lib/wf_node_api/api/node_api.rb", "groupTitle": "Container", "error": { "fields": { "Unauthorized 401": [ { "group": "Unauthorized 401", "optional": false, "field": "error", "description": "No valid API token was supplied
" } ], "Bad Request 400": [ { "group": "Bad Request 400", "optional": false, "field": "error", "description": "Invalid arguments supplied
" } ], "Internal Server Error 500": [ { "group": "Internal Server Error 500", "optional": false, "field": "error", "description": "The process could not be requested due to an internal error
" } ] }, "examples": [ { "title": "401 Unauthorized", "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}", "type": "json" }, { "title": "400 Bad Request", "content": "HTTP/1.1 400 Bad Request\n{\n \"error\": \"The supplied container name is invalid\"\n}", "type": "json" }, { "title": "500 Internal Server Error", "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}", "type": "json" } ] } }, { "type": "delete", "url": "/containers/:name", "title": "Delete a container", "version": "0.8.0", "name": "DeleteContainer", "group": "Container", "description": "Deletes a container if it exists.
", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Api-Token", "description": "API token (from /etc/wf_node_api.conf)
" } ] } }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String
", "optional": false, "field": "name", "description": "Unique name of the container
" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String
", "optional": false, "field": "success", "description": "Success message
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "output", "description": "STDOUT from container deletion
" } ] } }, "filename": "lib/wf_node_api/api/node_api.rb", "groupTitle": "Container", "error": { "fields": { "Unauthorized 401": [ { "group": "Unauthorized 401", "optional": false, "field": "error", "description": "No valid API token was supplied
" } ], "Not Found 404": [ { "group": "Not Found 404", "optional": false, "field": "error", "description": "Object was not found
" } ], "Internal Server Error 500": [ { "group": "Internal Server Error 500", "optional": false, "field": "error", "description": "The process could not be requested due to an internal error
" } ] }, "examples": [ { "title": "401 Unauthorized", "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}", "type": "json" }, { "title": "404 Not Found", "content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"Not Found\"\n}", "type": "json" }, { "title": "500 Internal Server Error", "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}", "type": "json" } ] } }, { "type": "get", "url": "/containers/:name", "title": "Request container by its name", "version": "0.8.0", "name": "GetContainer", "group": "Container", "description": "Returns information on a specific container
", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Api-Token", "description": "API token (from /etc/wf_node_api.conf)
" } ] } }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String
", "optional": false, "field": "name", "description": "Unique name of the container
" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String
", "optional": false, "field": "name", "description": "Name of the container
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "state", "description": "State of the container (either 'RUNNING' or 'STOPPED')
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "ip_address", "description": "IP address assigned to the container
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "cpu_cores", "description": "Number of Vcores
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "memory_limit_bytes", "description": "Memory limit in bytes
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "memory_usage_bytes", "description": "Current amount of memory usage in bytes
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "disk_space_gb", "description": "Available disk space in GB
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "disk_usage_gb", "description": "Current amount of disk usage in GB
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "container_type", "description": "Container type, could be either 'lxc' or 'vserver'
" } ] } }, "filename": "lib/wf_node_api/api/node_api.rb", "groupTitle": "Container", "error": { "fields": { "Unauthorized 401": [ { "group": "Unauthorized 401", "optional": false, "field": "error", "description": "No valid API token was supplied
" } ], "Internal Server Error 500": [ { "group": "Internal Server Error 500", "optional": false, "field": "error", "description": "The process could not be requested due to an internal error
" } ], "Not Found 404": [ { "group": "Not Found 404", "optional": false, "field": "error", "description": "Object was not found
" } ] }, "examples": [ { "title": "401 Unauthorized", "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}", "type": "json" }, { "title": "500 Internal Server Error", "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}", "type": "json" }, { "title": "404 Not Found", "content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"Not Found\"\n}", "type": "json" } ] } }, { "type": "get", "url": "/containers", "title": "Request container list", "version": "0.8.0", "name": "GetContainers", "group": "Container", "description": "Returns an array of containers which are available on the node.
", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Api-Token", "description": "API token (from /etc/wf_node_api.conf)
" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object[]
", "optional": false, "field": "containers", "description": "List of available containers
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "containers.name", "description": "Name of the container
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "containers.state", "description": "State of the container (either 'RUNNING' or 'STOPPED')
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "containers.ip_address", "description": "IP address assigned to the container
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "containers.cpu_cores", "description": "Number of Vcores
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "containers.memory_limit_bytes", "description": "Memory limit in bytes
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "containers.memory_usage_bytes", "description": "Current amount of memory usage in bytes
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "containers.disk_space_gb", "description": "Available disk space in GB
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "containers.disk_usage_gb", "description": "Current amount of disk usage in GB
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "containers.container_type", "description": "Container type, could be either 'lxc' or 'vserver'
" } ] } }, "filename": "lib/wf_node_api/api/node_api.rb", "groupTitle": "Container", "error": { "fields": { "Unauthorized 401": [ { "group": "Unauthorized 401", "optional": false, "field": "error", "description": "No valid API token was supplied
" } ], "Internal Server Error 500": [ { "group": "Internal Server Error 500", "optional": false, "field": "error", "description": "The process could not be requested due to an internal error
" } ] }, "examples": [ { "title": "401 Unauthorized", "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}", "type": "json" }, { "title": "500 Internal Server Error", "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}", "type": "json" } ] } }, { "type": "put", "url": "/containers/:name/kill", "title": "Kill a container", "version": "0.8.0", "name": "KillContainer", "group": "Container", "description": "Kills a container if it exists. Does essentially the same as StopContainer but forces the container to shut down and does not care about processes running on it.
", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Api-Token", "description": "API token (from /etc/wf_node_api.conf)
" } ] } }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String
", "optional": false, "field": "name", "description": "Unique name of the container
" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String
", "optional": false, "field": "success", "description": "Success message
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "output", "description": "STDOUT from container kill
" } ] } }, "filename": "lib/wf_node_api/api/node_api.rb", "groupTitle": "Container", "error": { "fields": { "Unauthorized 401": [ { "group": "Unauthorized 401", "optional": false, "field": "error", "description": "No valid API token was supplied
" } ], "Not Found 404": [ { "group": "Not Found 404", "optional": false, "field": "error", "description": "Object was not found
" } ], "Internal Server Error 500": [ { "group": "Internal Server Error 500", "optional": false, "field": "error", "description": "The process could not be requested due to an internal error
" } ] }, "examples": [ { "title": "401 Unauthorized", "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}", "type": "json" }, { "title": "404 Not Found", "content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"Not Found\"\n}", "type": "json" }, { "title": "500 Internal Server Error", "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}", "type": "json" } ] } }, { "type": "put", "url": "/containers/:name/start", "title": "Start a container", "version": "0.8.0", "name": "StartContainer", "group": "Container", "description": "Starts a container if it exists
", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Api-Token", "description": "API token (from /etc/wf_node_api.conf)
" } ] } }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String
", "optional": false, "field": "name", "description": "Unique name of the container
" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String
", "optional": false, "field": "success", "description": "Success message
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "output", "description": "STDOUT from container start
" } ] } }, "filename": "lib/wf_node_api/api/node_api.rb", "groupTitle": "Container", "error": { "fields": { "Unauthorized 401": [ { "group": "Unauthorized 401", "optional": false, "field": "error", "description": "No valid API token was supplied
" } ], "Not Found 404": [ { "group": "Not Found 404", "optional": false, "field": "error", "description": "Object was not found
" } ], "Internal Server Error 500": [ { "group": "Internal Server Error 500", "optional": false, "field": "error", "description": "The process could not be requested due to an internal error
" } ] }, "examples": [ { "title": "401 Unauthorized", "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}", "type": "json" }, { "title": "404 Not Found", "content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"Not Found\"\n}", "type": "json" }, { "title": "500 Internal Server Error", "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}", "type": "json" } ] } }, { "type": "put", "url": "/containers/:name/stop", "title": "Stop a container", "version": "0.8.0", "name": "StopContainer", "group": "Container", "description": "Stops a container if it exists
", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Api-Token", "description": "API token (from /etc/wf_node_api.conf)
" } ] } }, "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String
", "optional": false, "field": "name", "description": "Unique name of the container
" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String
", "optional": false, "field": "success", "description": "Success message
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "output", "description": "STDOUT from container stop
" } ] } }, "filename": "lib/wf_node_api/api/node_api.rb", "groupTitle": "Container", "error": { "fields": { "Unauthorized 401": [ { "group": "Unauthorized 401", "optional": false, "field": "error", "description": "No valid API token was supplied
" } ], "Not Found 404": [ { "group": "Not Found 404", "optional": false, "field": "error", "description": "Object was not found
" } ], "Internal Server Error 500": [ { "group": "Internal Server Error 500", "optional": false, "field": "error", "description": "The process could not be requested due to an internal error
" } ] }, "examples": [ { "title": "401 Unauthorized", "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}", "type": "json" }, { "title": "404 Not Found", "content": "HTTP/1.1 404 Not Found\n{\n \"error\": \"Not Found\"\n}", "type": "json" }, { "title": "500 Internal Server Error", "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}", "type": "json" } ] } }, { "type": "get", "url": "/info", "title": "Request node information", "version": "0.8.0", "name": "NodeInfo", "group": "Node", "description": "Returns an array containing useful information about the node itself and the resources available on it.
", "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "X-Api-Token", "description": "API token (from /etc/wf_node_api.conf)
" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String
", "optional": false, "field": "container_type", "description": "The configured container type (lxc or vserver)
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "hostname", "description": "The hostname of the system
" }, { "group": "Success 200", "type": "String
", "optional": false, "field": "api_version", "description": "The version number of the node api
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "total_cpu_cores", "description": "The number of cpu cores available totally
" }, { "group": "Success 200", "type": "Integer
", "optional": false, "field": "free_cpu_cores", "description": "The number of free cpu cores
" } ] } }, "filename": "lib/wf_node_api/api/node_api.rb", "groupTitle": "Node", "error": { "fields": { "Unauthorized 401": [ { "group": "Unauthorized 401", "optional": false, "field": "error", "description": "No valid API token was supplied
" } ], "Internal Server Error 500": [ { "group": "Internal Server Error 500", "optional": false, "field": "error", "description": "The process could not be requested due to an internal error
" } ] }, "examples": [ { "title": "401 Unauthorized", "content": "HTTP/1.1 401 Unauthorized\n{\n \"error\": \"Unauthorized\"\n}", "type": "json" }, { "title": "500 Internal Server Error", "content": "HTTP/1.1 500 Internal Server Error\n{\n \"error\": \"Unknown error occured\"\n}", "type": "json" } ] } } ]