Mod aaa-12 修复、屏蔽异常,目前的状态:可以正常获取cpu和内存信息;获取端口的代码被屏蔽了,因为NETCONF o-sr4版本的NetconfMessageTransformer类有bug,待升级新版本的NETCONF后,再重试。
RCA: SOL: 修改人:dongxiancun 检视人:dongxiancun
This commit is contained in:
parent
62a5d8eea4
commit
08101f68d7
|
@ -14,9 +14,14 @@ module device-status {
|
||||||
grouping cpu-status {
|
grouping cpu-status {
|
||||||
container cpu-infos {
|
container cpu-infos {
|
||||||
description "CPU的状态信息";
|
description "CPU的状态信息";
|
||||||
leaf usage-rate {
|
list cpu-info {
|
||||||
type int16 {
|
leaf position {
|
||||||
range "0..100";
|
type string ;
|
||||||
|
}
|
||||||
|
leaf usage-rate {
|
||||||
|
type int16 {
|
||||||
|
range "0..100";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,12 +30,17 @@ module device-status {
|
||||||
grouping mem-status {
|
grouping mem-status {
|
||||||
container memory-infos {
|
container memory-infos {
|
||||||
description "内存的状态信息";
|
description "内存的状态信息";
|
||||||
leaf memory-total {
|
list memory-info {
|
||||||
type int64 ;
|
leaf position {
|
||||||
}
|
type string ;
|
||||||
leaf usage-rate {
|
}
|
||||||
type int16 {
|
leaf memory-total {
|
||||||
range "0..100";
|
type int64 ;
|
||||||
|
}
|
||||||
|
leaf usage-rate {
|
||||||
|
type int16 {
|
||||||
|
range "0..100";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,8 @@ import com.google.common.util.concurrent.Futures;
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
import org.opendaylight.controller.md.sal.binding.api.*;
|
import org.opendaylight.controller.md.sal.binding.api.*;
|
||||||
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
|
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
|
||||||
|
import org.opendaylight.controller.md.sal.common.api.data.OptimisticLockFailedException;
|
||||||
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
|
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
|
||||||
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
|
|
||||||
import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
|
|
||||||
import org.opendaylight.yang.gen.v1.http.www.huawei.com.netconf.vrp.huawei.devm.rev181123.Devm;
|
import org.opendaylight.yang.gen.v1.http.www.huawei.com.netconf.vrp.huawei.devm.rev181123.Devm;
|
||||||
import org.opendaylight.yang.gen.v1.http.www.huawei.com.netconf.vrp.huawei.devm.rev181123.devm.CpuInfos;
|
import org.opendaylight.yang.gen.v1.http.www.huawei.com.netconf.vrp.huawei.devm.rev181123.devm.CpuInfos;
|
||||||
import org.opendaylight.yang.gen.v1.http.www.huawei.com.netconf.vrp.huawei.devm.rev181123.devm.MemoryInfos;
|
import org.opendaylight.yang.gen.v1.http.www.huawei.com.netconf.vrp.huawei.devm.rev181123.devm.MemoryInfos;
|
||||||
|
@ -30,10 +29,13 @@ import org.opendaylight.yang.gen.v1.http.www.huawei.com.netconf.vrp.huawei.ifm.r
|
||||||
import org.opendaylight.yang.gen.v1.http.www.huawei.com.netconf.vrp.huawei.ifm.rev181123.ifm.interfaces._interface.ipv4config.am4cfgaddrs.Am4CfgAddr;
|
import org.opendaylight.yang.gen.v1.http.www.huawei.com.netconf.vrp.huawei.ifm.rev181123.ifm.interfaces._interface.ipv4config.am4cfgaddrs.Am4CfgAddr;
|
||||||
import org.opendaylight.yang.gen.v1.http.www.huawei.com.netconf.vrp.huawei.ifm.rev181123.ifm.interfaces._interface.ipv6config.am6cfgaddrs.Am6CfgAddr;
|
import org.opendaylight.yang.gen.v1.http.www.huawei.com.netconf.vrp.huawei.ifm.rev181123.ifm.interfaces._interface.ipv6config.am6cfgaddrs.Am6CfgAddr;
|
||||||
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.NodeCpu;
|
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.NodeCpu;
|
||||||
|
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.NodeCpuBuilder;
|
||||||
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.NodeMemory;
|
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.NodeMemory;
|
||||||
|
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.NodeMemoryBuilder;
|
||||||
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.cpu.status.CpuInfosBuilder;
|
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.cpu.status.CpuInfosBuilder;
|
||||||
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.mem.status.MemoryInfosBuilder;
|
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.mem.status.MemoryInfosBuilder;
|
||||||
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.tp.extension.rev190809.TpExt;
|
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.tp.extension.rev190809.TpExt;
|
||||||
|
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.tp.extension.rev190809.TpExtBuilder;
|
||||||
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.tp.extension.rev190809.tp.status.TpInfos;
|
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.tp.extension.rev190809.tp.status.TpInfos;
|
||||||
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.tp.extension.rev190809.tp.status.TpInfosBuilder;
|
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.tp.extension.rev190809.tp.status.TpInfosBuilder;
|
||||||
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.tp.extension.rev190809.tp.status.tp.infos.IpAddress;
|
import org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.tp.extension.rev190809.tp.status.tp.infos.IpAddress;
|
||||||
|
@ -325,40 +327,47 @@ public class HuaweiNetconfSpeaker implements DataTreeChangeListener<ConnectorInf
|
||||||
} catch (ReadFailedException e) {
|
} catch (ReadFailedException e) {
|
||||||
throw new IllegalStateException("Unexpected error reading data from " + nodeId, e);
|
throw new IllegalStateException("Unexpected error reading data from " + nodeId, e);
|
||||||
}
|
}
|
||||||
List<org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.cpu.status.CpuInfos> ifcList = new ArrayList<>();
|
List<org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.cpu.status.cpu.infos.CpuInfo> ifcList = new ArrayList<>();
|
||||||
if (cupInfos.isPresent()) {
|
if (cupInfos.isPresent()) {
|
||||||
List<CpuInfo> cpuInfoList = cupInfos.get().getCpuInfo();
|
List<CpuInfo> cpuInfoList = cupInfos.get().getCpuInfo();
|
||||||
for (CpuInfo cpuInfo : cpuInfoList) {
|
for (CpuInfo cpuInfo : cpuInfoList) {
|
||||||
LOG.info("Show cpu with serial {},cpu usage is {} ",
|
LOG.info("Show cpu with serial {},cpu usage is {} ",
|
||||||
cpuInfo.getKey().getPosition(), cpuInfo.getSystemCpuUsage());
|
cpuInfo.getKey().getPosition(), cpuInfo.getSystemCpuUsage());
|
||||||
CpuInfosBuilder builder = new CpuInfosBuilder();
|
org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.cpu.status.cpu.infos.CpuInfo temp =
|
||||||
org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.cpu.status.CpuInfos temp = builder.setUsageRate(cpuInfo.getSystemCpuUsage().shortValue()).build();
|
new org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.cpu.status.cpu.infos.CpuInfoBuilder().setPosition(cpuInfo.getKey().getPosition())
|
||||||
|
.setUsageRate(cpuInfo.getSystemCpuUsage().shortValue()).build();
|
||||||
ifcList.add(temp);
|
ifcList.add(temp);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG.info("No data present on path '{}' for mountpoint: {}",
|
LOG.info("No data present on path '{}' for mountpoint: {}",
|
||||||
iid, nodeId);
|
iid, nodeId);
|
||||||
}
|
}
|
||||||
|
CpuInfosBuilder cpuInfosBuilder = new CpuInfosBuilder().setCpuInfo(ifcList);
|
||||||
//write cpu information to layer
|
//write cpu information to layer
|
||||||
InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.cpu.status.CpuInfos> cpuIid = NETCONF_TOPO_IID
|
InstanceIdentifier<NodeCpu> cpuIid = NETCONF_TOPO_IID
|
||||||
.child(Node.class, new NodeKey(new NodeId(nodeId)))
|
.child(Node.class, new NodeKey(new NodeId(nodeId)))
|
||||||
.augmentation(NodeCpu.class)
|
.augmentation(NodeCpu.class);
|
||||||
.child(org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.cpu.status.CpuInfos.class);
|
final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
|
||||||
for (int i = 0; i < ifcList.size(); i++) {
|
writeTransaction.put(LogicalDatastoreType.OPERATIONAL, cpuIid,
|
||||||
final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
|
new NodeCpuBuilder()
|
||||||
writeTransaction.put(LogicalDatastoreType.OPERATIONAL, cpuIid, ifcList.get(i));
|
.setCpuInfos(cpuInfosBuilder.build())
|
||||||
Futures.addCallback(writeTransaction.submit(), new FutureCallback<Void>() {
|
.build()
|
||||||
@Override
|
);
|
||||||
public void onFailure(Throwable throwable) {
|
Futures.addCallback(writeTransaction.submit(), new FutureCallback<Void>() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable throwable) {
|
||||||
|
if (throwable instanceof OptimisticLockFailedException) {
|
||||||
|
LOG.warn("Write cpu information 捕获 乐观锁异常,本次获取忽略!");
|
||||||
|
} else {
|
||||||
LOG.error("Write cpu information failed." + throwable.getMessage());
|
LOG.error("Write cpu information failed." + throwable.getMessage());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Void avoid) {
|
public void onSuccess(Void avoid) {
|
||||||
LOG.info("Write cpu information success.");
|
LOG.info("Write cpu information success.");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// Identifier path is equivalent to:
|
// Identifier path is equivalent to:
|
||||||
// '.../yang-ext:mount/huawei-devm:devm/memoryInfos'
|
// '.../yang-ext:mount/huawei-devm:devm/memoryInfos'
|
||||||
|
@ -372,98 +381,110 @@ public class HuaweiNetconfSpeaker implements DataTreeChangeListener<ConnectorInf
|
||||||
} catch (ReadFailedException e) {
|
} catch (ReadFailedException e) {
|
||||||
throw new IllegalStateException("Unexpected error reading data from " + nodeId, e);
|
throw new IllegalStateException("Unexpected error reading data from " + nodeId, e);
|
||||||
}
|
}
|
||||||
List<org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.mem.status.MemoryInfos> memoryList = new ArrayList<>();
|
List<org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.mem.status.memory.infos.MemoryInfo> memoryList = new ArrayList<>();
|
||||||
if (memoryInfosOptional.isPresent()) {
|
if (memoryInfosOptional.isPresent()) {
|
||||||
List<MemoryInfo> memoryInfoList = memoryInfosOptional.get().getMemoryInfo();
|
List<MemoryInfo> memoryInfoList = memoryInfosOptional.get().getMemoryInfo();
|
||||||
for (MemoryInfo memoryInfo : memoryInfoList) {
|
for (MemoryInfo memoryInfo : memoryInfoList) {
|
||||||
LOG.info("Show memory with serial {},cpu usage is {} ",
|
LOG.info("Show memory with serial {},memory usage is {} ",
|
||||||
memoryInfo.getKey().getPosition(), memoryInfo.getDoMemoryUsage());
|
memoryInfo.getKey().getPosition(), memoryInfo.getDoMemoryUsage());
|
||||||
MemoryInfosBuilder builder = new MemoryInfosBuilder();
|
|
||||||
LOG.info("Huawei Device {} OsMemoryTotal is: {}", nodeId, memoryInfo.getOsMemoryTotal());
|
LOG.info("Huawei Device {} OsMemoryTotal is: {}", nodeId, memoryInfo.getOsMemoryTotal());
|
||||||
org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.mem.status.MemoryInfos temp = builder.setMemoryTotal(memoryInfo.getOsMemoryTotal()).
|
org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.mem.status.memory.infos.MemoryInfo temp =
|
||||||
setUsageRate(memoryInfo.getOsMemoryUsage().shortValue()).build();
|
new org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.mem.status.memory.infos.MemoryInfoBuilder()
|
||||||
|
.setPosition(memoryInfo.getKey().getPosition())
|
||||||
|
.setMemoryTotal(memoryInfo.getOsMemoryTotal())
|
||||||
|
.setUsageRate(memoryInfo.getDoMemoryUsage().shortValue())
|
||||||
|
.build();
|
||||||
memoryList.add(temp);
|
memoryList.add(temp);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG.info("No data present on path '{}' for mountpoint: {}",
|
LOG.info("No data present on path '{}' for mountpoint: {}",
|
||||||
iid, nodeId);
|
iid, nodeId);
|
||||||
}
|
}
|
||||||
|
MemoryInfosBuilder memoryInfosBuilder = new MemoryInfosBuilder().setMemoryInfo(memoryList);
|
||||||
|
|
||||||
//write memory information to layer
|
//write memory information to layer
|
||||||
InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.mem.status.MemoryInfos> customMemoryIID = NETCONF_TOPO_IID
|
InstanceIdentifier<NodeMemory> customMemoryIID = NETCONF_TOPO_IID
|
||||||
.child(Node.class, new NodeKey(new NodeId(nodeId)))
|
.child(Node.class, new NodeKey(new NodeId(nodeId)))
|
||||||
.augmentation(NodeMemory.class)
|
.augmentation(NodeMemory.class);
|
||||||
.child(org.opendaylight.yang.gen.v1.urn.cmcc.cmhi.adaptation.layer.device.status.rev190809.mem.status.MemoryInfos.class);
|
final WriteTransaction writeTransaction2 = dataBroker.newWriteOnlyTransaction();
|
||||||
for (int i = 0; i < memoryList.size(); i++) {
|
writeTransaction2.put(LogicalDatastoreType.OPERATIONAL, customMemoryIID,
|
||||||
final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
|
new NodeMemoryBuilder()
|
||||||
writeTransaction.put(LogicalDatastoreType.OPERATIONAL, customMemoryIID, memoryList.get(i));
|
.setMemoryInfos(memoryInfosBuilder.build())
|
||||||
Futures.addCallback(writeTransaction.submit(), new FutureCallback<Void>() {
|
.build()
|
||||||
@Override
|
);
|
||||||
public void onFailure(Throwable throwable) {
|
Futures.addCallback(writeTransaction2.submit(), new FutureCallback<Void>() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable throwable) {
|
||||||
|
if (throwable instanceof OptimisticLockFailedException) {
|
||||||
|
LOG.warn("Write memory information 捕获 乐观锁异常,本次获取忽略!");
|
||||||
|
} else {
|
||||||
LOG.error("Write memory information failed." + throwable.getMessage());
|
LOG.error("Write memory information failed." + throwable.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Void avoid) {
|
|
||||||
LOG.info("Write memory information success.");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
InstanceIdentifier<Interfaces> interfacesIID =
|
|
||||||
InstanceIdentifier.create(Ifm.class).child(Interfaces.class);
|
|
||||||
|
|
||||||
Optional<Interfaces> interfacesOptional;
|
|
||||||
try {
|
|
||||||
// Read from a transaction is asynchronous, but a simple
|
|
||||||
// get/checkedGet makes the call synchronous
|
|
||||||
interfacesOptional = hwNodeReadTx.read(LogicalDatastoreType.OPERATIONAL, interfacesIID).checkedGet();
|
|
||||||
} catch (ReadFailedException e) {
|
|
||||||
throw new IllegalStateException("Unexpected error reading data from " + nodeId, e);
|
|
||||||
}
|
|
||||||
List<TpInfos> tpInfosList = new ArrayList<>();
|
|
||||||
if (interfacesOptional.isPresent()) {
|
|
||||||
List<Interface> interfaceList = interfacesOptional.get().getInterface();
|
|
||||||
for (Interface intf : interfaceList) {
|
|
||||||
LOG.info("Show memory with serial {},ipv4 config is {} ",
|
|
||||||
intf.getKey().getIfName(), intf.getIpv4Config());
|
|
||||||
TpInfosBuilder tpInfosBuilder = new TpInfosBuilder();
|
|
||||||
List<IpAddress> ipsOnIntf = getiplist(intf);
|
|
||||||
tpInfosBuilder.setIpAddress(ipsOnIntf);
|
|
||||||
tpInfosBuilder.setMtu(intf.getIfMtu().shortValue());
|
|
||||||
tpInfosBuilder.setTpName(intf.getIfName().getValue());
|
|
||||||
tpInfosBuilder.setTpNumber(intf.getIfNumber());
|
|
||||||
tpInfosBuilder.setTpAdminStatus(buildTpAdmin(intf.getIfAdminStatus()));
|
|
||||||
tpInfosBuilder.setTpPhyType(intf.getIfPhyType().getName());
|
|
||||||
tpInfosList.add(tpInfosBuilder.build());
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
LOG.info("No data present on path '{}' for mountpoint: {}",
|
|
||||||
iid, nodeId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Void avoid) {
|
||||||
|
LOG.info("Write memory information success.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//write interface information to layer
|
// InstanceIdentifier<Interfaces> interfacesIID =
|
||||||
for (int i = 0; i < tpInfosList.size(); i++) {
|
// InstanceIdentifier.create(Ifm.class).child(Interfaces.class);
|
||||||
InstanceIdentifier<TpInfos> tpinfosIID = NETCONF_TOPO_IID
|
//
|
||||||
.child(Node.class, new NodeKey(new NodeId(nodeId)))
|
// Optional<Interfaces> interfacesOptional;
|
||||||
.child(TerminationPoint.class, new TerminationPointKey(new TpId(tpInfosList.get(i).getTpName())))
|
// try {
|
||||||
.augmentation(TpExt.class).child(TpInfos.class);
|
// // Read from a transaction is asynchronous, but a simple
|
||||||
final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
|
// // get/checkedGet makes the call synchronous
|
||||||
writeTransaction.put(LogicalDatastoreType.OPERATIONAL, tpinfosIID, tpInfosList.get(i));
|
// interfacesOptional = hwNodeReadTx.read(LogicalDatastoreType.OPERATIONAL, interfacesIID).checkedGet();
|
||||||
Futures.addCallback(writeTransaction.submit(), new FutureCallback<Void>() {
|
// } catch (ReadFailedException e) {
|
||||||
@Override
|
// throw new IllegalStateException("Unexpected error reading data from " + nodeId, e);
|
||||||
public void onFailure(Throwable throwable) {
|
// }
|
||||||
LOG.error("Write tp information information failed." + throwable.getMessage());
|
// List<TpInfos> tpInfosList = new ArrayList<>();
|
||||||
}
|
// if (interfacesOptional.isPresent()) {
|
||||||
|
// List<Interface> interfaceList = interfacesOptional.get().getInterface();
|
||||||
@Override
|
// for (Interface intf : interfaceList) {
|
||||||
public void onSuccess(Void avoid) {
|
// LOG.info("Show memory with serial {},ipv4 config is {} ",
|
||||||
LOG.info("Write tp information information success.");
|
// intf.getKey().getIfName(), intf.getIpv4Config());
|
||||||
}
|
// TpInfosBuilder tpInfosBuilder = new TpInfosBuilder();
|
||||||
});
|
// List<IpAddress> ipsOnIntf = getiplist(intf);
|
||||||
}
|
// tpInfosBuilder.setIpAddress(ipsOnIntf);
|
||||||
|
// tpInfosBuilder.setMtu(intf.getIfMtu().shortValue());
|
||||||
|
// tpInfosBuilder.setTpName(intf.getIfName().getValue());
|
||||||
|
// tpInfosBuilder.setTpNumber(intf.getIfNumber());
|
||||||
|
// tpInfosBuilder.setTpAdminStatus(buildTpAdmin(intf.getIfAdminStatus()));
|
||||||
|
// tpInfosBuilder.setTpPhyType(intf.getIfPhyType().getName());
|
||||||
|
// tpInfosList.add(tpInfosBuilder.build());
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// LOG.info("No data present on path '{}' for mountpoint: {}",
|
||||||
|
// iid, nodeId);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// //write interface information to layer
|
||||||
|
// final WriteTransaction writeTransaction3 = dataBroker.newWriteOnlyTransaction();
|
||||||
|
// for (int i = 0; i < tpInfosList.size(); i++) {
|
||||||
|
// InstanceIdentifier<TpExt> tpinfosIID = NETCONF_TOPO_IID
|
||||||
|
// .child(Node.class, new NodeKey(new NodeId(nodeId)))
|
||||||
|
// .child(TerminationPoint.class, new TerminationPointKey(new TpId(tpInfosList.get(i).getTpName())))
|
||||||
|
// .augmentation(TpExt.class);
|
||||||
|
// writeTransaction3.put(LogicalDatastoreType.OPERATIONAL, tpinfosIID,
|
||||||
|
// new TpExtBuilder()
|
||||||
|
// .setTpInfos(tpInfosList.get(i))
|
||||||
|
// .build()
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// Futures.addCallback(writeTransaction3.submit(), new FutureCallback<Void>() {
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(Throwable throwable) {
|
||||||
|
// LOG.error("Write tp information information failed." + throwable.getMessage());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(Void avoid) {
|
||||||
|
// LOG.info("Write tp information information success.");
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue