mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'origin/4.13'
This commit is contained in:
commit
70d1535df4
@ -19,14 +19,14 @@ package org.apache.cloudstack.api.response;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import com.cloud.host.Status;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@EntityReference(value = VirtualMachine.class)
|
||||
public class SystemVmResponse extends BaseResponse {
|
||||
@ -138,6 +138,10 @@ public class SystemVmResponse extends BaseResponse {
|
||||
@Param(description = "the state of the system VM")
|
||||
private String state;
|
||||
|
||||
@SerializedName("agentstate")
|
||||
@Param(description = "the agent state of the system VM", since = "4.13.1")
|
||||
private String agentState;
|
||||
|
||||
@SerializedName("activeviewersessions")
|
||||
@Param(description = "the number of active console sessions for the console proxy system vm")
|
||||
private Integer activeViewerSessions;
|
||||
@ -150,6 +154,14 @@ public class SystemVmResponse extends BaseResponse {
|
||||
@Param(description = "public vlan range")
|
||||
private List<String> publicVlan;
|
||||
|
||||
@SerializedName("lastpinged")
|
||||
@Param(description = "the date and time the host was last pinged", since = "4.13.1")
|
||||
private Date lastPinged;
|
||||
|
||||
@SerializedName("version")
|
||||
@Param(description = "the systemvm agent version", since = "4.13.1")
|
||||
private String version;
|
||||
|
||||
@Override
|
||||
public String getObjectId() {
|
||||
return this.getId();
|
||||
@ -331,6 +343,18 @@ public class SystemVmResponse extends BaseResponse {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getAgentState() {
|
||||
return agentState;
|
||||
}
|
||||
|
||||
public void setAgentState(Status agentState) {
|
||||
if (agentState != null) {
|
||||
this.agentState = agentState.toString();
|
||||
} else {
|
||||
this.agentState = Status.Unknown.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getActiveViewerSessions() {
|
||||
return activeViewerSessions;
|
||||
}
|
||||
@ -378,4 +402,20 @@ public class SystemVmResponse extends BaseResponse {
|
||||
public void setPublicVlan(List<String> publicVlan) {
|
||||
this.publicVlan = publicVlan;
|
||||
}
|
||||
|
||||
public Date getLastPinged() {
|
||||
return lastPinged;
|
||||
}
|
||||
|
||||
public void setLastPinged(Date lastPinged) {
|
||||
this.lastPinged = lastPinged;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1378,6 +1378,9 @@ public class ApiResponseHelper implements ResponseGenerator {
|
||||
vmResponse.setHostId(host.getUuid());
|
||||
vmResponse.setHostName(host.getName());
|
||||
vmResponse.setHypervisor(host.getHypervisorType().toString());
|
||||
vmResponse.setAgentState(host.getStatus());
|
||||
vmResponse.setLastPinged(new Date(host.getLastPinged()));
|
||||
vmResponse.setVersion(host.getVersion());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9468,7 +9468,7 @@
|
||||
url: createURL('listSystemVms'),
|
||||
data: data,
|
||||
success: function (json) {
|
||||
var systemvmObjs = json.listsystemvmsresponse.systemvm;
|
||||
var systemvmObjs = json.listsystemvmsresponse.systemvm || [];
|
||||
$(systemvmObjs).each(function(idx, item) {
|
||||
var controlIp = item.linklocalip;
|
||||
if (item.hypervisor == "VMware") {
|
||||
@ -9477,32 +9477,9 @@
|
||||
item.controlip = controlIp;
|
||||
});
|
||||
|
||||
if (systemvmObjs != undefined) {
|
||||
$.ajax({
|
||||
url: createURL('listHosts'),
|
||||
data: {
|
||||
details: 'min'
|
||||
},
|
||||
success: function (json) {
|
||||
var hostObjs = json.listhostsresponse.host;
|
||||
for (var i = 0; i < systemvmObjs.length; i++) {
|
||||
for (var k = 0; k < hostObjs.length; k++) {
|
||||
if (hostObjs[k].name == systemvmObjs[i].name) {
|
||||
systemvmObjs[i].agentstate = hostObjs[k].state;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
args.response.success({
|
||||
data: systemvmObjs
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
args.response.success({
|
||||
data:[]
|
||||
});
|
||||
}
|
||||
args.response.success({
|
||||
data: systemvmObjs
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user