Skip to content
Konstantinos N. Vavliakis edited this page Aug 6, 2013 · 4 revisions

RESTful protocol for Nodes of a Consumer social network.

CSN nodes can only be created via the create graph commands. Once they are created they cannot be updated or deleted (except if their graph is deleted).

READ CSN Nodes

GET /api/csnnodes?graph_id={graph_id}&filter={filter}&limit={limit}&skip={skip}&count={count} |  index

example:

curl -k -i 'https://localhost:8443/cassandra/api/csnnodes?graph_id=51d13998e4b0ebea2a3e81f6&limit=200&skip=100&filter=\{sumP:\{$gt:1000\}\}'

Valid query parameters: @QueryParam("graph_id") String graph_id,

@QueryParam("filter") String filters,

@QueryParam("limit") int limit,

@QueryParam("skip") int skip,

@QueryParam("count") boolean count,

filter should be a JSON object, e.g. &filter={sumP:{$gt:1000}}

Retrieves the nodes of a csn graph.

READ CSN Node

GET /api/csnnodes/{csnnodes_id} | show

Fetches the properties of the Node.

example: curl -k -i --header Contet-type:application/json https://localhost:8443/cassandra/api/csnnodes/51e42dbae4b0826b7fc71a10

Consumes: Route

Produces: JSON

{
  "success": true,
  "message": "CSN nodes retrieved successfully",
  "size": 1,
  "data": [
    {
      "_id": "51e5893ee4b0c2264600bc85",
      "inst_id": "51b58c0d712e0ec08a2d415e",
      "graph_id": "51e5893ee4b0c2264600bc84",
      "InstallationType": "Student's library",
      "PersonType": "Student",
      "TotalEnergyConsumption": 1394502.9,
      "MaxHourlyEnergyConsumption": 41876.1,
      "MinHourlyEnergyConsumption": 6605.5,
      "AverageActivePowerPerHour": 482.41,
      "AverageReactivePowerPerHour": 482.41,
      "MaxActivePowerPerHour": 697.94,
      "MaxReactivePowerPerHour": -12.72,
      "MinActivePowerPerHour": 697.94,
      "MinReactivePowerPerHour": -12.72,
      "nHours": 96,
      "hoursP": [
        1015.73,
        978.1,
        856.25,
        488.62,
        507.31,
        482.42,
        552.66,
        2105.49,
        2179.28,
        910.15,
        602.81,
        485.47,
        467.72,
        484.23,
        534.87,
        698.87,
        897.67,
        1024.27,
        1019.87,
        1261.31,
        1810.78,
        1624.95,
        1218.5,
        1034.41
      ],
      "hoursQ": [
        -98.04,
        -97.12,
        -96.73,
        -89.0,
        -89.0,
        -89.0,
        -90.61,
        -128.19,
        -130.17,
        -100.42,
        -93.16,
        -90.0,
        -89.83,
        -88.7,
        -86.13,
        -77.58,
        -66.29,
        -61.52,
        -62.07,
        -72.38,
        -93.7,
        -102.08,
        -99.47,
        -99.0
      ],
      "hoursE" : [
	60944,
	58686,
	51375.1,
	29317,
	30438.5,
	28945,
	33159.5,
	126329.6,
	130756.6,
	54608.7,
	36168.8,
	29128,
	28063.5,
	29054,
	32092,
	41932,
	53860,
	61456,
	61192,
	75678.7,
	108646.6,
	97496.7,
	73110.1,
	62064.5
	]
    }
  ]
}
Clone this wiki locally