-
Notifications
You must be signed in to change notification settings - Fork 0
5. Interacting
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.
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.
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.
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.
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 asBearer, plus space, plus the API key defined invalues.yamlfile atcontainers.apiKey(incluingAPIKEY-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})
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.
In the OpenAPI data app UI:
- go to
Testerand click onQuery - expand the agent with id
urn:ids:enershare:connectors:MeterDataService:ServiceAgentand click onUse. The fields appropriate to said agent should be filled - Select a sender agent from the list and provide as
path"/powermeters" - This should result in a JSON array of observer Ids.