diff options
Diffstat (limited to 'simulator/opendc-compute/opendc-compute-api/src')
2 files changed, 30 insertions, 9 deletions
diff --git a/simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeClient.kt b/simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeClient.kt index 4fd32f98..b4fc03f7 100644 --- a/simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeClient.kt +++ b/simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeClient.kt @@ -29,6 +29,31 @@ import java.util.UUID */ public interface ComputeClient : AutoCloseable { /** + * Obtain the list of [Image]s accessible by the requesting user. + */ + public suspend fun queryImages(): List<Image> + + /** + * Obtain a [Image] by its unique identifier. + * + * @param id The identifier of the image. + */ + public suspend fun findImage(id: UUID): Image? + + /** + * Create a new [Image] instance at this compute service. + * + * @param name The name of the image. + * @param labels The identifying labels of the image. + * @param meta The non-identifying meta-data of the image. + */ + public suspend fun newImage( + name: String, + labels: Map<String, String> = emptyMap(), + meta: Map<String, Any> = emptyMap() + ): Image + + /** * Obtain the list of [Server]s accessible by the requesting user. */ public suspend fun queryServers(): List<Server> diff --git a/simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Image.kt b/simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Image.kt index 8b673e84..83e63b81 100644 --- a/simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Image.kt +++ b/simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Image.kt @@ -22,16 +22,12 @@ package org.opendc.compute.api -import java.util.UUID - /** * An image containing a bootable operating system that can directly be executed by physical or virtual server. */ -public data class Image( - public override val uid: UUID, - public override val name: String, - override val labels: Map<String, String>, - override val meta: Map<String, Any> -) : Resource { - override suspend fun refresh() {} +public interface Image : Resource { + /** + * Delete the image instance. + */ + public suspend fun delete() } |
