File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Please also refer to [examples](https://github.com/frequenz-floss/frequenz-clien
3030
3131``` bash
3232# Choose the version to install
33- VERSION=0.3 .0
33+ VERSION=0.4 .0
3434pip install frequenz-client-reporting==$VERSION
3535```
3636
@@ -45,7 +45,8 @@ from frequenz.client.reporting import ReportingApiClient
4545
4646# Change server address
4747SERVICE_ADDRESS = " localhost:4711"
48- client = ReportingApiClient(service_address = SERVICE_ADDRESS )
48+ API_KEY = open (' api_key.txt' ).read().strip()
49+ client = ReportingApiClient(service_address = SERVICE_ADDRESS , key = API_KEY )
4950```
5051
5152### Query metrics for a single microgrid and component:
@@ -105,5 +106,12 @@ print(df)
105106
106107The example folder contains a simple client that can be used to query the reporting API from the command line:
107108``` bash
108- python examples/client.py --url localhost:4711 --mid 42 --cid 23 --metrics AC_ACTIVE_POWER AC_REACTIVE_POWER --start 2024-05-01T00:00:00 --end 2024-05-02T00:00:00
109+ python examples/client.py \
110+ --url localhost:4711 \
111+ --key=$( < api_key.txt)
112+ --mid 42 \
113+ --cid 23 \
114+ --metrics AC_ACTIVE_POWER AC_REACTIVE_POWER \
115+ --start 2024-05-01T00:00:00 \
116+ --end 2024-05-02T00:00:00
109117```
You can’t perform that action at this time.
0 commit comments