Search in sources :

Example 1 with PeerGroupStateAugmentation

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());
}
Also used : State(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.State) PeerGroupStateAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.PeerGroupStateAugmentation)

Example 2 with PeerGroupStateAugmentation

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());
}
Also used : PeerGroupStateAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.PeerGroupStateAugmentationBuilder) PeerGroupBuilder(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.peer.group.PeerGroupBuilder) PeerGroupStateAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.PeerGroupStateAugmentation) Test(org.junit.Test)

Aggregations

PeerGroupStateAugmentation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.PeerGroupStateAugmentation)2 Test (org.junit.Test)1 State (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.State)1 PeerGroupBuilder (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.peer.group.PeerGroupBuilder)1 PeerGroupStateAugmentationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.PeerGroupStateAugmentationBuilder)1