mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'origin/4.14' into 4.15
This commit is contained in:
commit
2cdde8774b
@ -18,8 +18,6 @@ package org.apache.cloudstack.api.response;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
import org.apache.cloudstack.api.BaseResponse;
|
import org.apache.cloudstack.api.BaseResponse;
|
||||||
import org.apache.cloudstack.api.EntityReference;
|
import org.apache.cloudstack.api.EntityReference;
|
||||||
@ -28,6 +26,7 @@ import com.cloud.host.Host;
|
|||||||
import com.cloud.host.Status;
|
import com.cloud.host.Status;
|
||||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||||
import com.cloud.serializer.Param;
|
import com.cloud.serializer.Param;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
@EntityReference(value = Host.class)
|
@EntityReference(value = Host.class)
|
||||||
public class HostForMigrationResponse extends BaseResponse {
|
public class HostForMigrationResponse extends BaseResponse {
|
||||||
@ -452,6 +451,10 @@ public class HostForMigrationResponse extends BaseResponse {
|
|||||||
this.hypervisorVersion = hypervisorVersion;
|
this.hypervisorVersion = hypervisorVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getHaHost() {
|
||||||
|
return haHost;
|
||||||
|
}
|
||||||
|
|
||||||
public void setHaHost(Boolean haHost) {
|
public void setHaHost(Boolean haHost) {
|
||||||
this.haHost = haHost;
|
this.haHost = haHost;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,16 +26,18 @@ import java.util.Set;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import org.apache.cloudstack.api.ApiConstants.HostDetails;
|
import org.apache.cloudstack.api.ApiConstants.HostDetails;
|
||||||
import org.apache.cloudstack.api.response.GpuResponse;
|
import org.apache.cloudstack.api.response.GpuResponse;
|
||||||
import org.apache.cloudstack.api.response.HostForMigrationResponse;
|
import org.apache.cloudstack.api.response.HostForMigrationResponse;
|
||||||
import org.apache.cloudstack.api.response.HostResponse;
|
import org.apache.cloudstack.api.response.HostResponse;
|
||||||
import org.apache.cloudstack.api.response.VgpuResponse;
|
import org.apache.cloudstack.api.response.VgpuResponse;
|
||||||
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||||
|
import org.apache.cloudstack.ha.HAResource;
|
||||||
|
import org.apache.cloudstack.ha.dao.HAConfigDao;
|
||||||
import org.apache.cloudstack.outofbandmanagement.dao.OutOfBandManagementDao;
|
import org.apache.cloudstack.outofbandmanagement.dao.OutOfBandManagementDao;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.cloud.api.ApiDBUtils;
|
import com.cloud.api.ApiDBUtils;
|
||||||
import com.cloud.api.query.vo.HostJoinVO;
|
import com.cloud.api.query.vo.HostJoinVO;
|
||||||
@ -52,9 +54,6 @@ import com.cloud.utils.db.GenericDaoBase;
|
|||||||
import com.cloud.utils.db.SearchBuilder;
|
import com.cloud.utils.db.SearchBuilder;
|
||||||
import com.cloud.utils.db.SearchCriteria;
|
import com.cloud.utils.db.SearchCriteria;
|
||||||
|
|
||||||
import org.apache.cloudstack.ha.HAResource;
|
|
||||||
import org.apache.cloudstack.ha.dao.HAConfigDao;
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements HostJoinDao {
|
public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements HostJoinDao {
|
||||||
public static final Logger s_logger = Logger.getLogger(HostJoinDaoImpl.class);
|
public static final Logger s_logger = Logger.getLogger(HostJoinDaoImpl.class);
|
||||||
@ -178,17 +177,13 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
|||||||
hostResponse.setMemoryAllocatedPercentage(memoryAllocatedPercentage);
|
hostResponse.setMemoryAllocatedPercentage(memoryAllocatedPercentage);
|
||||||
|
|
||||||
String hostTags = host.getTag();
|
String hostTags = host.getTag();
|
||||||
hostResponse.setHostTags(host.getTag());
|
hostResponse.setHostTags(hostTags);
|
||||||
|
|
||||||
|
hostResponse.setHaHost(false);
|
||||||
String haTag = ApiDBUtils.getHaTag();
|
String haTag = ApiDBUtils.getHaTag();
|
||||||
if (haTag != null && !haTag.isEmpty() && hostTags != null && !hostTags.isEmpty()) {
|
if (StringUtils.isNotEmpty(haTag) && StringUtils.isNotEmpty(hostTags) &&
|
||||||
if (haTag.equalsIgnoreCase(hostTags)) {
|
haTag.equalsIgnoreCase(hostTags)) {
|
||||||
hostResponse.setHaHost(true);
|
hostResponse.setHaHost(true);
|
||||||
} else {
|
|
||||||
hostResponse.setHaHost(false);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
hostResponse.setHaHost(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hostResponse.setHypervisorVersion(host.getHypervisorVersion());
|
hostResponse.setHypervisorVersion(host.getHypervisorVersion());
|
||||||
@ -274,12 +269,19 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
|||||||
@Override
|
@Override
|
||||||
public HostResponse setHostResponse(HostResponse response, HostJoinVO host) {
|
public HostResponse setHostResponse(HostResponse response, HostJoinVO host) {
|
||||||
String tag = host.getTag();
|
String tag = host.getTag();
|
||||||
if (tag != null) {
|
if (StringUtils.isNotEmpty(tag)) {
|
||||||
if (response.getHostTags() != null && response.getHostTags().length() > 0) {
|
if (StringUtils.isNotEmpty(response.getHostTags())) {
|
||||||
response.setHostTags(response.getHostTags() + "," + tag);
|
response.setHostTags(response.getHostTags() + "," + tag);
|
||||||
} else {
|
} else {
|
||||||
response.setHostTags(tag);
|
response.setHostTags(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Boolean.FALSE.equals(response.getHaHost())) {
|
||||||
|
String haTag = ApiDBUtils.getHaTag();
|
||||||
|
if (StringUtils.isNotEmpty(haTag) && haTag.equalsIgnoreCase(tag)) {
|
||||||
|
response.setHaHost(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@ -334,17 +336,13 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
|||||||
hostResponse.setMemoryAllocatedBytes(mem);
|
hostResponse.setMemoryAllocatedBytes(mem);
|
||||||
|
|
||||||
String hostTags = host.getTag();
|
String hostTags = host.getTag();
|
||||||
hostResponse.setHostTags(host.getTag());
|
hostResponse.setHostTags(hostTags);
|
||||||
|
|
||||||
|
hostResponse.setHaHost(false);
|
||||||
String haTag = ApiDBUtils.getHaTag();
|
String haTag = ApiDBUtils.getHaTag();
|
||||||
if (haTag != null && !haTag.isEmpty() && hostTags != null && !hostTags.isEmpty()) {
|
if (StringUtils.isNotEmpty(haTag) && StringUtils.isNotEmpty(hostTags) &&
|
||||||
if (haTag.equalsIgnoreCase(hostTags)) {
|
haTag.equalsIgnoreCase(hostTags)) {
|
||||||
hostResponse.setHaHost(true);
|
hostResponse.setHaHost(true);
|
||||||
} else {
|
|
||||||
hostResponse.setHaHost(false);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
hostResponse.setHaHost(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hostResponse.setHypervisorVersion(host.getHypervisorVersion());
|
hostResponse.setHypervisorVersion(host.getHypervisorVersion());
|
||||||
@ -419,6 +417,13 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
|||||||
} else {
|
} else {
|
||||||
response.setHostTags(tag);
|
response.setHostTags(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Boolean.FALSE.equals(response.getHaHost())) {
|
||||||
|
String haTag = ApiDBUtils.getHaTag();
|
||||||
|
if (StringUtils.isNotEmpty(haTag) && haTag.equalsIgnoreCase(tag)) {
|
||||||
|
response.setHaHost(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user