add status to rented instance

I couldn't fix the commits
This commit is contained in:
Minecon724 2024-08-04 10:53:02 +02:00
parent 19ab656b7c
commit d43b02b4f2
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -34,6 +34,11 @@ data class RentedInstance(
val sshProxyHost: String, val sshProxyHost: String,
val sshProxyPort: Int, val sshProxyPort: Int,
/** exited or running */
val status: String,
/** "running" if the machine is starting or "stopped" if stopping */
val targetStatus: String,
/** the docker image that runs on the instance */ /** the docker image that runs on the instance */
val image: String, val image: String,
/** label set by user, null if not set */ /** label set by user, null if not set */
@ -59,6 +64,8 @@ data class RentedInstance(
json.optDouble("inet_up_billed").toInt(), json.optDouble("inet_up_billed").toInt(),
"ssh${json.getInt("ssh_idx")}.vast.ai", // TODO "ssh${json.getInt("ssh_idx")}.vast.ai", // TODO
json.getInt("ssh_port"), json.getInt("ssh_port"),
json.getString("actual_status"),
json.getString("intended_status"),
json.getString("image_uuid"), json.getString("image_uuid"),
json.optString("label").takeUnless { it == "null" || it.isBlank() }, json.optString("label").takeUnless { it == "null" || it.isBlank() },
json.getString("local_ipaddrs").split(" ").filterNot { it == "\n" } json.getString("local_ipaddrs").split(" ").filterNot { it == "\n" }