diff --git a/docs/frontends/webapi.rst b/docs/frontends/webapi.rst index 1769a05e1..2ee348080 100644 --- a/docs/frontends/webapi.rst +++ b/docs/frontends/webapi.rst @@ -1861,13 +1861,11 @@ of the introducer(s) and storage server(s), here's an example:: }, "servers": [{ "nodeid": "other_nodeid", - "description": { - "available_space": 123456, - "nickname": "George \u263b", - "version": "1.0", - "connection_status": "summary", - "last_received_data": 1487811257 - } + "available_space": 123456, + "nickname": "George \u263b", + "version": "1.0", + "connection_status": "summary", + "last_received_data": 1487811257 }] } @@ -1875,15 +1873,15 @@ of the introducer(s) and storage server(s), here's an example:: The above json ``introducers`` section includes a list of introducer connectivity status messages. -The above json ``servers`` section is a map -where the key is a storage server node ID and the value -is a map of properties with the following usage for each key: +The above json ``servers`` section is an array with map elements. Each map +has the following properties: -1. ``available_space`` - the available space in bytes expressed as an integer -2. ``nickname`` - the storage server nickname -3. ``version`` - the storage server Tahoe-LAFS version -4. ``connection_status`` - connectivity status -5. ``last_received_data`` - the time when data was last received, +1. ``nodeid`` - an identifier derived from the node's public key +2. ``available_space`` - the available space in bytes expressed as an integer +3. ``nickname`` - the storage server nickname +4. ``version`` - the storage server Tahoe-LAFS version +5. ``connection_status`` - connectivity status +6. ``last_received_data`` - the time when data was last received, expressed in seconds since epoch ``GET /status/`` diff --git a/src/allmydata/test/web/test_web.py b/src/allmydata/test/web/test_web.py index c6717e49b..9ceb818bb 100644 --- a/src/allmydata/test/web/test_web.py +++ b/src/allmydata/test/web/test_web.py @@ -754,22 +754,18 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi }, u'servers': sorted([ {u"nodeid": u'other_nodeid', - u"description": { - u'available_space': 123456, - u'connection_status': u'summary', - u'last_received_data': None, - u'nickname': u'other_nickname \u263b', - u'version': u'1.0', - }, + u'available_space': 123456, + u'connection_status': u'summary', + u'last_received_data': None, + u'nickname': u'other_nickname \u263b', + u'version': u'1.0', }, {u"nodeid": u'disconnected_nodeid', - u"description": { - u'available_space': 123456, - u'connection_status': u'summary', - u'last_received_data': None, - u'nickname': u'disconnected_nickname \u263b', - u'version': u'1.0', - }, + u'available_space': 123456, + u'connection_status': u'summary', + u'last_received_data': None, + u'nickname': u'disconnected_nickname \u263b', + u'version': u'1.0', }, ]), } diff --git a/src/allmydata/web/root.py b/src/allmydata/web/root.py index f2a23c1e1..f4f38d6e1 100644 --- a/src/allmydata/web/root.py +++ b/src/allmydata/web/root.py @@ -214,10 +214,7 @@ class Root(MultiFormatPage): def _describe_known_servers(self, broker): return sorted(list( - { - u"nodeid": server.get_serverid(), - u"description": self._describe_server(server), - } + self._describe_server(server) for server in broker.get_known_servers() )) @@ -225,6 +222,7 @@ class Root(MultiFormatPage): def _describe_server(self, server): description = { + u"nodeid": server.get_serverid(), u"connection_status": server.get_connection_status().summary, u"available_space": server.get_available_space(), u"nickname": server.get_nickname(),