Skip to content

Latest commit

 

History

History
142 lines (107 loc) · 4.72 KB

File metadata and controls

142 lines (107 loc) · 4.72 KB

Redmine GTT FIWARE Plugin Documentation

This documentation provides detailed instructions on how to use the Redmine GTT FIWARE plugin and its API endpoints.

First Steps

  1. Create a FIWARE Connection for your context broker (Administration → FIWARE Connections).
  2. Set Administration → Settings → Host name to a host the broker can reach: subscription callbacks are built from it.
  3. Enable the GTT FIWARE module in a project and create a subscription.
  4. Optional: configure issue emission and federation to publish your issues back to the broker.

Use a dedicated user with just the needed permissions as the subscription author, not an administrator.

If you need a test broker, use FIWARE-Small-Bang (local) or FIWARE-Big-Bang (server) to set one up.

Redmine Permissions

Plugin permissions

How to use

Tools and Utilities

Reference

Examples and Tutorials

For all examples, the following environment variables are used:

export BROKER_URL=http://your_broker:1026
export BROKER_TOKEN=your_token
export FIWARE_SERVICE=your_service
export FIWARE_SERVICEPATH=your_servicepath

Alternatively, you can use .env files to set these variables. Copy the .env.example file to .env and set the values accordingly. Then run source .env to load the environment variables.

General FIWARE Broker Commands

Get Entities

curl -sX GET "${BROKER_URL}/v2/entities" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer ${BROKER_TOKEN}" \
  -H "Fiware-Service: ${FIWARE_SERVICE}" \
  -H "Fiware-ServicePath: ${FIWARE_SERVICEPATH}" \
| jq

Get Subscriptions

curl -sX GET "${BROKER_URL}/v2/subscriptions" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer ${BROKER_TOKEN}" \
  -H "Fiware-Service: ${FIWARE_SERVICE}" \
  -H "Fiware-ServicePath: ${FIWARE_SERVICEPATH}" \
| jq

Notes

  • Ensure that the FIWARE context broker is running and accessible.
  • The coordinates in the location examples are in [longitude, latitude] format.
  • The jq command is used to format the JSON output for better readability.

If something does not behave as described here, please open an issue in the tracker.

CORS Issues

If you encounter CORS issues, for example when you use FIWARE-Big-Bang, you can extend the Nginx configuration as follows:

[snip]

server {
  [snip]

  # Add CORS Headers
  add_header 'Access-Control-Allow-Origin' '*' always;
  add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT, PATCH' always;
  add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' always;
  add_header 'Access-Control-Expose-Headers' 'location, fiware-correlator' always;

  location / {
    if ($request_method = 'OPTIONS') {
      add_header 'Access-Control-Allow-Origin' '*' always;
      add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT, PATCH' always;
      add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' always;
      add_header 'Access-Control-Expose-Headers' 'location, fiware-correlator' always;
      add_header 'Access-Control-Max-Age' 1728000;
      add_header 'Content-Type' 'text/plain charset=UTF-8';
      add_header 'Content-Length' 0;
      return 204;
    }

    [snip]
  }

  [snip]
}

In particular location and fiware-service, fiware-servicepath are important for the FIWARE broker to work correctly.