type uint32;
}
+ typedef bucket-id {
+ type uint32;
+ }
+
typedef group-types {
type enumeration {
enum group-all;
container buckets {
list bucket {
- key "order";
- leaf order {
- type int32;
+ key "bucket-id";
+ leaf bucket-id {
+ type bucket-id;
}
leaf weight {
grouping group-statistics {
leaf group-id {
- type int32;
+ type group-id;
}
leaf ref-count {
container buckets {
list bucket-counter {
- key "order";
- leaf order {
- type int32;
+ key "bucket-id";
+ leaf bucket-id {
+ type bucket-id;
}
leaf packet-count {
grouping group-statistics-request {
list group-stats {
key "group-id";
-
leaf group-id {
- type int32;
+ type group-id;
}
}
}
grouping group-statistics-reply {
list group-stats {
- key "group-stats-order";
- leaf group-stats-order {
- type int32;
- }
-
+ key "group-id";
uses group-statistics;
}
}
grouping group-desc-stats-reply {
list group-desc-stats {
- key "order-id";
- leaf order-id {
- type int32;
- }
-
+ key "group-id";
uses group;
}
}
}
typedef meter-id {
- type uint32;
+ type uint32;
+ }
+ typedef band-id {
+ type uint32;
}
typedef meter-flags {
container meter-band-headers {
list meter-band-header {
- key "order";
- leaf order {
- type int32;
+ key "band-id";
+ leaf band-id {
+ type band-id;
}
container meter-band-types {
grouping meter-statistics {
leaf meter-id {
- type int32;
+ type meter-id;
}
leaf flow-count {
container meter-band-stats {
list band-stat {
- key "order";
- leaf order {
- type int32;
+ key "band-id";
+ leaf band-id {
+ type band-id;
}
leaf packet-band-count {
grouping meter-stats-config-request {
list meter-stats {
key "meter-id";
-
leaf meter-id {
- type int32;
+ type meter-id;
}
}
}
grouping meter-statistics-reply {
list meter-stats {
- key "meter-stats-order";
- leaf meter-stats-order {
- type int32;
- }
+ key "meter-id";
uses meter-statistics;
}
}
grouping meter-config-stats-reply {
list meter-config-stats {
- key "meter-config-order";
- leaf meter-config-order {
- type int32;
- }
-
+ key "meter-id";
uses meter;
}
}
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionInputBuilder;
return;
for (Node targetNode : targetNodes){
-
-
- //We need to add check, so see if groups/meters are supported
- //by the target node. Below check doesn't look good.
- if(targetNode.getId().getValue().contains("openflow:")){
+
+ if(targetNode.getAugmentation(FlowCapableNode.class) != null){
+
spLogger.info("Send request for stats collection to node : {})",targetNode.getId());
+
InstanceIdentifier<Node> targetInstanceId = InstanceIdentifier.builder(Nodes.class).child(Node.class,targetNode.getKey()).toInstance();
NodeRef targetNodeRef = new NodeRef(targetInstanceId);
//Update augmented data
nodeData.addAugmentation(NodeGroupDescStats.class, groupDesc.build());
-
+
InstanceIdentifier<? extends Object> refValue = ref.getValue();
it.putOperationalData(refValue, nodeData.build());
it.commit();
DataModificationTransaction it = this.statisticsManager.startChange();
NodeKey key = new NodeKey(notification.getId());
NodeRef ref = getNodeRef(key);
-
+
final NodeBuilder nodeData = new NodeBuilder();
nodeData.setKey(key);
GroupStatisticsBuilder stats = new GroupStatisticsBuilder();
stats.setGroupStats(notification.getGroupStats());
groupStats.setGroupStatistics(stats.build());
-
+
//Update augmented data
nodeData.addAugmentation(NodeGroupStatistics.class, groupStats.build());
-
+
InstanceIdentifier<? extends Object> refValue = ref.getValue();
it.putOperationalData(refValue, nodeData.build());
it.commit();
+
+// for (GroupStats groupstat : notification.getGroupStats()) {
+//
+// GroupStatsKey groupKey = groupstat.getKey();
+// InstanceIdentifier<? extends Object> id = InstanceIdentifier.builder(Nodes.class).child(Node.class, key).augmentation(NodeGroupStatistics.class).child(GroupStatistics.class).child(GroupStats.class,groupKey).toInstance();
+// it.putOperationalData(id, groupstat);
+// it.commit();
+// }
}
@Override