Skip to content

5. Interacting

Alex Tzortzis edited this page Jul 11, 2024 · 4 revisions

The connector address that other connectors will use to communicate with your connector will be https://${domain-name}/router. Also, after successful deployment, your connector should be available in the Metadata Broker.

GUI

After deployment, the user interfaces for the :

  • data space connector (https://${domain-name}/${deployment-name}/ui/)
  • connector data-app (https://${domain-name}/${data-app}/)

will be available, with the login matching the admin user with the provided BCrypt password.

Programmatically

To utilize the functionality of the Open API data app programmatically, you can make client side calls to query the app. This is the same method used by the app's user interface. For a more concrete template example, please look at /examples/client-app.py, where we use python requests to perform API calls to the connector. Please note that the script might not work at the time of your execution, as the credentials will be updated.

URL

The structure of these calls is as follows: https://<baseurl>/<data-app-path>/openapi/<version>/<endpoint>. The baseurl represents the URL where your connector is deployed, while the data-app-path refers to the path used for the data app. For the version, you should select the version of your own backend service, and for the endpoint, choose an endpoint specific to your service.

Headers

To ensure that the OpenAPI data app knows where to route the request, you can include headers with the request. The headers used are the:

  • Authorization: the Bearer Authentication HTTP header, so the field is filled as Bearer, plus space, plus the API key defined in values.yaml file at containers.apiKey (incluing APIKEY- prefix). This header field is required only if data-app UI is configured with ingress authentication.
  • Forward-ID: the Agent ID of the service registered at the party you wish to interact with (reciever)
  • Forward-Sender: your own Agent ID for identification purposes (${IDS_COMPONENT_ID})

Params

In case of Query parameters are not URL encoded and therefore, if you need to perform queries, require to use the params option. If you are using external authentication, it is advisable not to make calls to the OpenAPI data app via the ingress. In such cases, you can deploy your service in the same Kubernetes cluster as the data app and use the internal Kubernetes service URL to access the data app.

Usage

In the OpenAPI data app UI:

  1. go to Tester and click on Query
  2. expand the agent with id urn:ids:enershare:connectors:MeterDataService:ServiceAgent and click on Use. The fields appropriate to said agent should be filled
  3. Select a sender agent from the list and provide as path "/powermeters"
  4. This should result in a JSON array of observer Ids.
Clone this wiki locally