#2476 closed defect (fixed)

add JSON encoding of information from Welcome page

Reported by: daira Owned by: dawuud
Priority: normal Milestone: undecided
Component: code-frontend-web Version: 1.10.1
Keywords: webapi json welcome test-needed Cc:
Launchpad Bug:

Description

Requested by Shu Lin on tahoe-dev. This should include the tubid, node public key, and information about any connected storage servers, introducer and helper.

Change History (6)

comment:1 Changed at 2017-01-12T22:19:15Z by dawuud

ok i've made some progress here: https://github.com/david415/tahoe-lafs/tree/2476.add_json_welcome_page.0

it works... output json with a list of summaries for connections to introducers and storage servers:

` {

"introducers": {

"statuses": [

"Connected to tcp:127.0.0.1:33791 via tcp"

]

}, "servers": {

"statuses": [

"Connected to tcp:127.0.0.1:41421 via tcp"

]

}

} `

i can change the format but i did it like this because it was easiest. For each storage server and introducer we get a ConnectionStatus object which contains a summary string. If we want the data in a different format then I can make some changes.

comment:2 Changed at 2017-01-13T19:23:09Z by cypher

This will be tremendously useful for developers who want to use of this information without having parse out the welcome page's HTML -- thanks! ;)

How difficult or time-consuming would it be to insert the remainder of the information from the storage servers table? I'm thinking of something like this for the "servers" section (using example data from the Public Test Grid):

{
    "servers" :{
        "v0-5sprlixushufwhh5fqnxsitmk2ys4nmusgadjgrtjfb3lk4s57ia": {
            "available_space": null,
            "connection_status": "Reconnecting in 536 seconds (last attempt 1418s ago)",
            "nickname": "Sasquatch",
            "last_received_data": null,
            "version": "tahoe-lafs/1.12.0"
        },
        "v0-oii62uew7mnhkabtzkpxti62qyqk4smnoy6czz7waqdlorpqk4qa": {
            "available_space": "739292720660",
            "connection_status": "Connected to tcp:194.88.245.210:42998 via tcp",
            "nickname": "WXD",
            "last_received_data": "2017-01-13 10:59:48",
            "version": "tahoe-lafs/1.11.0"
        },
        "v0-x4zq6fof6eyr2y2ylhy6lc5vsnxrlh25mbnmm6xnodyrk4fejb3q": {
            "available_space": "13819057274",
            "connection_status": "Reconnecting in 536 seconds (last attempt 1418s ago)",
            "nickname": "drixter",
            "last_received_data": "2017-01-13 10:59:47",
            "version": "tahoe-lafs/1.11.0"
        }
    }
}

comment:3 Changed at 2017-01-14T00:16:05Z by dawuud

OK I've provided the additional requested structure and information... See if you like it, let me know if you have additional things you want to add.

comment:5 Changed at 2017-01-19T19:10:41Z by exarkun

  • Keywords test-needed added
  • Owner changed from warner to dawuud

comment:6 Changed at 2017-07-27T23:02:08Z by Brian Warner <warner@…>

  • Resolution set to fixed
  • Status changed from new to closed

In d018a07/trunk:

Merge PR430: add JSON welcome page

closes ticket:2476

Note: See TracTickets for help on using tickets.