opendaylight:从Java应用程序获取流统计信息失败

时间:2019-05-14 19:27:09

标签: opendaylight

我正在尝试从Java opendaylight应用程序(作为karaf功能运行)中读取流量统计信息。

我在Java应用程序中看到以下异常(作为opendaylight功能运行):

 java.util.concurrent.ExecutionException: org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationNotAvailableException: 
 No implementation of RPC AbsoluteSchemaPath{path=[(urn:opendaylight:flow:statistics?revision=2013-08-19)get-aggregate-flow-statistics-from-flow-table-for-given-match]} available

我的容器中安装了以下功能:

karaf> feature:list | grep openflow


   odl-openflowplugin-app-forwardingrules-manager  | 0.5.1            |          | Started     | odl-openflowplugin-app-forwardingrules-manager  | OpenDaylight :: Openflow Plugin :: Application -
   odl-openflowplugin-nxm-extensions               | 0.5.1            |          | Started     | odl-openflowplugin-nxm-extensions               | OpenDaylight :: Openflow Plugin :: Nicira Extensi
   odl-openflowplugin-nsf-model                    | 0.5.1            |          | Started     | odl-openflowplugin-nsf-model                    | OpenDaylight :: OpenflowPlugin :: NSF :: Model
   odl-openflowplugin-app-config-pusher            | 0.5.1            |          | Started     | odl-openflowplugin-app-config-pusher            | OpenDaylight :: Openflow Plugin :: Application -
   odl-openflowplugin-southbound                   | 0.5.1            |          | Started     | openflowplugin-0.5.1                            | OpenDaylight :: Openflow Plugin :: Li southbound
   odl-openflowjava-protocol                       | 0.5.1            |          | Started     | odl-openflowjava-0.5.1                          | ODL :: o                  openflowjava :: odl-openflowjava-protocol
   odl-openflowplugin-app-topology                 | 0.5.1            |          | Started     | odl-openflowplugin-app-topology                 | OpenDaylight :: Openflow Plugin :: Application -
   odl-openflowplugin-flow-services                | 0.5.1            |          | Started     | odl-openflowplugin-flow-services                | OpenDaylight :: Openflow Plugin :: Flow Services
   odl-openflowplugin-app-reconciliation-framework | 0.5.1            |          | Started     | odl-openflowplugin-app-reconciliation-framework | OpenDaylight :: Openflow Plugin :: Application -

当我发出以下REST RPC调用时,在opendaylight中会调用什么服务?

 curl -v -u admin:admin -X GET http://localhost:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0

我的目标是从opendaylight java应用程序(在容器中作为服务运行)执行相同的操作,但是我不知道该怎么做。

不确定我是否遵循正确的方法。

谢谢兰加

1 个答案:

答案 0 :(得分:0)

找出答案(ODL释放氮)。异常中的错误消息令人困惑。操作方法如下:

在节点下面的代码片段中,其类型为InstanceIdentifier

InstanceIdentifier outNode = node.firstIdentifierOf(Node.class);                         NodeRef nodeRef =新的NodeRef(outNode);

                    GetFlowStatisticsInputBuilder inputBuilder = new GetFlowStatisticsInputBuilder();

                    inputBuilder.setFlowName(flow.getFlowName());
                    inputBuilder.setMatch(flow.getMatch());
                    inputBuilder.setTableId(flow.getTableId());
                    inputBuilder.setInstructions(flow.getInstructions());
                    inputBuilder.setNode(nodeRef);



                    GetFlowStatisticsOutput output = directStatisticsService
                            .getFlowStatistics(inputBuilder.build()).get().getResult();

希望这对某人有帮助。