S2U gateway is a communication gateway with RESTful interface. It offers an interface for user applications.
All datasets are restricted according to user access rights in a concrete sensors network. You need a valid account in the system for a majority of interface operations.
You can develop a client application in any programming language, just generate the REST client from WADL descriptor in your favorite IDE. If you are using Java, there is another (and more comfortable) way.
First, include our module in your Maven's pom.xml configuration:
<dependencies> ... <dependency> <groupId>cythres</groupId> <artifactId>sensnet-cli</artifactId> <version>0.9.5-SNAPSHOT</version> </dependency> ... </dependencies>
Second, use cythres.sensnet.cli.RestClient class to access the API:
try (RestClient client = new RestClient("https://sensnet.cythres.cz/sn/rest")) { // login LoginSessionNoJpa session = client.login("user@sporilov.cythres.cz", "secret_password", "my application ID"); // for instance, list units from VLAN007 subnet UnitInstance[] units = client.getUnits(session, "VLAN007"); for (UnitInstance u : units) { System.out.println(u); } // ... invoke other methods of RestClient ... MeasurementCooked[] mc = client.getLastMeasurement(session, "VLAN007"); for (MeasurementCooked u : mc) { System.out.println(u); } MeasurementCollated[] mo = client.getMeasurementCollated(session, "VLAN007", 50, 6, 1800, 0, (long) (Calendar.getInstance().getTimeInMillis() / 1000)); for (MeasurementCollated u : mo) { System.out.println(u); } DataResource[] dr = client.getResources(session, "VLAN007"); for (DataResource d : dr) { System.out.println(d); } ResourceDateRange[] rdr = client.getResourceDateRange(session, "VLAN007"); for (ResourceDateRange r : rdr) { System.out.println(r); } mc = client.getUnitMeasurement(session, "VLAN007", 50, 6, 0, (long) (Calendar.getInstance().getTimeInMillis() / 1000)); for (MeasurementCooked u : mc) { System.out.println(u); } // logout boolean result = client.logout(session); System.out.println("logout: "+result); }