Skip to content

Commit 015f775

Browse files
committed
Adjust docs
Signed-off-by: Daniel Kastl <[email protected]>
1 parent bbcf382 commit 015f775

File tree

5 files changed

+26
-23
lines changed

5 files changed

+26
-23
lines changed

doc/broker_scripts.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# Broker Scripts
1+
# FIWARE Broker Scripts
22

33
This document describes the scripts available in the `scripts` directory that
4-
help manage the context broker.
4+
help manage the FIWARE context broker.
5+
6+
- [Register All Subscriptions](#register-all-subscriptions)
7+
- [Delete All Subscriptions](#delete-all-subscriptions)
58

69
## Register All Subscriptions
710

@@ -27,22 +30,22 @@ URL specified in the header for each subscription.
2730

2831
- `REDMINE_API_KEY`: The API key for your Redmine instance. This is used if the
2932
`api_key` argument is not provided.
30-
- `ORION_URL`: The base URL for your Orion Context Broker. Defaults to
33+
- `BROKER_URL`: The base URL for your Orion Context Broker. Defaults to
3134
`http://app.local:1026` if not set.
3235

33-
**Note:** Make sure to set the `REDMINE_API_KEY` and `ORION_URL` environment
34-
variables before running this script if you're not providing them as arguments.
36+
**Note:** Make sure to set the `BROKER_URL` environment variable to your context
37+
broker URL before running this script.
3538

3639
To prepend an environment variable to a command in the terminal, you can do so
3740
like this:
3841

3942
```bash
40-
REDMINE_API_KEY=your_api_key ORION_URL=your_orion_url ./scripts/register_all_subscriptions.sh
43+
BROKER_URL=your_broker_url ./scripts/register_all_subscriptions.sh <your_api_key>
4144
```
4245

43-
Replace `your_api_key` with your actual Redmine API key and `your_orion_url`
44-
with the correct URL. This will set the `REDMINE_API_KEY` and `ORION_URL`
45-
environment variables for the duration of the `register_all_subscriptions.sh` script.
46+
Replace `your_api_key` with your actual Redmine API key and `your_broker_url`
47+
with the correct URL. This will set the `BROKER_URL` environment variables for
48+
the duration of the `register_all_subscriptions.sh` script.
4649

4750
## Delete All Subscriptions
4851

@@ -61,19 +64,19 @@ subscriptions, and then makes DELETE requests to the
6164

6265
**Environment Variables:**
6366

64-
- `ORION_URL`: The base URL for your Orion Context Broker. Defaults to
67+
- `BROKER_URL`: The base URL for your Orion Context Broker. Defaults to
6568
`http://app.local:1026` if not set.
6669

6770
**Note:** This script does not require any arguments. Make sure to set the
68-
`ORION_URL` environment variable to your context broker URL before running this script.
71+
`BROKER_URL` environment variable to your context broker URL before running this script.
6972

7073
To prepend an environment variable to a command in the terminal, you can do so
7174
like this:
7275

7376
```bash
74-
ORION_URL=your_orion_url ./scripts/delete_all_subscriptions.sh
77+
BROKER_URL=your_broker_url ./scripts/delete_all_subscriptions.sh
7578
```
7679

77-
Replace `your_orion_url` with your actual Redmine API key. This will set the
78-
`ORION_URL` environment variable for the duration of the
80+
Replace `your_broker_url` with your actual Redmine API key. This will set the
81+
`BROKER_URL` environment variable for the duration of the
7982
`delete_all_subscriptions.sh` script.

doc/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ FIWARE plugin and its API endpoints.
77

88
- Make sure REST web services is enabled: <http://localhost:3000/settings?tab=api>
99
- Enable the plugin in project settings
10-
- Don't select a user with admin rights for the FIWARE subscriptions. Instead,
11-
create a new user with the necessary permissions.
10+
- For security reasons don't select a user with admin rights for the FIWARE
11+
subscriptions. Instead, create a new user with the necessary permissions.
1212

1313
### Redmine Permissions
1414

doc/plugin_settings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ FIWARE plugin. The plugin is designed to manage subscriptions for a FIWARE
55
context broker, allowing the creation of Redmine issues through FIWARE
66
notifications.
77

8-
## General Settings
9-
108
![Plugin Settings Screenshot](plugin_settings.png)
119

10+
## General Settings
11+
1212
### Default NGSI-LD Format
1313

1414
- **Description**: Specifies the format of the NGSI-LD data.

doc/scripts/delete_all_subscriptions.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

33
# The base URL for your Orion Context Broker
4-
ORION_URL=${ORION_URL:-"http://app.local:1026"}
4+
BROKER_URL=${BROKER_URL:-"http://app.local:1026"}
55

66
# Fetch all subscription IDs using a GET request
77
# Include additional headers as needed, e.g., for multi-tenant setups or authentication
8-
subscription_ids=$(curl -s -X GET "${ORION_URL}/v2/subscriptions" \
8+
subscription_ids=$(curl -s -X GET "${BROKER_URL}/v2/subscriptions" \
99
-H "Accept: application/json" | jq -r '.[].id')
1010

1111
# Check if there are any subscriptions to delete
@@ -16,7 +16,7 @@ fi
1616

1717
# Loop through the subscription IDs and delete each one
1818
for id in $subscription_ids; do
19-
curl -X DELETE "${ORION_URL}/v2/subscriptions/${id}" \
19+
curl -X DELETE "${BROKER_URL}/v2/subscriptions/${id}" \
2020
-H "Accept: application/json"
2121
echo "Deleted subscription $id"
2222
done

doc/scripts/register_all_subscriptions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ then
1111
fi
1212

1313
# The base URL for your Orion Context Broker
14-
ORION_URL=${ORION_URL:-"http://app.local:1026"}
14+
BROKER_URL=${BROKER_URL:-"http://app.local:1026"}
1515

1616
# Fetch all subscriptions using a GET request
17-
subscriptions=$(curl -s -X GET "${ORION_URL}/v2/subscriptions" -H "Accept: application/json")
17+
subscriptions=$(curl -s -X GET "${BROKER_URL}/v2/subscriptions" -H "Accept: application/json")
1818

1919
# Use jq to parse the JSON response and filter subscriptions with the "X-Redmine-GTT-Subscription-Template-URL" header
2020
filtered_subscriptions=$(echo "$subscriptions" | jq -c '.[] | select(.notification.httpCustom.headers."X-Redmine-GTT-Subscription-Template-URL" != null)')

0 commit comments

Comments
 (0)