ing
This commit is contained in:
parent
1c6ce5c1e0
commit
f7762f3060
2
pom.xml
2
pom.xml
|
@ -50,7 +50,7 @@
|
|||
<dependency>
|
||||
<groupId>com.loafle.overflow</groupId>
|
||||
<artifactId>commons-java</artifactId>
|
||||
<version>1.0.43-SNAPSHOT</version>
|
||||
<version>1.0.45-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -23,7 +23,6 @@ import com.loafle.overflow.model.meta.MetaInfraType;
|
|||
import com.loafle.overflow.model.meta.MetaPortType;
|
||||
import com.loafle.overflow.model.meta.MetaTargetHostType;
|
||||
import com.loafle.overflow.model.meta.MetaTargetZoneType;
|
||||
import com.loafle.overflow.model.noauthprobe.NoAuthProbeDescription;
|
||||
import com.loafle.overflow.service.central.infra.InfraService;
|
||||
import com.loafle.overflow.service.central.probe.ProbeService;
|
||||
|
||||
|
@ -270,7 +269,7 @@ public class CentralInfraService implements InfraService {
|
|||
return infras;
|
||||
}
|
||||
|
||||
public InfraHost registByNoAuthProbe(Long probeID, NoAuthProbeDescription noAuthProbeDescription)
|
||||
public InfraHost registByNoAuthProbe(Long probeID, InfraHost infraHost)
|
||||
throws OverflowException {
|
||||
// NoAuthProbeDescriptionNetwork networkInfo = noAuthProbeDescription.getNetwork();
|
||||
// InfraHostIP infraHostIP = new InfraHostIP();
|
||||
|
|
|
@ -16,7 +16,6 @@ import com.loafle.overflow.model.member.Member;
|
|||
import com.loafle.overflow.model.meta.MetaNoAuthProbeStatus;
|
||||
import com.loafle.overflow.model.meta.MetaProbeStatus;
|
||||
import com.loafle.overflow.model.noauthprobe.NoAuthProbe;
|
||||
import com.loafle.overflow.model.noauthprobe.NoAuthProbeDescription;
|
||||
import com.loafle.overflow.model.probe.Probe;
|
||||
import com.loafle.overflow.model.probe.ProbeHost;
|
||||
import com.loafle.overflow.service.central.apikey.ApiKeyService;
|
||||
|
@ -94,18 +93,18 @@ public class CentralNoAuthProbeService implements NoAuthProbeService {
|
|||
|
||||
@WebappAPI
|
||||
@Transactional
|
||||
public List<NoAuthProbe> acceptNoAuthProbe(Long noAuthProbeID) throws OverflowException {
|
||||
public List<NoAuthProbe> acceptNoAuthProbe(Long noAuthProbeID, String zoneCIDR) throws OverflowException {
|
||||
NoAuthProbe noAuthProbe = this.noAuthProbeDAO.findById(noAuthProbeID).get();
|
||||
|
||||
NoAuthProbeDescription noAuthProbeDescription = null;
|
||||
InfraHost infraHost = null;
|
||||
try {
|
||||
noAuthProbeDescription = this.objectMapper.readValue(noAuthProbe.getDescription(), NoAuthProbeDescription.class);
|
||||
infraHost = this.objectMapper.readValue(noAuthProbe.getInfraHostMeta(), InfraHost.class);
|
||||
} catch (IOException e) {
|
||||
throw new OverflowException("json error", e);
|
||||
}
|
||||
|
||||
Probe probe = this.newProbe(noAuthProbe, noAuthProbeDescription);
|
||||
InfraHost host = this.infraService.registByNoAuthProbe(probe.getId(), noAuthProbeDescription);
|
||||
Probe probe = this.newProbe(noAuthProbe, infraHost);
|
||||
InfraHost host = this.infraService.registByNoAuthProbe(probe.getId(), infraHost);
|
||||
this.newProbeHost(host, probe);
|
||||
|
||||
noAuthProbe.setMetaNoAuthProbeStatus(new MetaNoAuthProbeStatus((short) 1));
|
||||
|
@ -117,7 +116,7 @@ public class CentralNoAuthProbeService implements NoAuthProbeService {
|
|||
return this.readAllByDomainID(noAuthProbe.getDomain().getId());
|
||||
}
|
||||
|
||||
private Probe newProbe(NoAuthProbe noauthprobe, NoAuthProbeDescription noAuthProbeDescription)
|
||||
private Probe newProbe(NoAuthProbe noauthprobe, InfraHost infraHost)
|
||||
throws OverflowException {
|
||||
|
||||
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
|
@ -135,7 +134,7 @@ public class CentralNoAuthProbeService implements NoAuthProbeService {
|
|||
probe.setTargetCount(0);
|
||||
probe.setMetaProbeStatus(new MetaProbeStatus((short) 1));
|
||||
|
||||
String name = noAuthProbeDescription.getInfraHost().getInfraHostOS().getName();
|
||||
String name = infraHost.getInfraHostOS().getName();
|
||||
name += " probe";
|
||||
probe.setName(name);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user