return new DestroyNetworkAnswer(cmd, true, "Network " + cmd.getNetworkUuid() + " deleted");
}
private Answer executeRequest(ConfigurePortCommand cmd) {
NeutronPortsNorthboundAction configurePort = new NeutronPortsNorthboundAction(controllerUrl, controllerUsername, controllerPassword);
NeutronPort newPort = new NeutronPort();
// Configuration from the command
newPort.setId(cmd.getPortId());
newPort.setTenantId(cmd.getTennantId());
newPort.setAdminStateUp(true);
newPort.setName(cmd.getPortId().toString());
newPort.setNetworkId(cmd.getNetworkId());
newPort.setMacAddress(cmd.getMacAddress());
newPort.setDeviceId(UUID.randomUUID());
// Static valus
newPort.setStatus("ACTIVE");
newPort.setFixedIps(Collections.<String> emptyList());
NeutronPortWrapper portWrapper = new NeutronPortWrapper();
portWrapper.setPort(newPort);
try {
portWrapper = configurePort.createNeutronPort(portWrapper);