Remote REST API Wrapper - LSIR/gsn GitHub Wiki

Remote REST API wrapper

This wrappers connects to a remote gsn-services instance and uses the REST API to poll data from the server. Thus going through the oauth2 authentication and authorization process. For this purpose, the wrapper must be linked to a oauth2 client and registered on the gsn-services instance (using the client credentials for obtaining the token).

This wrapper is useful when the data source server has a public IP address, but not the destination server and the communication has to go over internet (and can be encapsulated in a TLS/SSL connection). Or when the data source server is managed by somebody else.

For example the following stream is defined to poll every minutes the virtual sensor MemoryMonitorVS on the remote machine 192.168.1.101, given some client credentials and a starting time.

<streams>
	<stream name="input1">
		<source alias="source1" sampling-rate="1" storage-size="1">
			<address wrapper="remote-api">
				<predicate key="url">https://192.168.1.101:9000/ws/</predicate>
				<predicate key="client_id">the_client_id</predicate>
				<predicate key="client_secret">the_client_secret</predicate>
				<predicate key="vs_name">MemoryMonitorVS</predicate>
				<predicate key="starting_time">1476455905000</predicate>
				<predicate key="sampling">60000</predicate>
			</address>
			<query>select * from wrapper</query>
		</source>
		<query>select * from source1</query>
	</stream>
</streams>
⚠️ **GitHub.com Fallback** ⚠️