-
Notifications
You must be signed in to change notification settings - Fork 2
Consumer social networks
RESTful protocol for Consumer social networks.
A CSN graph can be created for a Run, so it can only be applied on existing Runs. CSN Graphs cannot be updated, only created or deleted.
POST /api/csn | create
Creates a new Graph based on the graph creation parameters. Schema: Graph.schema
example:
curl -k -i --data @graph.json --header Content-type:application/json https://localhost:8443/cassandra/api/csn
Produces: Route, JSON
{
"prj_id" : "51b4be46712e87092cbe7f27",
"run_id" : "f",
"graphType" : "MinReactivePowerPerHour",
"minWeight" : 1.1,
"noedges" : false
}
Produces: JSON
{
"success": true,
"message": "Graph created successfully",
"data": {
"prj_id": "51b4be46712e87092cbe7f27",
"run_id": "f",
"graphType": "MinReactivePowerPerHour",
"minWeight": 1.1,
"noedges": false,
"_id": "5200db3ae4b0e3c03fd40d59",
"NumberOfNodes": 3,
"NumberOfEdges": 3
}
}
GET /api/csn | index
example:
curl -k -i --header Content-type:application/json https://localhost:8443/cassandra/api/csn?run_id=f
Retrieves the CSN graphs for a Run
Consumes: Route, Parameter
Produces: JSON
{
"success": true,
"message": "CSN graphs retrieved successfully",
"size": 2,
"data": [
{
"_id": "51e3e174e4b00332065e92d6",
"graphType": "MaxConsumptionP",
"minWeight": 100.0,
"noedges": "false"
},
{
"_id": "51e42dbae4b0826b7fc71a0d",
"graphType": "PersonType",
"minWeight": 100.0,
"noedges": "false"
}
]
}
curl -k -i -X DELETE 'https://localhost:8443/cassandra/api/csn?graph_id=516d0a0e4b0d67558c1625e'
Deletes the existing Graph along with its nodes and edges.
Consumes: Route
Produces: Delete status
{
"name": "Graph",
"type": "object",
"description": "Setting to create a graph",
"properties": {
"prj_id" : {
"type": "string",
"optional": true
},
"run_id" : {
"type": "string",
"optional": false
},
"img_path" : {
"type": "string",
"optional": true
},
"graphType": {
"type": "string",
"description": "The Scenario this Installation belongs to",
"enum": [
"InstallationType",
"PersonType",
"TransformerID",
"TopologicalDistance",
"Location",
"SocialDistance",
"TotalEnergyConsumption",
"MaxHourlyEnergyConsumption",
"MinHourlyEnergyConsumption",
"AverageActivePowerPerHour",
"AverageReactivePowerPerHour",
"MaxActivePowerPerHour",
"MaxReactivePowerPerHour",
"MinActivePowerPerHour",
"MinReactivePowerPerHour"
],
"optional": false
},
"minWeight": {
"type": "number",
"description": "Min weight threshold",
"optional": false
},
"noedges": {
"type": "boolean",
"description": "If true then don't create edges",
"optional": true
}
},
"additionalProperties" : true
}