HTTP requests within multi server environment
AnsweredHi,
I have 19 different servers (Wave VMS) at different locations, all merged into a multi server environment and connected to wave-sync. I am trying to send a http-request using a generic event as trigger. The generic event is created through the API on "server 1" and i want the http request to be executed on localhost:1880 on "server 2" but i cannot get this to work. I have tried the following:
- I have confirmed that the generic event is working by setting the action to "show desktop notification" The notification is displayed when i trigger the generic event at "server 1"
- I have confirmed that the http-request is working and sent to "localhost:1880" on "server 2" by using "soft trigger" as trigger. When i push the soft trigger on a camera at "server 2" the http request is sent to localhost:1880 on "server 2"
- When i set the trigger to Generic Event and Action to http request it is not working.
I suspect that Wave cannot distinguish on what server i want to send the http-request to? It could be that the http-request is sent on any of the other servers within my environment? Can i define that the request shall always be executed at "server 2"?
Thanks in advanced
Kind Regards
Jonas
-
Hello,
Can i define that the request shall always be executed at "server 2"?
You can define the Server, where the API request has to be executed for triggering a Generic Event.
Once the event has been triggered, the "Do HTTP Request" action should be executed on the same server.
You may pass x-server-guid header, then request will be proxied to the server, of which guid is in the header.
There is an alternative way - changing the request path to something like
https://192.168.0.101:7001/proxy/192.168.0.102:7001/api/createEvent
```0 -
Hi Andrey,
Many thanks! Do you have an example of how to "pass x-server-guid header"? I cannot find this within the API documentation.
0 -
Hi,
In python you could do something like
custom_header = {"x-server-guid": f"e3e9a385-7fe0-3ba5-5482-a86cde7f0000"}and then pass it to the request method
response = requests.request(
method,
server_url,
headers=custom_header
)0
Please sign in to leave a comment.
Comments
3 comments