protected String getHealthState(HealthcheckInstance hcInstance) { Instance instance = objectManager.loadResource(Instance.class, hcInstance.getInstanceId()); return instance == null ? null : instance.getHealthState(); }
@Override public List<? extends Instance> getInstances(Object obj) { if (!(obj instanceof HealthcheckInstanceHostMap)) { return null; } HealthcheckInstanceHostMap hostMap = (HealthcheckInstanceHostMap) obj; List<Instance> instances = new ArrayList<>(); HealthcheckInstance hInstance = objectManager.loadResource(HealthcheckInstance.class, hostMap.getHealthcheckInstanceId()); if (hInstance == null || hInstance.getRemoved() != null) { return instances; } Instance instance = objectManager.loadResource(Instance.class, hInstance.getInstanceId()); if (instance != null && instance.getRemoved() == null) { instances.add(instance); } return instances; } }
protected void processHealthcheckInstance(HealthcheckInstanceHostMap hcihm, String healthState) { HealthcheckInstance hcInstance = objectManager.loadResource(HealthcheckInstance.class, hcihm.getHealthcheckInstanceId()); String updateWithState = determineNewHealthState(hcInstance, hcihm, healthState); if (updateWithState == null) { return; } Instance instance = objectManager.loadResource(Instance.class, hcInstance.getInstanceId()); updateInstanceHealthState(instance, updateWithState); }
throw new ClientVisibleException(ResponseCodes.FORBIDDEN, VERIFY_AGENT); if(isNetworkStack(resourceAccId, healthcheckInstance.getInstanceId())) { if(!ENABLE_HEALTHCHECK.get()) { event.setReportedHealth("UP"); event.setInstanceId(healthcheckInstance.getInstanceId()); event.setHealthcheckInstanceId(healthcheckInstance.getId()); event.setHostId(healthcheckInstanceHostMap.getHostId());
/** * {@inheritDoc} */ @Override public void from(io.cattle.platform.core.model.HealthcheckInstance from) { setId(from.getId()); setName(from.getName()); setAccountId(from.getAccountId()); setKind(from.getKind()); setUuid(from.getUuid()); setDescription(from.getDescription()); setState(from.getState()); setCreated(from.getCreated()); setRemoved(from.getRemoved()); setRemoveTime(from.getRemoveTime()); setData(from.getData()); setInstanceId(from.getInstanceId()); }