use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.PeerGroupStateAugmentation in project bgpcep by opendaylight.
the class PeerGroupStateCliUtils method displayState.
private static void displayState(final PeerGroup group, final ShellTable table) {
addHeader(table, "Peer Group state");
table.addRow().addContent("Peer Group Name", group.getPeerGroupName());
final State state = group.getState();
if (state == null) {
return;
}
final PeerGroupStateAugmentation aug = state.getAugmentation(PeerGroupStateAugmentation.class);
table.addRow().addContent("Total Prefixes", aug.getTotalPrefixes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.PeerGroupStateAugmentation in project bgpcep by opendaylight.
the class PeerGroupStateCliUtilsTest method testPeerGroupStateCli.
@Test
public void testPeerGroupStateCli() throws IOException {
final PeerGroupBuilder peerGroup = new PeerGroupBuilder().setPeerGroupName(TEST_GROUP);
final PeerGroupStateAugmentation groupState = new PeerGroupStateAugmentationBuilder().setTotalPrefixes(1L).setTotalPaths(2L).build();
peerGroup.setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.StateBuilder().addAugmentation(PeerGroupStateAugmentation.class, groupState).build());
PeerGroupStateCliUtils.displayPeerOperationalState(Collections.singletonList(peerGroup.build()), this.stream);
final String expected = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("peer-group.txt"), UTF8);
assertEquals(expected, this.output.toString());
}
Aggregations