Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

APIs Used By GU Provider UI

filipgolem edited this page Sep 12, 2019 · 14 revisions

API Used by Golem Unlimited Provider UI

New API

Setting and Getting Node Permissions

GET /nodes/{nodeId} - returns node permission status (0, 1, 2 - no permission, sandbox, full access). If nodeId == "auto", return default permissions for local nodes.

PUT /nodes/{nodeId} - allow connections to the node (or turns on auto mode) and save hub information; body must contain hostName (e.g. myhub), address (e.g. 127.0.0.1:61622) and accessLevel (0, 1 or 2). If nodeId == "auto", then allow connections from all hubs.

DELETE /nodes/{nodeId} - deny connections to the node. If nodeId == "auto", then deny connections from unknown hubs.

TODO: Not Used, Not Implemented Yet

GET /nodes - returns nodes that are allowed to connect and auto/manual status: { "auto": 2, "allow": [ "0x123...", ...] }

POST /nodes - sets permissions, body as in GET /nodes

Getting Saved Nodes

GET /nodes?saved - returns a JSON list of saved hubs (fields: address, host_name, node_id)

Listing LAN Nodes

GET /lan/list - returns all hubs in the local network

Existing API

PUT /connections/mode/auto?save=1

PUT /connections/mode/manual?save=1

POST /connections/connect?save=1 with request body = [ "0x123..." ]

POST /connections/disconnect?save=1 with request body = [ "0x123..." ]