gre_key = i;
break;
}
} catch (NeutronRestApiException e) {
s_logger.error("Failed to list existing networks on the ODL Controller", e);
return new ConfigureNetworkAnswer(cmd, e);
}
NeutronNetwork newNetwork = new NeutronNetwork();
// Configuration from the command
newNetwork.setName(cmd.getName());
newNetwork.setTenantId(cmd.getTenantId());
// Static configuation
newNetwork.setNetworkType("gre");
newNetwork.setShared(false);
newNetwork.setSegmentationId(gre_key);
newNetwork.setId(UUID.randomUUID());
NeutronNetworkWrapper wrapper = new NeutronNetworkWrapper();
wrapper.setNetwork(newNetwork);
try {
wrapper = configureNetwork.createNeutronNetwork(wrapper);
} catch (NeutronRestApiException e) {
s_logger.error("createNeutronNetwork failed", e);
return new ConfigureNetworkAnswer(cmd, e);
}
return new ConfigureNetworkAnswer(cmd, true, null, wrapper.getNetwork().getId().toString());
}