Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

Revision history [back]

click to hide/show revision 1
initial version

two questions about "odl"

1.why after yangtools is updated, the code of the odl will report errors.

2.how to get the traffic counter(ReceiveBytes& TransmitBytes) of every link. Below is my method, but I cannot get the traffic statistics coding: InstanceIdentifier<nodes> nodeIdentifier = InstanceIdentifier.builder(Nodes.class).toInstance(); Nodes nodeList = (Nodes) dataService.readOperationalData(nodeIdentifier); FlowCapableNodeConnectorStatisticsData nodeConnectorStatisticsData = null; for (Node node : nodeList.getNode()) { List<nodeconnector> nodeConnectors = node.getNodeConnector(); for (NodeConnector nodeConnector : nodeConnectors) { nodeConnectorStatisticsData = nodeConnector.getAugmentation(FlowCapableNodeConnectorStatisticsData.class); nodeConnectorStatisticsData.getFlowCapableNodeConnectorStatistics().getBytes(); } }

two questions about "odl"

1.why after yangtools is updated, the code of the odl will report errors.

2.how to get the traffic counter(ReceiveBytes& TransmitBytes) of every link. Below is my method, but I cannot get the traffic statistics coding: InstanceIdentifier<nodes> nodeIdentifier = InstanceIdentifier.builder(Nodes.class).toInstance(); InstanceIdentifier.builder(Nodes.class).toInstance();

            Nodes nodeList = (Nodes) dataService.readOperationalData(nodeIdentifier);
              FlowCapableNodeConnectorStatisticsData nodeConnectorStatisticsData = null;
              for (Node node : nodeList.getNode()) {
                    List<nodeconnector> 
                List<NodeConnector> nodeConnectors = node.getNodeConnector();
                  for (NodeConnector nodeConnector : nodeConnectors) {
                      nodeConnectorStatisticsData = nodeConnector.getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
                      nodeConnectorStatisticsData.getFlowCapableNodeConnectorStatistics().getBytes();
                  }
                }

}

two questions about "odl"

1.why after yangtools is updated, the code of the odl will report errors.

2.how to get the traffic counter(ReceiveBytes& TransmitBytes) of every link. Below is my method, but I cannot get the traffic statistics coding: InstanceIdentifier<nodes> nodeIdentifier = InstanceIdentifier.builder(Nodes.class).toInstance();coding:

InstanceIdentifier<Nodes> nodeIdentifier = InstanceIdentifier.builder(Nodes.class).toInstance();
            Nodes nodeList = (Nodes) dataService.readOperationalData(nodeIdentifier);
             FlowCapableNodeConnectorStatisticsData nodeConnectorStatisticsData = null;
             for (Node node : nodeList.getNode()) {
                 List<NodeConnector> nodeConnectors = node.getNodeConnector();
                 for (NodeConnector nodeConnector : nodeConnectors) {
                     nodeConnectorStatisticsData = nodeConnector.getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
                     nodeConnectorStatisticsData.getFlowCapableNodeConnectorStatistics().getBytes();
                 }
             }

two questions about "odl"

1.why after yangtools is updated, the code of the odl will report errors.

2.how to get the traffic counter(ReceiveBytes& TransmitBytes) of every link. Below is my method, but I cannot get the traffic statistics coding:statistics

InstanceIdentifier<Nodes> nodeIdentifier = InstanceIdentifier.builder(Nodes.class).toInstance();
            Nodes nodeList = (Nodes) dataService.readOperationalData(nodeIdentifier);
            FlowCapableNodeConnectorStatisticsData nodeConnectorStatisticsData = null;
            for (Node node : nodeList.getNode()) {
                List<NodeConnector> nodeConnectors = node.getNodeConnector();
                for (NodeConnector nodeConnector : nodeConnectors) {
                    nodeConnectorStatisticsData = nodeConnector.getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
                    nodeConnectorStatisticsData.getFlowCapableNodeConnectorStatistics().getBytes();
                }
            }

two one questions about "odl"

1.why after yangtools is updated, the code of the odl will report errors.

2.how how to get the traffic counter(ReceiveBytes& TransmitBytes) of every link. Below is my method, but I cannot get the traffic statistics

