public static APIReconnectHostEvent __example__() { APIReconnectHostEvent event = new APIReconnectHostEvent(); HostInventory hi = new HostInventory(); hi.setName("example"); hi.setClusterUuid(uuid()); hi.setManagementIp("192.168.0.1"); hi.setAvailableCpuCapacity(100000L); hi.setAvailableMemoryCapacity(100000L); return event; }
public static APIGetVmMigrationCandidateHostsReply __example__() { APIGetVmMigrationCandidateHostsReply reply = new APIGetVmMigrationCandidateHostsReply(); HostInventory hi = new HostInventory (); hi.setAvailableCpuCapacity(2L); hi.setAvailableMemoryCapacity(4L); hi.setClusterUuid(uuid()); hi.setManagementIp("192.168.0.1"); hi.setName("example"); hi.setState(HostState.Enabled.toString()); hi.setStatus(HostStatus.Connected.toString()); hi.setClusterUuid(uuid()); hi.setZoneUuid(uuid()); hi.setUuid(uuid()); hi.setTotalCpuCapacity(4L); hi.setTotalMemoryCapacity(4L); hi.setHypervisorType("KVM"); hi.setDescription("example"); hi.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date)); hi.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date)); reply.setInventories(asList(hi)); return reply; }
hi.setAvailableMemoryCapacity(4L); hi.setClusterUuid(clusterUuid); hi.setManagementIp("192.168.0.1");
public static APIQueryHostReply __example__() { APIQueryHostReply reply = new APIQueryHostReply(); HostInventory hi = new HostInventory (); hi.setAvailableCpuCapacity(2L); hi.setAvailableMemoryCapacity(4L); hi.setClusterUuid(uuid()); hi.setManagementIp("192.168.0.1"); hi.setName("example"); hi.setState(HostState.Enabled.toString()); hi.setStatus(HostStatus.Connected.toString()); hi.setClusterUuid(uuid()); hi.setZoneUuid(uuid()); hi.setUuid(uuid()); hi.setTotalCpuCapacity(4L); hi.setTotalMemoryCapacity(4L); hi.setHypervisorType("KVM"); hi.setDescription("example"); reply.setInventories(Arrays.asList(hi)); return reply; }
hi.setAvailableMemoryCapacity(4L); hi.setClusterUuid(clusterUuid); hi.setManagementIp("192.168.0.1");
public static APIUpdateHostEvent __example__() { APIUpdateHostEvent event = new APIUpdateHostEvent(); HostInventory hi = new HostInventory (); hi.setAvailableCpuCapacity(2L); hi.setAvailableMemoryCapacity(4L); hi.setClusterUuid(uuid()); hi.setManagementIp("192.168.0.1"); hi.setName("example"); hi.setState(HostState.Enabled.toString()); hi.setStatus(HostStatus.Connected.toString()); hi.setClusterUuid(uuid()); hi.setZoneUuid(uuid()); hi.setUuid(uuid()); hi.setTotalCpuCapacity(4L); hi.setTotalMemoryCapacity(4L); hi.setHypervisorType("KVM"); hi.setDescription("example"); event.setInventory(hi); return event; }
public static APIChangeHostStateEvent __example__() { APIChangeHostStateEvent event = new APIChangeHostStateEvent(); HostInventory hi = new HostInventory (); hi.setAvailableCpuCapacity(2L); hi.setAvailableMemoryCapacity(4L); hi.setClusterUuid(uuid()); hi.setManagementIp("192.168.0.1"); hi.setName("example"); hi.setState(HostState.Enabled.toString()); hi.setStatus(HostStatus.Connected.toString()); hi.setClusterUuid(uuid()); hi.setZoneUuid(uuid()); hi.setUuid(uuid()); hi.setTotalCpuCapacity(4L); hi.setTotalMemoryCapacity(4L); hi.setHypervisorType("KVM"); hi.setDescription("example"); event.setInventory(hi); return event; }
public static APIAddHostEvent __example__() { APIAddHostEvent event = new APIAddHostEvent(); HostInventory hi = new HostInventory (); hi.setAvailableCpuCapacity(2L); hi.setAvailableMemoryCapacity(4L); hi.setClusterUuid(uuid()); hi.setManagementIp("192.168.0.1"); hi.setName("example"); hi.setState(HostState.Enabled.toString()); hi.setStatus(HostStatus.Connected.toString()); hi.setClusterUuid(uuid()); hi.setZoneUuid(uuid()); hi.setUuid(uuid()); hi.setTotalCpuCapacity(4L); hi.setTotalMemoryCapacity(4L); hi.setHypervisorType("KVM"); hi.setDescription("example"); event.setInventory(hi); return event; }
protected HostInventory(HostVO vo) { this.setStatus(vo.getStatus().toString()); this.setCreateDate(vo.getCreateDate()); this.setDescription(vo.getDescription()); this.setHypervisorType(vo.getHypervisorType()); this.setLastOpDate(vo.getLastOpDate()); this.setManagementIp(vo.getManagementIp()); this.setName(vo.getName()); this.setState(vo.getState().toString()); this.setUuid(vo.getUuid()); this.setZoneUuid(vo.getZoneUuid()); this.setClusterUuid(vo.getClusterUuid()); if (vo.getCapacity() != null) { this.setTotalCpuCapacity(vo.getCapacity().getTotalCpu()); this.setAvailableCpuCapacity(vo.getCapacity().getAvailableCpu()); this.setTotalMemoryCapacity(vo.getCapacity().getTotalMemory()); this.setAvailableMemoryCapacity(vo.getCapacity().getAvailableMemory()); this.setCpuSockets(vo.getCapacity().getCpuSockets()); this.setCpuNum(vo.getCapacity().getCpuNum()); } }