Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ pip install frequenz-client-reporting==$VERSION

```python
from datetime import datetime, timedelta
import os

from frequenz.client.common.metric import Metric
from frequenz.client.reporting import ReportingApiClient

# Change server address
SERVER_URL = "grpc://replace-this-with-your-server-url:port"
API_KEY = open('api_key.txt').read().strip()
client = ReportingApiClient(server_url=SERVER_URL, key=API_KEY)
AUTH_KEY = os.environ['REPORTING_API_AUTH_KEY'].strip()
# It is recommended to use a proper secret store to get the secret
# For local development, make sure not to leave it in the shell history
SIGN_SECRET= os.environ['REPORTING_API_SIGN_SECRET'].strip()
client = ReportingApiClient(server_url=SERVER_URL, auth_key=AUTH_KEY, sign_secret=SIGN_SECRET)
```

Besides the `microgrid_id`, `component_id`s, `metrics`, start, and end time,
Expand Down Expand Up @@ -157,7 +161,8 @@ microgrid component data from the reporting API.
```bash
reporting-cli \
--url localhost:4711 \
--key=$(<api_key.txt)
--auth_key=$AUTH_KEY
--sign_secret=$SIGN_SECRET
--mid 42 \
--cid 23 \
--metrics AC_ACTIVE_POWER AC_REACTIVE_POWER \
Expand Down
7 changes: 4 additions & 3 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@

## Upgrading

<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
* The `key` parameter of the client has been renamed to `auth_key`

## New Features

* Add HMAC generation capabilities.
* The new CLI option "key" can be used to provide the server's key.
* The client itself now has a "key" argument in the constructor.
* The new CLI option "sign_secret" can be used to provide the server's HMAC secret.
* The client itself now has a "sign_secret" argument in the constructor.
* Update documentation describing how to use the above options.

## Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion src/frequenz/client/reporting/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def main() -> None:
states=args.states,
bounds=args.bounds,
service_address=args.url,
auth_key=args.key,
auth_key=args.auth_key,
fmt=args.format,
sign_secret=args.sign_secret,
)
Expand Down
Loading