use of org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.Root in project netvirt by opendaylight.
the class EtreeInterfaceAdd method doExecute.
@Override
protected Object doExecute() {
EtreeInterfaceType inputType = null;
for (EtreeInterfaceType type : EtreeInterfaceType.values()) {
if (interfaceType.equals(type.getName())) {
inputType = type;
break;
}
}
if (inputType == null) {
session.getConsole().println("interfaceType must be one of: leaf/root, but was: " + interfaceType);
return null;
}
ElanInstance elanInstance = elanProvider.getElanInstance(elanName);
if (elanInstance == null) {
session.getConsole().println("Etree instance " + elanName + " does not exist.");
return null;
} else {
if (elanInstance.getAugmentation(EtreeInstance.class) == null) {
session.getConsole().println("Etree instance " + elanName + " exists but isn't configured as Etree.");
return null;
}
}
LOG.debug("Executing create EtreeInterface command elanName:{}, interfaceName:{}, interfaceType:{}," + "staticMacAddresses:{}, elanInterfaceDescr:{}", elanName, interfaceName, interfaceType, staticMacAddresses, elanInterfaceDescr);
elanProvider.addEtreeInterface(elanName, interfaceName, inputType, staticMacAddresses, elanInterfaceDescr);
session.getConsole().println("Created etree interface successfully");
return null;
}
Aggregations