Search in sources :

Example 1 with StatsFlowRuleAdminService

use of org.onosproject.openstacktelemetry.api.StatsFlowRuleAdminService in project onos by opennetworkinglab.

the class TelemetryVflowAddCommand method doExecute.

@Override
protected void doExecute() {
    StatsFlowRuleAdminService statsService = get(StatsFlowRuleAdminService.class);
    StatsFlowRule statsFlowRule = DefaultStatsFlowRule.builder().srcIpPrefix(IpPrefix.valueOf(srcIp)).dstIpPrefix(IpPrefix.valueOf(dstIp)).srcTpPort(TpPort.tpPort(Integer.valueOf(srcTpPort))).dstTpPort(TpPort.tpPort(Integer.valueOf(dstTpPort))).ipProtocol(getProtocolTypeFromString(ipProto)).build();
    statsService.createStatFlowRule(statsFlowRule);
    print("Added the stat flow rule.");
}
Also used : StatsFlowRule(org.onosproject.openstacktelemetry.api.StatsFlowRule) DefaultStatsFlowRule(org.onosproject.openstacktelemetry.api.DefaultStatsFlowRule) StatsFlowRuleAdminService(org.onosproject.openstacktelemetry.api.StatsFlowRuleAdminService)

Example 2 with StatsFlowRuleAdminService

use of org.onosproject.openstacktelemetry.api.StatsFlowRuleAdminService in project onos by opennetworkinglab.

the class TelemetryVflowDeleteCommand method doExecute.

@Override
protected void doExecute() {
    StatsFlowRuleAdminService statsService = get(StatsFlowRuleAdminService.class);
    StatsFlowRule statsFlowRule = DefaultStatsFlowRule.builder().srcIpPrefix(IpPrefix.valueOf(srcIp)).dstIpPrefix(IpPrefix.valueOf(dstIp)).srcTpPort(TpPort.tpPort(Integer.valueOf(srcTpPort))).dstTpPort(TpPort.tpPort(Integer.valueOf(dstTpPort))).ipProtocol(getProtocolTypeFromString(ipProto)).build();
    statsService.deleteStatFlowRule(statsFlowRule);
    print("Removed the stat flow rule.");
}
Also used : StatsFlowRule(org.onosproject.openstacktelemetry.api.StatsFlowRule) DefaultStatsFlowRule(org.onosproject.openstacktelemetry.api.DefaultStatsFlowRule) StatsFlowRuleAdminService(org.onosproject.openstacktelemetry.api.StatsFlowRuleAdminService)

Aggregations

DefaultStatsFlowRule (org.onosproject.openstacktelemetry.api.DefaultStatsFlowRule)2 StatsFlowRule (org.onosproject.openstacktelemetry.api.StatsFlowRule)2 StatsFlowRuleAdminService (org.onosproject.openstacktelemetry.api.StatsFlowRuleAdminService)2