use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.add.lsp.args.ArgumentsBuilder in project bgpcep by opendaylight.
the class Stateful07TopologySessionListenerTest method createAddLspInput.
private AddLspInput createAddLspInput() {
final ArgumentsBuilder argsBuilder = new ArgumentsBuilder();
final Ipv4CaseBuilder ipv4Builder = new Ipv4CaseBuilder();
ipv4Builder.setIpv4(new Ipv4Builder().setSourceIpv4Address(new Ipv4Address(this.testAddress)).setDestinationIpv4Address(new Ipv4Address(this.testAddress)).build());
argsBuilder.setEndpointsObj(new EndpointsObjBuilder().setAddressFamily(ipv4Builder.build()).build());
argsBuilder.setEro(createEroWithIpPrefixes(Lists.newArrayList(this.eroIpPrefix)));
argsBuilder.addAugmentation(Arguments2.class, new Arguments2Builder().setLsp(new LspBuilder().setDelegate(true).setAdministrative(true).build()).build());
return new AddLspInputBuilder().setName(this.tunnelName).setArguments(argsBuilder.build()).setNetworkTopologyRef(new NetworkTopologyRef(TOPO_IID)).setNode(this.nodeId).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.add.lsp.args.ArgumentsBuilder in project bgpcep by opendaylight.
the class CreateTunnelInstructionExecutor method buildArguments.
private Arguments buildArguments(final TerminationPoint sp, final TerminationPoint dp) {
final ArgumentsBuilder args = new ArgumentsBuilder();
if (this.p2pTunnelInput.getBandwidth() != null) {
args.setBandwidth(new BandwidthBuilder().setBandwidth(this.p2pTunnelInput.getBandwidth()).build());
}
if (this.p2pTunnelInput.getClassType() != null) {
args.setClassType(new ClassTypeBuilder().setClassType(this.p2pTunnelInput.getClassType()).build());
}
args.setEndpointsObj(new EndpointsObjBuilder().setAddressFamily(buildAddressFamily(sp, dp)).build());
args.setEro(TunelProgrammingUtil.buildEro(this.p2pTunnelInput.getExplicitHops()));
args.setLspa(new LspaBuilder(this.p2pTunnelInput).build());
final AdministrativeStatus adminStatus = this.p2pTunnelInput.augmentation(PcepCreateP2pTunnelInput1.class).getAdministrativeStatus();
if (adminStatus != null) {
args.addAugmentation(new Arguments2Builder().setLsp(new LspBuilder().setAdministrative(adminStatus == AdministrativeStatus.Active).build()).build());
}
return args.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.add.lsp.args.ArgumentsBuilder in project bgpcep by opendaylight.
the class TopologyProgrammingTest method testSubmitEnsureLsp.
@Test
public void testSubmitEnsureLsp() {
final var captor = ArgumentCaptor.forClass(EnsureLspOperationalInput.class);
doReturn(Futures.immediateFuture(Optional.empty())).when(listener).ensureLspOperational(captor.capture());
topologyProgramming.submitEnsureLspOperational(new SubmitEnsureLspOperationalInputBuilder().setName(NAME).setNode(nodeId).setArguments(new ArgumentsBuilder().build()).build());
final var ensureLspInput = captor.getValue();
assertNotNull(ensureLspInput);
assertEquals(NAME, ensureLspInput.getName());
assertEquals(nodeId, ensureLspInput.getNode());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.add.lsp.args.ArgumentsBuilder in project bgpcep by opendaylight.
the class PCEPTopologySessionListenerTest method createAddLspInput.
private AddLspInput createAddLspInput() {
final ArgumentsBuilder argsBuilder = new ArgumentsBuilder();
final Ipv4CaseBuilder ipv4Builder = new Ipv4CaseBuilder();
ipv4Builder.setIpv4(new Ipv4Builder().setSourceIpv4Address(new Ipv4AddressNoZone(testAddress)).setDestinationIpv4Address(new Ipv4AddressNoZone(testAddress)).build());
argsBuilder.setEndpointsObj(new EndpointsObjBuilder().setAddressFamily(ipv4Builder.build()).build());
argsBuilder.setEro(createEroWithIpPrefixes(Lists.newArrayList(eroIpPrefix)));
argsBuilder.addAugmentation(new Arguments2Builder().setLsp(new LspBuilder().setDelegate(TRUE).setAdministrative(TRUE).build()).build());
return new AddLspInputBuilder().setName(tunnelName).setArguments(argsBuilder.build()).setNetworkTopologyRef(new NetworkTopologyRef(TOPO_IID)).setNode(nodeId).build();
}
Aggregations