-
-
Notifications
You must be signed in to change notification settings - Fork 32
Datasource: JSON
Rello edited this page Jan 5, 2023
·
8 revisions
With the JSON datasource, you can extract data from an external JSON service
- grab Nextcloud statistics from its own monitoring API (see below)
- URL needs to be accessible by Nextcloud
- Realtime data source in the report settings
- Store data in the data set automation
- URL of json
- Authentication
- Object path for non-array values: multiple values extracted at once. They need to be separated by ",". See Example 1
- Object path for array values: a whole dataset can be selected by choosing the columns within
{dimension1,dimension2,value}
. See Example 3, 4 - HTTP method to choose GET/POST
- Request body - in case the request requires data to be sent
- Content-Type (default application/json)
- Timestamp - if the data should be stored with the timestamp of the data loading; to keep a historic snapshot; not for array values
Monitor the Nextcloud instance via its internal API
- monitoring app needs to be enabled
- access token needs to be created
- URL:
http://server/nextcloud/ocs/v2.php/apps/serverinfo/api/v1/info?format=json
- Auth:
user:token
(from settings->security) - Object path:
ocs/data/nextcloud/storage,ocs/data/nextcloud/shares
- Timestamp
true
Monitor ethermine API
- URL:
https://api.ethermine.org/miner/0x70CEC2d62EcDeebd19CE87EBAf01c6d9546BF407/currentStats
- Object path:
data/currentHashrate,data/averageHashrate
- Method: GET
- Timestamp
true
Get history of BTC/EUR values
- URL:
https://cex.io/api/price_stats/BTC/EUR
- Object path:
{BTC,tmsp,price}
- Method: POST
- Request body:
{"lastHours": 24,"maxRespArrSize": 100}
- Timestamp
false
Read an array of values from a sub-path of the json.
Absolute and array paths can be combined
- Object path:
data/data{forecast,from,intensity/forecast}