use of org.onosproject.openstacktelemetry.codec.rest.FlowInfoJsonCodec in project onos by opennetworkinglab.
the class OpenstackRestCodecRegister method activate.
@Activate
protected void activate() {
codecService.registerCodec(StatsInfo.class, new StatsInfoJsonCodec());
codecService.registerCodec(FlowInfo.class, new FlowInfoJsonCodec());
codecService.registerCodec(StatsFlowRule.class, new StatsFlowRuleJsonCodec());
codecService.registerCodec(TelemetryConfig.class, new TelemetryConfigJsonCodec());
log.info("Started");
}
use of org.onosproject.openstacktelemetry.codec.rest.FlowInfoJsonCodec in project onos by opennetworkinglab.
the class OpenstackTelemetryWebResource method getFlowInfoBulk.
/**
* Get flow information list.
*
* @return Flow information list
*/
@GET
@Path("list")
@Produces(MediaType.APPLICATION_JSON)
public Response getFlowInfoBulk() {
log.info("GET BULK FLOW RULE");
Set<FlowInfo> flowInfoSet;
flowInfoSet = statsFlowRuleService.getOverlayFlowInfos();
JsonCodec<FlowInfo> flowInfoCodec = new FlowInfoJsonCodec();
ObjectNode nodeJson;
int idx = 0;
for (FlowInfo flowInfo : flowInfoSet) {
nodeJson = flowInfoCodec.encode(flowInfo, this);
root.put("FlowInfo" + idx++, nodeJson.toString());
}
return ok(root).build();
}
Aggregations