use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Error in project netvirt by opendaylight.
the class ConfigureL3VpnCommand method deleteL3VpnCLI.
private void deleteL3VpnCLI() throws InterruptedException, ExecutionException {
if (vid == null) {
session.getConsole().println("Please supply a valid VPN ID");
session.getConsole().println(getHelp("delete"));
return;
}
Uuid vpnId = new Uuid(vid);
// disassociation of network(s) (removal of subnet(s)) from VPN to be followed by deletion of VPN
RpcResult<DissociateNetworksOutput> dissociateNetworksRpcResult = null;
List<Uuid> networkIdList = null;
networkIdList = neutronVpnManager.getNetworksForVpn(vpnId);
if (networkIdList != null && !networkIdList.isEmpty()) {
Future<RpcResult<DissociateNetworksOutput>> result = neutronvpnService.dissociateNetworks(new DissociateNetworksInputBuilder().setVpnId(vpnId).setNetworkId(networkIdList).build());
dissociateNetworksRpcResult = result.get();
if (dissociateNetworksRpcResult.isSuccessful()) {
session.getConsole().println("Subnet(s) removed from VPN successfully");
LOG.trace("dissociateNetworks: {}", result);
} else {
session.getConsole().println("Error while removing subnet(s) from VPN: " + result.get().getErrors());
session.getConsole().println(getHelp("delete"));
}
}
if (networkIdList == null || networkIdList.isEmpty() || dissociateNetworksRpcResult.isSuccessful()) {
List<Uuid> vpnIdList = new ArrayList<>();
vpnIdList.add(vpnId);
Future<RpcResult<DeleteL3VPNOutput>> result = neutronvpnService.deleteL3VPN(new DeleteL3VPNInputBuilder().setId(vpnIdList).build());
RpcResult<DeleteL3VPNOutput> rpcResult = result.get();
if (rpcResult.isSuccessful()) {
session.getConsole().println("L3VPN deleted successfully");
LOG.trace("deletel3vpn: {}", result);
} else {
session.getConsole().println("Error populating deleteL3VPN : " + result.get().getErrors());
session.getConsole().println(getHelp("delete"));
}
} else {
session.getConsole().println("Not proceeding with deletion of L3VPN since error(s) encountered " + "in removing subnet(s) from VPN");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Error in project controller by opendaylight.
the class ClusterAdminRpcServiceTest method verifyShardResults.
private static void verifyShardResults(List<ShardResult> shardResults, ShardResult... expShardResults) {
Map<String, ShardResult> expResultsMap = new HashMap<>();
for (ShardResult r : expShardResults) {
expResultsMap.put(r.getShardName() + "-" + r.getDataStoreType(), r);
}
for (ShardResult result : shardResults) {
ShardResult exp = expResultsMap.remove(result.getShardName() + "-" + result.getDataStoreType());
assertNotNull(String.format("Unexpected result for shard %s, type %s", result.getShardName(), result.getDataStoreType()), exp);
assertEquals("isSucceeded", exp.isSucceeded(), result.isSucceeded());
if (exp.isSucceeded()) {
assertNull("Expected null error message", result.getErrorMessage());
} else {
assertNotNull("Expected error message", result.getErrorMessage());
}
}
if (!expResultsMap.isEmpty()) {
fail("Missing shard results for " + expResultsMap.keySet());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Error in project bgpcep by opendaylight.
the class BGPSessionImplTest method testHandleOpenMsg.
@Test
public void testHandleOpenMsg() throws BGPDocumentedException {
this.bgpSession.handleMessage(this.classicOpen);
Assert.assertEquals(State.IDLE, this.bgpSession.getState());
Assert.assertEquals(1, this.receivedMsgs.size());
Assert.assertTrue(this.receivedMsgs.get(0) instanceof Notify);
final Notify error = (Notify) this.receivedMsgs.get(0);
Assert.assertEquals(BGPError.FSM_ERROR.getCode(), error.getErrorCode().shortValue());
Assert.assertEquals(BGPError.FSM_ERROR.getSubcode(), error.getErrorSubcode().shortValue());
Mockito.verify(this.speakerListener).close();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Error in project bgpcep by opendaylight.
the class PcepStateUtils method displayNodeState.
private static void displayNodeState(final String topologyId, final String nodeId, final PcepSessionState pcepSessionState, final PrintStream stream) {
final ShellTable table = new ShellTable();
table.column("Attribute").alignLeft();
table.column("Value").alignLeft();
showNodeState(table, topologyId, nodeId, pcepSessionState);
addHeader(table, "Local preferences");
final LocalPref localPref = pcepSessionState.getLocalPref();
showPreferences(table, localPref);
final PcepEntityIdStatsAug entAug = localPref.getAugmentation(PcepEntityIdStatsAug.class);
if (entAug != null) {
table.addRow().addContent("Speaker Entity Identifier", Arrays.toString(entAug.getSpeakerEntityIdValue()));
}
addHeader(table, "Peer preferences");
final PeerPref peerPref = pcepSessionState.getPeerPref();
showPreferences(table, peerPref);
showCapabilities(table, pcepSessionState.getPeerCapabilities());
final Messages messages = pcepSessionState.getMessages();
showMessages(table, messages);
final ErrorMessages error = messages.getErrorMessages();
showErrorMessages(table, error);
final ReplyTime reply = messages.getReplyTime();
showReplyMessages(table, reply);
table.print(stream);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Error in project bgpcep by opendaylight.
the class OperationResults method getErrorFor.
private static Errors getErrorFor(final PCEPErrors error) {
final ErrorsBuilder builder = new ErrorsBuilder();
builder.setErrorObject(new ErrorObjectBuilder().setType(error.getErrorType()).setValue(error.getErrorValue()).build());
return builder.build();
}
Aggregations