use of org.opennms.netmgt.provision.persist.requisition.RequisitionMonitoredService in project opennms by OpenNMS.
the class RequisitionBuilder method withContainer.
public RequisitionBuilder withContainer(final ContainerAlias alias, final String... services) {
// We're assuming that the Minion container is on the same
// host as the service containers
final ContainerInfo containerInfo = minionSystem.getContainerInfo(alias);
final String containerIpAddr = containerInfo.networkSettings().ipAddress();
RequisitionNode node = new RequisitionNode();
node.setNodeLabel(alias.toString());
node.setForeignId(alias.toString());
RequisitionInterface iface = new RequisitionInterface();
iface.setSnmpPrimary(PrimaryType.PRIMARY);
iface.setIpAddr(containerIpAddr);
for (String svcName : services) {
RequisitionMonitoredService svc = new RequisitionMonitoredService();
svc.setServiceName(svcName);
iface.putMonitoredService(svc);
}
node.putInterface(iface);
requisition.putNode(node);
return this;
}
Aggregations