Calling a #RPC method outside of volttron - volttron

Say I have a running volttron agent with a #RPC decorated method (if that's relevant). Are there any ways to call that method from outside of the volttron platform? (In my case from a django web server)

An agent may register endpoints on the VOLTTRON web service. A callback may be setup for the endpoint as needed.
The web service must be enabled and the agent needs to pass "enable_web=True" to the base agent constructor.
You can find the documentation and examples here: http://volttron.readthedocs.io/en/develop/specifications/webframework.html

Along with what kyle-monson mentions, you also have to run Volttron using the bind argument. This will expose the registered endpoints on the bind arg given.
e.g `volttron -vv --bind-web-address "https://127.0.0.1:7080"
OR specify the bind-web-address in the ~/.volttron/config
[volttron]
message-bus = rmq
bind-web-address = https://127.0.0.1:7080
Then you can send HTTP POST request to https://127.0.0.1:7080/rpc-method-name
rpc-method-name in the request URL being the registered method using self.vip.web.register_endpoint("/rpc-method-name", self.call_back_method_for_endpoint)
The call back method takes in two parameters "env" and "data"
For more details on this two parameters check the docs here

Related

How to Register Solr with Eureka

I have 2 Spring apps ("client-app" and "service-app") that are already registered to Eureka (and talk via Feign Client). However, I have to talk to an instance of Solr and I'm forced to hard-code the IP address in the properties file. I would much rather not do this and use Eureka for service-discovery.
Question: Is there a way/plugin to have solr register itself with Eureka, so that clients can then discover it (even if it's programmatically via a start-up listener or some sort)?
I've looked at the solr API and it doesn't seem to have lifecycle listener (onStartUp or onShutdown hooks)
You would need a Solr Plugin for this, which is SolrCore aware. That interface method inform is called anytime something interesting happens with a core. Within the implementation of the inform method you would need to register/deregister as a client.
Then you would need to add it to your Solr (Cloud) instance. After that and proper configuration of your plugin, it should work.

OSB - Get endpoint from business services to log this endpoint

How can i get in a proxy flow the business service endpoint?. I want to log this endpoint in my log file.
I use OSB 11.1.1.7.
Thanks
Try with $outbound/ctx:transport/ctx:uri from proxy.
This can be achieved with use of "Message Tracing" functionality. Look under "Operational Settings" tab. Make sure to set the detail level to "Full".
Unfortunately there is no OOTB functionality to access service endpoint value inside OSB pipeline. Context variable $outbound/ctx:transport/ctx:uri mentioned before is only used to override default endpoint URI. ctx:uri is never initialized on the outbound variable. This information can be found in chapter "39.4.1.2 transport" of "Fusion Middleware Administrator's Guide for Oracle Service Bus"(https://docs.oracle.com/cd/E28280_01/admin.1111/e15867/context.htm#OSBAG326) .

google managed-VMs specify instance in URL

I use google managed-VMs. My module has several instances. I need to perform a HTTP call on each of these instances. Hence, I would like to know if there is a way to specify the recipient instance in the URL.
For instance I tried: http://<instance-name>.<module-name>.<project-name>.appspot.com/ without success.
You're missing a <version-name> in there:
http://<instance-name>.<version-name>.<module-name>.<project-name>.appspot.com
See https://cloud.google.com/appengine/docs/python/modules/#Python_Application_hierarchy for more details (this is the page for Python, but it applies across-the-board.

Auto update feature in passbook ios 7

How does automatic updates work in passbook available in backfield of the pass, how to use webserviceURL key to get update from the server.
in webserviceURL key i have provided remote path from where updated pass can be downloaded, but even after content changed in server, it does not reflects in pass.
This question has been asked so many times, in so many ways, in so many forums; mostly by people that are too lazy to read the manual, or are too inexperienced / incompetent to understand it.
The first paragraph of the Passbook Web Service Reference explains why simply adding a link to an updated pass will not work.
A REST-style web service protocol is used to communicate with your server about changes to passes, and to fetch the latest version of a pass when it has changed. The endpoints always begin with the web service URL, as specified in the pass, followed by the protocol version number. For example, a request for the latest version of the pass of type com.apple.pass.example and serial number ABC123 might look like the following:
The Passbook web service is an integral part of the Passbook eco system. Anyone wishing to issue passes that change their content (either in response to a push message or in response to a user requesting fresh content by pulling down on the back of the pass), needs to implement their own Passbook web service.
This entails building a server capable of responding to the following to authenticated requests from each device that has installed your pass.
There are 5 methods that your web service should respond to:
1. Registering a Device to Receive Push Notifications for a Pass
POST request to https://webServiceURL/v1/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier/serialNumber
2. Getting the Serial Numbers for Passes Associated with a Device
GET request to https://webServiceURL/v1/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier?passesUpdatedSince=tag
3. Getting the Latest Version of a Pass
GET request to https://webServiceURL/v1/passes/passTypeIdentifier/serialNumber
4. Unregistering a Device
DELETE request to https://webServiceURL/v1/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier/serialNumber
5. Logging Errors
POST request to https://webServiceURL/v1/log
In order to have a pass respond to a manual refresh or push request you need to implement at least the first 3 methods. This is because the device will not issue any further requests until it has received a valid response to the registration request.
Furthermore, the web service must be available over https. An unsecured http service can be used for development, but production devices will only recognise a webServiceURL key that begins with https.

How can one get local host address in Apache Camel

In a route (that exposes a REST service) i need to get the local host address/domain (so as I can build links to be included in a response body)
Is there a way to get the local host address from within camel ?
PS : running camel inside servicemix
there isn't a Camel specific way (that I know of), I'd just use an external property file to configure environment specific settings like this...you can then use camel properties to pull this in, etc.
A good idea when posting questions is to provide more details.
Which camel component do you use for REST. And which version of SMX/Camel do you use etc.
As you question assume that the rest component in Camel will expose a hostname information.
This questions is not Camel specific per see, as you can use the regular Java API to get the hostname.

Resources