Is it possible to make several subscription of Orion just changing the notification url of cygnus using the same instance of Cygnus?
As mentioned in the official documentation of Orion context broker
The URL where to send notifications is defined with the url sub-field. Here we are using the URL of the accumulator-server.py program, previously started. Only one URL can be included per subscription. However, you can have several subscriptions on the same context elements (i.e. same entity and attribute) without any problem.
Related
https can be used in the notification url setting of the subscription.
https://fiware-orion.readthedocs.io/en/master/user/security/index.html#https-notifications
However, I couldn't find in the documentation if https can be used in the provider url setting of the registration.
Please confirm if Orion officially permits the use of https in the provider url setting of the registration API.
I'd say that Orion would allow Context Providers using HTTPS endpoints the same way as with subscriptions, as the code is the same (i.e. the code to deal with outcoming requests is shared between notification logic and request forwarding logic).
Could you check and tell us if it works (as comment to this answer), please? :)
EDIT: the test cases included in this PR assure that HTTPS CPrs are working.
I installed a Fiware platform with ContextBroker and Cygnus. Everything is working properly. I would like ContextBroker to update itself automatically every hour, by fetching data from an API on an external server (API in JSON format that returns data with a GET request).
Is it possible ? How to do ?
Every hour:
ContextBroker request to get weather data
ContextBroker update "weather" entitie with the data returned
Thanks
In general, Orion Context Broker expects context producers to push data.
The only case in which Orion pulls data is in context provider scenarios and does only in a transient way, i.e. it gets the data from the context provider and sends to the client in the response but the data is not stored in the context database managed by Orion.
In addition, you could have a look to the FIWARE Device Simulator. This is a powerful and flexible tool which allows to use external as a source of data, allow acting as a bridge between your source of data and Orion Context Broker. From its documentation:
external: Information about an external source from which to load, to transform and to register data into a Context Broker instance.
In the global Wirecloud instance i have a widget which uses the KeystoneAPI mentioned here:
https://wirecloud.readthedocs.io/en/stable/development/object_storage_api/
So far so good.
However now i want to move to KeyRock for authentication. I still want to pass tokens from my wirecloud widget to backend services like the Wilma PEP proxy which is not connected to KeyRock as well. But the KeystoneAPI seems to be tied to Keystone (hence the name probably).
Is there a KeyRockAPI accessible from Wirecloud widgets? How can a widget obtain the KeyRock OAuth2 token the user logged in with? I cannot find any documentation on this.
WireCloud doesn't allow widgets and operators to read the OAuth2 token assigned to the user, but it provide support for injecting the token into HTTP requests if they go through the WireCloud's proxy. This injection is controlled by several HTTP headers, this is an example:
MashupPlatform.http.makeRequest(url, {
requestHeaders: {
"X-FI-WARE-OAuth-Token": "true",
"X-FI-WARE-OAuth-Header-Name": "X-Auth-Token"
},
...
});
You can find more info about how to use this feature in the FIWARE Academy course, more specifically in the 3.1.8. Accessing third-party services using IdM tokens section (take into account that this document is the same you pointed in your comments, but in html format ;) ).
Answers to the others questions formulated as comments:
Installed docker containers of KeyRock and Wirecloud, tried out the objectstorage demo widget, which failed to retrieve an authentication token. Traced the problem to %idm_token% not being filled in by the python code, presumably in plugins.py because it looks for an AUTHENTICATION_BACKEND of 'fiware' whereas the documentation states to include 'wirecloud.fiware.social_auth_backend.FIWAREOAuth2'.
I recommend you to create a new question in StackOverflow to tackle this problem. Please, provide more details on your configuration.
So my authentication token from wirecloud will be bound to that application? If so, the token is useless to my own application unless i can get a new token for it. Am i wrong here?
Yeah, the Mashup portal is the application number 17 in the Account portal and the OAuth2 token obtained by WireCloud is bound to that application. I cannot foresee if that token is useful for your application or not. This token can be used for authenticating users, but the IdM limits the returned information (e.g. roles) depending on the application bounded to the token. So, evidently, this integration is not perfect, but we are missing some integration features from the IdM to make it more useful.
I'm trying to send an event to a consumer, in order to modify one attribute on an entity of the Context Broker.
The issue is, that I've got the entity that is going to receive the derivation event, under a Fiware-Service and Fiware-ServicePath.
I don't know where to place that information. I found no information on any of the documents (not even in user guide nor programmer guide).
Where should I place Fiware-Service and Fiware-ServicePath to be part of the header of the REST call?
Indeed, the feature of CEP to add headers to meet options in Orion has been created, but exact schedule for implementation not finalized yet.
Unfortunately, CEP does not support this feature presently.
We are using the Map Viewer of the fiware-wirecloud mashup to show as POIs in a world map the location of the 3D printers registered in our Fiware project. The instance of GE implementation used is the "FIWARE Lab Mashup Portal" and the POIs are are created and retrieved from the "FIWARE Lab Global Instance" of the "Orion Context Broker" (NGSI server URL--> https://orion.lab.fiware.org:1026/)
The application was working fine but several months ago the POIs suddenly disappeared from the map.
After looking over all the related questions in stackoverflow and other resources about this problem, we did the following:
Update the version of the NGSI source operator from v3.0.3 to v3.0.5,
Change the NGSI proxy URL from http://ngsiproxy.lab.fiware.org to https://ngsiproxy.lab.fiware.org, and also
Select the option "Use the FIWARE credentials of the workspace owner" to make public the mashup for all user in the web where it is
embed.
The mashup started to work perfectly.
But last week we note that the mashup again failed to show points of interest.
We've made some checking:
There isn't a new version available of the NGSI source operator in the Marketplace. We are using the last version v3.0.5. Same with the
"NGSI Entity to PoI" operator or the "Map viewer" widget.
There are no changes about the NGSI server URL--> https://orion.lab.fiware.org:1026/ or the NGSI proxy URL-->
https://ngsiproxy.lab.fiware.org
And finally we have checked the data in the public instance of the Orion Context Broker throught a curl request and the conexion to Orion and the returned json seem right.
What it might be happening?
We have looked over all the previous similar questions in stackoverflow and other sources, but this time the answers don't help us.
Thank you in advanced for your help.
There were a temporal problem with the global Orion Context broker and it was not sending notifications (queries and other operations were working well). The context broker team is checking the global instance and should be operational in a short period of time.
NOTE: Check the URL of the context broker, it should be: http://orion.lab.fiware.org:1026/ (without the s of https).