InstanceIdentifier<Nodes> nodeIdentifier = InstanceIdentifier.builder(Nodes.class).toInstance();
            Nodes nodeList = (Nodes) dataService.readOperationalData(nodeIdentifier);
            FlowCapableNodeConnectorStatisticsData nodeConnectorStatisticsData = null;
            for (Node node : nodeList.getNode()) {
                List<NodeConnector> nodeConnectors = node.getNodeConnector();
                for (NodeConnector nodeConnector : nodeConnectors) {
                    nodeConnectorStatisticsData = nodeConnector.getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
                    nodeConnectorStatisticsData.getFlowCapableNodeConnectorStatistics().getBytes();
                }
            }

one questions about "odl"

how to get the traffic counter(ReceiveBytes& TransmitBytes) of every link. Below is my method, but I cannot get the traffic statistics

InstanceIdentifier<Nodes> nodeIdentifier = InstanceIdentifier.builder(Nodes.class).toInstance();
            Nodes nodeList = (Nodes) dataService.readOperationalData(nodeIdentifier);
            FlowCapableNodeConnectorStatisticsData nodeConnectorStatisticsData = null;
            for (Node node : nodeList.getNode()) {
                List<NodeConnector> nodeConnectors = node.getNodeConnector();
                for (NodeConnector nodeConnector : nodeConnectors) {
                    nodeConnectorStatisticsData = nodeConnector.getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
                    nodeConnectorStatisticsData.getFlowCapableNodeConnectorStatistics().getBytes();
                }
            }

one questions about "odl"how to get the node connector statistics(ReceiveBytes& TransmitBytes) of every node

how to get the traffic counter(ReceiveBytes& node connector statistics(ReceiveBytes& TransmitBytes) of every link. node. Below is my method, but I cannot get the traffic got node connector statistics

 GetAllNodeConnectorsStatisticsInputBuilder b = new GetAllNodeConnectorsStatisticsInputBuilder();
            InstanceIdentifier<Nodes> nodeIdentifier = InstanceIdentifier.builder(Nodes.class).toInstance();
            Nodes nodeList = (Nodes) dataService.readOperationalData(nodeIdentifier);
            FlowCapableNodeConnectorStatisticsData nodeConnectorStatisticsData = null;
            for (Node node if(nodeList != null){
                for(Node n : nodeList.getNode()) {
                List<NodeConnector> nodeConnectors = node.getNodeConnector();
                for (NodeConnector nodeConnector nodeList.getNode()){
                    InstanceIdentifier<Node> iNode = InstanceIdentifier
                                .builder(Nodes.class)
                                .child(Node.class,n.getKey())
                                .toInstance();
                    NodeRef nr = new NodeRef(iNode);
                    b.setNode(nr);
                    Future<RpcResult<GetAllNodeConnectorsStatisticsOutput>> o = portStatisticsService.getAllNodeConnectorsStatistics(b.build());
                    try{
                        RpcResult<GetAllNodeConnectorsStatisticsOutput> ro = o.get();
                        GetAllNodeConnectorsStatisticsOutput nro = ro.getResult();
                        List<NodeConnectorStatisticsAndPortNumberMap> nrolist = nro.getNodeConnectorStatisticsAndPortNumberMap();
                        if(null != nrolist){
                            for(NodeConnectorStatisticsAndPortNumberMap nodeConnectorStatistics : nodeConnectors) {
                    nodeConnectorStatisticsData = nodeConnector.getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
                    nodeConnectorStatisticsData.getFlowCapableNodeConnectorStatistics().getBytes();
nrolist){
                                nodeConnectorStatistics.getBytes();
                            }
                        }
                    }catch(Exception e){
                        e.printStackTrace();
                    }
                }
            }

there is the method that got node connector statistics from each node. In this code, O return null,

 Future<RpcResult<GetAllNodeConnectorsStatisticsOutput>> o = portStatisticsService.getAllNodeConnectorsStatistics(b.build());

and also NodeConnectorStatisticsAndPortNumberMap return null.

So I wonder know is that method getting wrong or just argument was not sending.

thanks!