{"_id":"588f722cbcace50f0052ba3a","category":{"_id":"588f722bbcace50f0052b9e6","__v":0,"project":"565f5fa26bafd40d0030a064","version":"588f722bbcace50f0052b9e1","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-25T18:09:36.891Z","from_sync":false,"order":4,"slug":"dashboard-api","title":"Dashboard API"},"parentDoc":null,"project":"565f5fa26bafd40d0030a064","version":{"_id":"588f722bbcace50f0052b9e1","project":"565f5fa26bafd40d0030a064","__v":1,"createdAt":"2017-01-30T17:04:43.410Z","releaseDate":"2017-01-30T17:04:43.410Z","categories":["588f722bbcace50f0052b9e2","588f722bbcace50f0052b9e3","588f722bbcace50f0052b9e4","588f722bbcace50f0052b9e5","588f722bbcace50f0052b9e6","588f722bbcace50f0052b9e7"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"5.3.0","version":"5.3.0"},"user":"565f3941ea46251700972783","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-18T23:14:53.876Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","code":"{\n    \"hosts\": [\n        {\n            \"api_id\": 95,\n            \"id\": 87,\n            \"name\": \"localhost\",\n            \"hostname\": \"localhost\"\n        },\n        {\n            \"api_id\": 95,\n            \"id\": 79,\n            \"name\": \"rampant-lip-8122\",\n            \"hostname\": \"rampant-lip-8122.nanoscale.io\"\n        }\n    ]\n}\n","language":"json","status":200}]},"settings":"","examples":{"codes":[{"code":"curl -b cookies.txt -c cookies.txt -X GET \"https://api.nanoscale.io/apis/95/hosts\"","language":"curl"}]},"method":"get","auth":"required","params":[],"url":"/hosts"},"isReference":true,"order":30,"body":"Calling the `/hosts` endpoint will return a collection of the defined `hosts` sorted alphabetically by name in ascending order.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"key\",\n    \"h-1\": \"type\",\n    \"h-2\": \"description\",\n    \"0-0\": \"`hosts`\",\n    \"0-1\": \"`array`\",\n    \"0-2\": \"array of the defined hosts\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\nEach `host` will have the following keys:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"key\",\n    \"h-1\": \"type\",\n    \"h-2\": \"description\",\n    \"0-0\": \"api_id\",\n    \"1-0\": \"id\",\n    \"2-0\": \"name\",\n    \"3-0\": \"hostname\",\n    \"0-1\": \"`number`\",\n    \"1-1\": \"`number`\",\n    \"2-1\": \"`string`\",\n    \"3-1\": \"`string`\",\n    \"0-2\": \"The API identifier.\",\n    \"1-2\": \"The host identifier.\",\n    \"2-2\": \"The name of the host (internally for nanoscale.io).\",\n    \"3-2\": \"The host name or ip address of the server.\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]","excerpt":"","slug":"hosts-1","type":"endpoint","title":"/hosts"}

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format


Documentation

Calling the `/hosts` endpoint will return a collection of the defined `hosts` sorted alphabetically by name in ascending order. [block:parameters] { "data": { "h-0": "key", "h-1": "type", "h-2": "description", "0-0": "`hosts`", "0-1": "`array`", "0-2": "array of the defined hosts" }, "cols": 3, "rows": 1 } [/block] Each `host` will have the following keys: [block:parameters] { "data": { "h-0": "key", "h-1": "type", "h-2": "description", "0-0": "api_id", "1-0": "id", "2-0": "name", "3-0": "hostname", "0-1": "`number`", "1-1": "`number`", "2-1": "`string`", "3-1": "`string`", "0-2": "The API identifier.", "1-2": "The host identifier.", "2-2": "The name of the host (internally for nanoscale.io).", "3-2": "The host name or ip address of the server." }, "cols": 3, "rows": 4 } [/block]