{"info":{"_postman_id":"26745a5a-36d2-492b-9196-43407c324554","name":"Node Statistics","description":"<html><head></head><body><p>The base url for this project can always be changed but on this collection, it is localhost:4455/api/v1</p>\n<h3 id=\"getting-started\">Getting Started</h3>\n<p>To access this API, you need to be a registered user. This is because every call made to the API is expected to have a valid bearer token sent to the API via the header.</p>\n<p>To get started, you will have to create a user using the <code>/auth/register</code> endpoint. After registering the user, you are to log in with the user's credentials via <code>/auth/login</code>. The login endpoint should return a token which can be used to access the other API endpoints.</p>\n<p>Note:</p>\n<p>For ease of use, I have written a little Postman test script that will automatically copy the token and assign it to the <strong>Authorization</strong> parameter on each request that will be made on Postman.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"2811984","collectionId":"26745a5a-36d2-492b-9196-43407c324554","publishedId":"UzBnsSca","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"127ACA"},"publishDate":"2022-06-22T01:13:28.000Z"},"item":[{"name":"Register","event":[{"listen":"test","script":{"id":"66b10ab7-6577-4640-b9d7-7d0542f9afbf","exec":["if (pm.response.json().status == \"success\") {","    pm.collectionVariables.set(\"token\", pm.response.json().data.token);","}",""],"type":"text/javascript"}}],"id":"44dbee6e-4ffa-4d95-8539-4454b46f4227","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"Henry Ford\",\n    \"email\": \"henry@example.com\",\n    \"password\": \"password\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/auth/register","description":"<p>The register endpoint is used to create a user that will be granted access to the API.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Data Type</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n</tr>\n<tr>\n<td><code>email</code></td>\n<td>string</td>\n</tr>\n<tr>\n<td><code>password</code></td>\n<td>string</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["auth","register"],"host":["localhost:8085/api/v1"],"query":[],"variable":[]}},"response":[{"id":"47439aab-8cff-4422-a5ae-2c02927b227c","name":"200 OK","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"Henry Ford\",\n    \"email\": \"henry@example.com\",\n    \"password\": \"password\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/auth/register"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Wed, 22 Jun 2022 03:33:08 GMT"},{"key":"Date","value":"Wed, 22 Jun 2022 03:33:08 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"User registered successfully\",\n    \"data\": {\n        \"name\": \"Henry Ford\",\n        \"email\": \"henry@example.com\",\n        \"created_at\": \"2022-06-22T03:33:08.000000Z\",\n        \"id\": 5\n    }\n}"},{"id":"1a9d9e68-6e04-4ed4-994e-b6f26d891901","name":"422 Unprocessable Content","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"test@example.com\",\n    \"password\": \"password\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/auth/register"},"status":"Unprocessable Content","code":422,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Wed, 22 Jun 2022 03:31:03 GMT"},{"key":"Date","value":"Wed, 22 Jun 2022 03:31:03 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"Validation error\",\n    \"errors\": {\n        \"name\": \"The name field is required.\"\n    }\n}"}],"_postman_id":"44dbee6e-4ffa-4d95-8539-4454b46f4227"},{"name":"Login","event":[{"listen":"test","script":{"id":"66b10ab7-6577-4640-b9d7-7d0542f9afbf","exec":["if (pm.response.json().status == \"success\") {","    pm.collectionVariables.set(\"token\", pm.response.json().data.token);","}",""],"type":"text/javascript"}}],"id":"85a8acf9-3f12-4c24-a6ed-16cfe82a703f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"test@example.com\",\n    \"password\": \"password\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/auth/login","description":"<p>This endpoint is used to authenticate users of the API. A user is expected to generate a JWT token that will be used for subsequent interactions with the API.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Data Type</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>email</code></td>\n<td>string</td>\n</tr>\n<tr>\n<td><code>password</code></td>\n<td>string</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["auth","login"],"host":["localhost:8085/api/v1"],"query":[],"variable":[]}},"response":[{"id":"b97d761c-4f07-4f04-92f8-6c8fbce64445","name":"200 OK","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"test@example.com\",\n    \"password\": \"password\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/auth/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Wed, 22 Jun 2022 03:17:49 GMT"},{"key":"Date","value":"Wed, 22 Jun 2022 03:17:49 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"Authenticated successfully\",\n    \"data\": {\n        \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjQ0NTUvYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE2NTU4Njc4NjksImV4cCI6MTY1NTg3MTQ2OSwibmJmIjoxNjU1ODY3ODY5LCJqdGkiOiJEQzluZFdQTnhnd1ppNlVjIiwic3ViIjoiMSIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.kDCc6SBQb4_vnDt0yxpiZA_DBr-OWaRblz27-Yz3TSQ\",\n        \"token_type\": \"bearer\",\n        \"expires_in\": 3600,\n        \"user\": {\n            \"id\": 1,\n            \"name\": \"Test User\",\n            \"email\": \"test@example.com\",\n            \"created_at\": \"2022-06-22T03:01:34.000000Z\"\n        }\n    }\n}"},{"id":"12f60e8f-e107-4607-98ca-25c8630549e8","name":"403 Forbidden","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"wrongemail@example.com\",\n    \"password\": \"password\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/auth/login"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Wed, 22 Jun 2022 03:23:46 GMT"},{"key":"Date","value":"Wed, 22 Jun 2022 03:23:46 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"Invalid email or password.\"\n}"}],"_postman_id":"85a8acf9-3f12-4c24-a6ed-16cfe82a703f"},{"name":"Create Node","id":"b0033f6e-d29a-48d2-aa84-3bd93b090453","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"system_uptime\": \"2022-06-20 10:30:00\",\n    \"total_ram\": 33637474,\n    \"allocated_ram\": 183370393,\n    \"total_disk\": 83372625,\n    \"allocated_disk\": 34495729\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/nodes","description":"<p>This endpoint is used to create a new node in the database</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Data Type</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>system_uptime</code></td>\n<td>datestamp</td>\n</tr>\n<tr>\n<td><code>total_ram</code></td>\n<td>integer</td>\n</tr>\n<tr>\n<td><code>allocated_ram</code></td>\n<td>integer</td>\n</tr>\n<tr>\n<td><code>total_disk</code></td>\n<td>integer</td>\n</tr>\n<tr>\n<td><code>allocated_disk</code></td>\n<td>integer</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["nodes"],"host":["localhost:8085/api/v1"],"query":[],"variable":[]}},"response":[{"id":"61f51d6f-464c-4c3b-a6d1-47bef89fa253","name":"201 Created","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"system_uptime\": \"2022-06-20 10:30:00\",\n    \"total_ram\": 33637474,\n    \"allocated_ram\": 183370393,\n    \"total_disk\": 83372625,\n    \"allocated_disk\": 34495729\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/nodes"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Tue, 21 Jun 2022 02:40:00 GMT"},{"key":"Date","value":"Tue, 21 Jun 2022 02:40:00 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"Node created successfully\",\n    \"data\": {\n        \"system_uptime\": \"2022-06-20T10:30:00.000000Z\",\n        \"total_ram\": 33637474,\n        \"allocated_ram\": 183370393,\n        \"total_disk\": 83372625,\n        \"allocated_disk\": 34495729,\n        \"created_at\": \"2022-06-21T02:40:00.000000Z\",\n        \"id\": 15\n    }\n}"},{"id":"893d5346-0870-4800-8e34-3bf6ecae68cb","name":"422 Unprocessable Content","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"system_uptime\": \"2022-06-20 10:30:00\",\n    \"total_ram\": 33637474,\n    \"allocated_ram\": \"183370393zz\",\n    \"total_disk\": \"83372625zzzz\",\n    \"allocated_disk\": 34495729\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/nodes"},"status":"Unprocessable Content","code":422,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Mon, 20 Jun 2022 15:50:42 GMT"},{"key":"Date","value":"Mon, 20 Jun 2022 15:50:42 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"Validation error\",\n    \"errors\": {\n        \"allocated_ram\": \"The allocated ram must be an integer.\",\n        \"total_disk\": \"The total disk must be an integer.\"\n    }\n}"}],"_postman_id":"b0033f6e-d29a-48d2-aa84-3bd93b090453"},{"name":"All Nodes","id":"9cdf9bfe-ad15-4d53-bff9-df79183f2214","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"localhost:8085/api/v1/nodes","description":"<p>This endpoint returns a paginated response of all nodes. If the query parameter <code>per_page</code> is passed in the request, it returns the number of items passed in the request per page. If <code>per_page</code> is not provided in the request, by default the endpoint will return 15 records.</p>\n","urlObject":{"path":["nodes"],"host":["localhost:8085/api/v1"],"query":[{"disabled":true,"description":{"content":"<p>Number of items to be displayed per page</p>\n","type":"text/plain"},"key":"per_page","value":"2"}],"variable":[]}},"response":[{"id":"67f11456-9aa2-4e75-b738-c593336cfa0a","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":{"raw":"localhost:8085/api/v1/nodes","host":["localhost:8085/api/v1"],"path":["nodes"],"query":[{"key":"per_page","value":"2","description":"Number of nodes to be displayed per page","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Tue, 21 Jun 2022 02:44:31 GMT"},{"key":"Date","value":"Tue, 21 Jun 2022 02:44:31 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"Nodes fetched successfully\",\n    \"data\": {\n        \"current_page\": 1,\n        \"data\": [\n            {\n                \"id\": 1,\n                \"system_uptime\": \"2022-06-20T15:04:02.000000Z\",\n                \"total_ram\": 4209642,\n                \"allocated_ram\": 91732683,\n                \"total_disk\": 23061686,\n                \"allocated_disk\": 94490888,\n                \"created_at\": \"2022-06-20T15:04:02.000000Z\"\n            },\n            {\n                \"id\": 2,\n                \"system_uptime\": \"2022-06-21T02:25:33.000000Z\",\n                \"total_ram\": 64336286,\n                \"allocated_ram\": 95031648,\n                \"total_disk\": 96065552,\n                \"allocated_disk\": 65432109,\n                \"created_at\": \"2022-06-20T15:04:02.000000Z\"\n            },\n            {\n                \"id\": 3,\n                \"system_uptime\": \"2022-06-20T15:04:02.000000Z\",\n                \"total_ram\": 98490930,\n                \"allocated_ram\": 5899919,\n                \"total_disk\": 25699068,\n                \"allocated_disk\": 91891237,\n                \"created_at\": \"2022-06-20T15:04:02.000000Z\"\n            },\n            {\n                \"id\": 4,\n                \"system_uptime\": \"2022-06-20T15:04:02.000000Z\",\n                \"total_ram\": 3765645,\n                \"allocated_ram\": 4684029,\n                \"total_disk\": 99336313,\n                \"allocated_disk\": 15094165,\n                \"created_at\": \"2022-06-20T15:04:02.000000Z\"\n            },\n            {\n                \"id\": 5,\n                \"system_uptime\": \"2022-06-20T15:04:02.000000Z\",\n                \"total_ram\": 19562944,\n                \"allocated_ram\": 36508726,\n                \"total_disk\": 97041686,\n                \"allocated_disk\": 38508142,\n                \"created_at\": \"2022-06-20T15:04:02.000000Z\"\n            },\n            {\n                \"id\": 7,\n                \"system_uptime\": \"2022-06-20T15:04:02.000000Z\",\n                \"total_ram\": 32586579,\n                \"allocated_ram\": 47941438,\n                \"total_disk\": 20464134,\n                \"allocated_disk\": 24806993,\n                \"created_at\": \"2022-06-20T15:04:02.000000Z\"\n            },\n            {\n                \"id\": 8,\n                \"system_uptime\": \"2022-06-20T15:04:02.000000Z\",\n                \"total_ram\": 14185702,\n                \"allocated_ram\": 98193188,\n                \"total_disk\": 37627135,\n                \"allocated_disk\": 12244467,\n                \"created_at\": \"2022-06-20T15:04:02.000000Z\"\n            },\n            {\n                \"id\": 9,\n                \"system_uptime\": \"2022-06-20T15:04:02.000000Z\",\n                \"total_ram\": 78484946,\n                \"allocated_ram\": 43897439,\n                \"total_disk\": 51084728,\n                \"allocated_disk\": 64592890,\n                \"created_at\": \"2022-06-20T15:04:02.000000Z\"\n            },\n            {\n                \"id\": 10,\n                \"system_uptime\": \"2022-06-20T15:04:02.000000Z\",\n                \"total_ram\": 82337886,\n                \"allocated_ram\": 37240642,\n                \"total_disk\": 53486308,\n                \"allocated_disk\": 87717936,\n                \"created_at\": \"2022-06-20T15:04:02.000000Z\"\n            },\n            {\n                \"id\": 11,\n                \"system_uptime\": \"2022-06-20T10:30:00.000000Z\",\n                \"total_ram\": 33637474,\n                \"allocated_ram\": 183370393,\n                \"total_disk\": 83372625,\n                \"allocated_disk\": 34495729,\n                \"created_at\": \"2022-06-20T15:36:23.000000Z\"\n            },\n            {\n                \"id\": 12,\n                \"system_uptime\": \"2022-06-20T10:30:00.000000Z\",\n                \"total_ram\": 33637474,\n                \"allocated_ram\": 183370393,\n                \"total_disk\": 83372625,\n                \"allocated_disk\": 34495729,\n                \"created_at\": \"2022-06-20T15:36:47.000000Z\"\n            },\n            {\n                \"id\": 13,\n                \"system_uptime\": \"2022-06-20T10:30:00.000000Z\",\n                \"total_ram\": 33637474,\n                \"allocated_ram\": 183370393,\n                \"total_disk\": 83372625,\n                \"allocated_disk\": 34495729,\n                \"created_at\": \"2022-06-20T15:49:59.000000Z\"\n            },\n            {\n                \"id\": 14,\n                \"system_uptime\": \"2022-06-20T10:30:00.000000Z\",\n                \"total_ram\": 33637474,\n                \"allocated_ram\": 183370393,\n                \"total_disk\": 83372625,\n                \"allocated_disk\": 34495729,\n                \"created_at\": \"2022-06-21T02:18:39.000000Z\"\n            },\n            {\n                \"id\": 15,\n                \"system_uptime\": \"2022-06-20T10:30:00.000000Z\",\n                \"total_ram\": 33637474,\n                \"allocated_ram\": 183370393,\n                \"total_disk\": 83372625,\n                \"allocated_disk\": 34495729,\n                \"created_at\": \"2022-06-21T02:40:00.000000Z\"\n            }\n        ],\n        \"first_page_url\": \"http://localhost:4455/api/v1/nodes?page=1\",\n        \"from\": 1,\n        \"last_page\": 1,\n        \"last_page_url\": \"http://localhost:4455/api/v1/nodes?page=1\",\n        \"links\": [\n            {\n                \"url\": null,\n                \"label\": \"pagination.previous\",\n                \"active\": false\n            },\n            {\n                \"url\": \"http://localhost:4455/api/v1/nodes?page=1\",\n                \"label\": \"1\",\n                \"active\": true\n            },\n            {\n                \"url\": null,\n                \"label\": \"pagination.next\",\n                \"active\": false\n            }\n        ],\n        \"next_page_url\": null,\n        \"path\": \"http://localhost:4455/api/v1/nodes\",\n        \"per_page\": 15,\n        \"prev_page_url\": null,\n        \"to\": 14,\n        \"total\": 14\n    }\n}"}],"_postman_id":"9cdf9bfe-ad15-4d53-bff9-df79183f2214"},{"name":"Find a single Node","id":"fc4e1c4a-3270-42e9-9fb2-20c2813f73c2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"localhost:8085/api/v1/nodes/12","description":"<p>This endpoint returns a single node when you provide the ID of the node. If an ID that does not exists on the database is provided, the endpoint returns a 404 error.</p>\n","urlObject":{"path":["nodes","12"],"host":["localhost:8085/api/v1"],"query":[],"variable":[]}},"response":[{"id":"2a7f0e48-bf17-48b8-9db2-c6e65235e507","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":"localhost:8085/api/v1/nodes/2"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Tue, 21 Jun 2022 02:18:08 GMT"},{"key":"Date","value":"Tue, 21 Jun 2022 02:18:08 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"Node fetched successfully\",\n    \"data\": {\n        \"id\": 2,\n        \"system_uptime\": \"2022-06-20T15:04:02.000000Z\",\n        \"total_ram\": 64336286,\n        \"allocated_ram\": 95031648,\n        \"total_disk\": 96065552,\n        \"allocated_disk\": 10959560,\n        \"created_at\": \"2022-06-20T15:04:02.000000Z\"\n    }\n}"},{"id":"b30e02d1-33e8-4bca-b995-8a1ad4e2a80b","name":"404 Not Found","originalRequest":{"method":"GET","header":[],"url":"localhost:8085/api/v1/nodes/123456"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Tue, 21 Jun 2022 02:17:44 GMT"},{"key":"Date","value":"Tue, 21 Jun 2022 02:17:44 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"Node not found\"\n}"}],"_postman_id":"fc4e1c4a-3270-42e9-9fb2-20c2813f73c2"},{"name":"Update a node","id":"a6ef3b92-1afe-4f14-9f98-0a526f848620","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"allocated_disk\": 65432109\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/nodes/12","description":"<p>This endpoint is used to update a node.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Data Type</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>system_uptime</code></td>\n<td>datestamp</td>\n</tr>\n<tr>\n<td><code>total_ram</code></td>\n<td>integer</td>\n</tr>\n<tr>\n<td><code>allocated_ram</code></td>\n<td>integer</td>\n</tr>\n<tr>\n<td><code>total_disk</code></td>\n<td>integer</td>\n</tr>\n<tr>\n<td><code>allocated_disk</code></td>\n<td>integer</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["nodes","12"],"host":["localhost:8085/api/v1"],"query":[],"variable":[]}},"response":[{"id":"bc7368c7-0749-4ab6-bf4d-4edb3ec2c53f","name":"200 OK","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"allocated_disk\": 65432109\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/nodes/2"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Tue, 21 Jun 2022 02:37:03 GMT"},{"key":"Date","value":"Tue, 21 Jun 2022 02:37:03 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"Updated node successfully\",\n    \"data\": {\n        \"id\": 2,\n        \"system_uptime\": \"2022-06-21T02:25:33.000000Z\",\n        \"total_ram\": 64336286,\n        \"allocated_ram\": 95031648,\n        \"total_disk\": 96065552,\n        \"allocated_disk\": 65432109,\n        \"created_at\": \"2022-06-20T15:04:02.000000Z\"\n    }\n}"},{"id":"c12d4310-14c9-4d5f-966f-0bea052e12df","name":"422 Unprocessable Content","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"system_uptime\": \"testing\",\n    \"total_ram\": \"\",\n    \"allocated_disk\": 65432109\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/nodes/2"},"status":"Unprocessable Content","code":422,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Tue, 21 Jun 2022 02:35:48 GMT"},{"key":"Date","value":"Tue, 21 Jun 2022 02:35:48 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"Validation error\",\n    \"errors\": {\n        \"system_uptime\": \"The system uptime is not a valid date.\",\n        \"total_ram\": \"The total ram field is required.\"\n    }\n}"},{"id":"39c6c116-9506-4f48-9e84-b4a29c05805e","name":"400 Bad Request","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"allocated_disk\": 65432109\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8085/api/v1/nodes/2222222"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Tue, 21 Jun 2022 03:21:42 GMT"},{"key":"Date","value":"Tue, 21 Jun 2022 03:21:42 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"Could not update node\"\n}"}],"_postman_id":"a6ef3b92-1afe-4f14-9f98-0a526f848620"},{"name":"Delete a node","id":"c84034d6-86e2-4645-864d-aae8e43ebb76","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"DELETE","header":[],"url":"localhost:8085/api/v1/nodes/12","description":"<p>This endpoint deletes a record from the database. If an ID that does not exist on the database is provided, it returns a 400 error else it returns a 200 response.</p>\n","urlObject":{"path":["nodes","12"],"host":["localhost:8085/api/v1"],"query":[],"variable":[]}},"response":[{"id":"2388ef27-f8b3-4f9b-aba5-009074310618","name":"200 OK","originalRequest":{"method":"DELETE","header":[],"url":"localhost:8085/api/v1/nodes/7"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Tue, 21 Jun 2022 02:44:22 GMT"},{"key":"Date","value":"Tue, 21 Jun 2022 02:44:22 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": \"Node deleted successfully\"\n}"},{"id":"977360eb-fa0c-49e2-b795-ddca3b8202f8","name":"400 Bad Request","originalRequest":{"method":"DELETE","header":[],"url":"localhost:8085/api/v1/nodes/123456789"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:4455"},{"key":"Date","value":"Tue, 21 Jun 2022 03:29:20 GMT"},{"key":"Date","value":"Tue, 21 Jun 2022 03:29:20 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/8.1.7"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"error\",\n    \"message\": \"Could not delete node\"\n}"}],"_postman_id":"c84034d6-86e2-4645-864d-aae8e43ebb76"}],"event":[{"listen":"prerequest","script":{"id":"091b33fc-a33b-4ae8-9aec-679ad43a8d44","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"81cd9318-2c76-4f04-bd36-f3e8b7359d2e","type":"text/javascript","exec":[""]}}],"variable":[{"key":"BASE_URL","value":"localhost:4455/api/v1","type":"string","disabled":true},{"key":"token","value":"","type":"string"},{"key":"BASE_URL","value":"localhost:8085/api/v1","type":"string"}]}