Skip to content

Commit aec2f47

Browse files
authored
Clean up language and structure in quota data management guide (#8)
* Clean up language and structure in quota data management guide * Apply suggestions from code review
1 parent 0d123b6 commit aec2f47

1 file changed

Lines changed: 36 additions & 23 deletions

File tree

examples/quota-management/README.md

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,47 @@
1-
# Quota Management example
1+
# Managing the device's quota data with the emnify Java SDK
22

3-
This example shows how to manage endpoint's quota data.
3+
This example shows how to manage the device's quota data.
44

5-
1. Script authorizes the client using configured credentials.
6-
2. The list of endpoints is fetched then a first endpoint is taken to work with.
7-
3. Then check the current state of quota
8-
4. Script configures a quota with the following data:
9-
- set new volume of 10MB
10-
- the quota expires in 7 days
11-
- a threshold is set to 15%. If the remaining volume goes below this percentage of the applied quota, the system
12-
will generate a "threshold reached" event.
13-
- the action of exhaustion is configured to Throttle with a peak throughput of 64000 octets per second
14-
5. Script fetches the quota data to check if configuration has been saved successfully
5+
Here's a high-level overview of what happens in the script:
6+
7+
1. Authorizes the client using configured credentials
8+
1. Fetches a list of devices and selects the first device
9+
1. Checks the current state of the quota
10+
1. Configures a new quota with the following settings:
11+
- 10 MB of volume
12+
- Expires in 7 days
13+
- 15% threshold
14+
- If the remaining volume goes below this percentage of the applied quota, the system will generate a [Quota threshold reached event](https://docs.emnify.com/services/events/event-types#quota-threshold-reached)
15+
- Exhaustion action is "Throttle" with a peak throughput of 64000 octets per second
16+
1. Fetches the quota settings to check if the configuration has been saved successfully
1517

1618
## Running the example
1719

18-
Firstly, follow the [SDK installation]( ../../README.md#Installation ) instruction.
20+
### Install the SDK
21+
22+
<!-- TODO: Replace relative path with link to docs.emnify.com when live -->
23+
First, follow the [SDK installation instructions]( ../../README.md#Installation).
24+
25+
### Configure authorization credentials
26+
27+
Next, you need to configure your authorization credentials.
28+
There are two ways to do this:
29+
30+
#### Application token
1931

20-
Then you need to configure you authorization credentials. There are two options:
32+
<!-- TODO: Replace relative path with link to docs.emnify.com when live -->
33+
To [authenticate via application token](https://cdn.emnify.net/api/doc/application-token.html), you need to add `EMNIFY_APPLICATION_TOKEN` as an [environment variable](../../README.md#environment-variables).
2134

22-
#### Application Token
23-
If you want to authenticate via application token, you need to add system environment `EMNIFY_APPLICATION_TOKEN`. <a href="https://cdn.emnify.net/api/doc/application-token.html" target="_blank">Read more about Application Token</a>.
35+
#### User authentication
2436

25-
#### User Authentication
37+
<!-- TODO: Replace relative path with link to docs.emnify.com when live -->
38+
If you want to [authenticate via user authentication](https://cdn.emnify.net/api/doc/basic-auth.html), you need to add the `EMNIFY_USERNAME` and `EMNIFY_PASSWORD` [environment variables](../../README.md#environment-variables).
2639

27-
If you want to authenticate via user authentication, you need to add environments `EMNIFY_USERNAME` and `EMNIFY_PASSWORD`. <a href="https://cdn.emnify.net/api/doc/basic-auth.html" target="_blank">Read more about User Authentication</a>.
40+
### Execute the example
2841

29-
Configure one of the authentication described above and execute example.
42+
After configuring one of the authentication methods described in the previous section, you can execute the example.
3043

31-
OR just run via terminal:
44+
Here's how to run it in the terminal using [Maven](https://maven.apache.org/download.cgi):
3245

3346
```shell
3447
mvn clean install exec:java
@@ -37,15 +50,15 @@ OR just run via terminal:
3750
mvn -f examples/quota-management/ clean install exec:java
3851
```
3952

40-
## Examples
53+
## Overview of the examples
4154

42-
### Initialize the Client using environment variables
55+
### Initialize the client using environment variables
4356

4457
```java
4558
EMnify.authenticate();
4659
```
4760

48-
### Update Endpoint Quota data
61+
### Update endpoint quota data
4962

5063
```java
5164
Quota quotaForSave = new Quota();

0 commit comments

Comments
 (0)