fix rentedinstance object
This commit is contained in:
parent
0a85bb20e0
commit
a48c19833b
1 changed files with 7 additions and 7 deletions
|
@ -50,17 +50,17 @@ data class RentedInstance(
|
||||||
Instance.fromJson(json),
|
Instance.fromJson(json),
|
||||||
json.getDouble("disk_space"),
|
json.getDouble("disk_space"),
|
||||||
json.getDouble("disk_util"),
|
json.getDouble("disk_util"),
|
||||||
(StorageCapacityConverters.gibToGb(json.getDouble("vmem_usage")) / 1000).toInt(),
|
(StorageCapacityConverters.gibToGb(json.optDouble("vmem_usage")) / 1000).toInt(),
|
||||||
(json.getDouble("mem_usage") / 1000).toInt(),
|
(json.optDouble("mem_usage") / 1000).toInt(),
|
||||||
json.getDouble("gpu_util") / 100,
|
json.optDouble("gpu_util") / 100,
|
||||||
json.getDouble("cpu_util") / 100,
|
json.getDouble("cpu_util") / 100,
|
||||||
json.getDouble("gpu_temp"),
|
json.optDouble("gpu_temp"),
|
||||||
json.getDouble("inet_down_billed").toInt(),
|
json.optDouble("inet_down_billed").toInt(),
|
||||||
json.getDouble("inet_up_billed").toInt(),
|
json.optDouble("inet_up_billed").toInt(),
|
||||||
json.getString("ssh_host"),
|
json.getString("ssh_host"),
|
||||||
json.getInt("ssh_port"),
|
json.getInt("ssh_port"),
|
||||||
json.getString("image_uuid"),
|
json.getString("image_uuid"),
|
||||||
json.optString("label").takeIf { it.isNotBlank() },
|
json.optString("label").takeUnless { it == "null" || it.isBlank() },
|
||||||
json.getString("local_ipaddrs").split(" ").filterNot { it == "\n" }
|
json.getString("local_ipaddrs").split(" ").filterNot { it == "\n" }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue