{"action":"created","issue":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/2611","labels_url":"https://api.github.com/repos/syncthing/syncthing/issues/2611/labels{/name}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/2611/comments","events_url":"https://api.github.com/repos/syncthing/syncthing/issues/2611/events","html_url":"https://github.com/syncthing/syncthing/issues/2611","id":123273668,"number":2611,"title":"REST API: Improve JSON response for /system/connections","user":{"login":"vlcty","id":5420564,"avatar_url":"https://avatars.githubusercontent.com/u/5420564?v=3","gravatar_id":"","url":"https://api.github.com/users/vlcty","html_url":"https://github.com/vlcty","followers_url":"https://api.github.com/users/vlcty/followers","following_url":"https://api.github.com/users/vlcty/following{/other_user}","gists_url":"https://api.github.com/users/vlcty/gists{/gist_id}","starred_url":"https://api.github.com/users/vlcty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlcty/subscriptions","organizations_url":"https://api.github.com/users/vlcty/orgs","repos_url":"https://api.github.com/users/vlcty/repos","events_url":"https://api.github.com/users/vlcty/events{/privacy}","received_events_url":"https://api.github.com/users/vlcty/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-12-21T12:49:32Z","updated_at":"2015-12-22T20:09:08Z","closed_at":"2015-12-22T08:00:57Z","body":"I'm currently developing a Nagios/Icinga check to monitor syncthing and it's connections. I use the built in REST API of syncthing to gather the needed information.\r\nAccording to the docs under http://docs.syncthing.net/rest/system-connections-get.html a sample response is:\r\n\r\n```json\r\n{\r\n   \"total\" : {\r\n          \"paused\" : false,\r\n          \"clientVersion\" : \"\",\r\n          \"at\" : \"2015-11-07T17:29:47.691637262+01:00\",\r\n          \"connected\" : false,\r\n          \"inBytesTotal\" : 1479,\r\n          \"type\" : \"direct-accept\",\r\n          \"outBytesTotal\" : 1318,\r\n          \"address\" : \"\"\r\n   },\r\n   \"connections\" : {\r\n          \"YZJBJFX-RDBL7WY-6ZGKJ2D-4MJB4E7-ZATSDUY-LD6Y3L3-MLFUYWE-AEMXJAC\" : {\r\n             \"connected\" : true,\r\n             \"inBytesTotal\" : 556,\r\n             \"paused\" : false,\r\n             \"at\" : \"2015-11-07T17:29:47.691548971+01:00\",\r\n             \"clientVersion\" : \"v0.12.1\",\r\n             \"address\" : \"127.0.0.1:22002\",\r\n             \"type\" : \"direct-dial\",\r\n             \"outBytesTotal\" : 550\r\n          },\r\n          \"DOVII4U-SQEEESM-VZ2CVTC-CJM4YN5-QNV7DCU-5U3ASRL-YVFG6TH-W5DV5AA\" : {\r\n             \"outBytesTotal\" : 0,\r\n             \"type\" : \"direct-accept\",\r\n             \"address\" : \"\",\r\n             \"at\" : \"0001-01-01T00:00:00Z\",\r\n             \"clientVersion\" : \"\",\r\n             \"paused\" : false,\r\n             \"inBytesTotal\" : 0,\r\n             \"connected\" : false\r\n          },\r\n          \"UYGDMA4-TPHOFO5-2VQYDCC-7CWX7XW-INZINQT-LE4B42N-4JUZTSM-IWCSXA4\" : {\r\n             \"address\" : \"\",\r\n             \"type\" : \"direct-accept\",\r\n             \"outBytesTotal\" : 0,\r\n             \"connected\" : false,\r\n             \"inBytesTotal\" : 0,\r\n             \"paused\" : false,\r\n             \"at\" : \"0001-01-01T00:00:00Z\",\r\n             \"clientVersion\" : \"\"\r\n          }\r\n   }\r\n}\r\n```\r\n\r\nI would like to see an improvement of the response by using an array containing every connection. For example:\r\n\r\n```json\r\n{\r\n   \"total\" : {\r\n          \"paused\" : false,\r\n          \"clientVersion\" : \"\",\r\n          \"at\" : \"2015-11-07T17:29:47.691637262+01:00\",\r\n          \"connected\" : false,\r\n          \"inBytesTotal\" : 1479,\r\n          \"type\" : \"direct-accept\",\r\n          \"outBytesTotal\" : 1318,\r\n          \"address\" : \"\"\r\n   },\r\n   \"connections\" : [\r\n           {\r\n             \"id\": \"YZJBJFX-RDBL7WY-6ZGKJ2D-4MJB4E7-ZATSDUY-LD6Y3L3-MLFUYWE-AEMXJAC\",\r\n             \"connected\" : true,\r\n             \"inBytesTotal\" : 556,\r\n             \"paused\" : false,\r\n             \"at\" : \"2015-11-07T17:29:47.691548971+01:00\",\r\n             \"clientVersion\" : \"v0.12.1\",\r\n             \"address\" : \"127.0.0.1:22002\",\r\n             \"type\" : \"direct-dial\",\r\n             \"outBytesTotal\" : 550\r\n          },\r\n          {\r\n            \"id\": \"DOVII4U-SQEEESM-VZ2CVTC-CJM4YN5-QNV7DCU-5U3ASRL-YVFG6TH-W5DV5AA\",\r\n             \"outBytesTotal\" : 0,\r\n             \"type\" : \"direct-accept\",\r\n             \"address\" : \"\",\r\n             \"at\" : \"0001-01-01T00:00:00Z\",\r\n             \"clientVersion\" : \"\",\r\n             \"paused\" : false,\r\n             \"inBytesTotal\" : 0,\r\n             \"connected\" : false\r\n          },\r\n          {\r\n             \"id\": \"UYGDMA4-TPHOFO5-2VQYDCC-7CWX7XW-INZINQT-LE4B42N-4JUZTSM-IWCSXA4\",\r\n             \"address\" : \"\",\r\n             \"type\" : \"direct-accept\",\r\n             \"outBytesTotal\" : 0,\r\n             \"connected\" : false,\r\n             \"inBytesTotal\" : 0,\r\n             \"paused\" : false,\r\n             \"at\" : \"0001-01-01T00:00:00Z\",\r\n             \"clientVersion\" : \"\"\r\n          }\r\n   ]\r\n}\r\n```\r\n\r\nThe current response is not a RFC violation."},"comment":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/comments/166717892","html_url":"https://github.com/syncthing/syncthing/issues/2611#issuecomment-166717892","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/2611","id":166717892,"user":{"login":"canton7","id":568104,"avatar_url":"https://avatars.githubusercontent.com/u/568104?v=3","gravatar_id":"","url":"https://api.github.com/users/canton7","html_url":"https://github.com/canton7","followers_url":"https://api.github.com/users/canton7/followers","following_url":"https://api.github.com/users/canton7/following{/other_user}","gists_url":"https://api.github.com/users/canton7/gists{/gist_id}","starred_url":"https://api.github.com/users/canton7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canton7/subscriptions","organizations_url":"https://api.github.com/users/canton7/orgs","repos_url":"https://api.github.com/users/canton7/repos","events_url":"https://api.github.com/users/canton7/events{/privacy}","received_events_url":"https://api.github.com/users/canton7/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T20:09:08Z","updated_at":"2015-12-22T20:09:08Z","body":"Yeah, but it's an unordered collection with a very obvious unique identifier, so a dict is fair game. "}}