summaryrefslogtreecommitdiff
path: root/simulator/opendc-compute/opendc-compute-api/src/main
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-09 17:18:02 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-09 17:24:06 +0100
commit6a555542c4a1ba94b96c0cf17b51ceb975c83e21 (patch)
tree80862162f5bfdcbcd33d2925cedbf81ffcc0607a /simulator/opendc-compute/opendc-compute-api/src/main
parent412a0d554edf135eaf26db50ea59009abf88c15e (diff)
core: Remove OpenDC core module
This change removes the opendc-core module. This module was an artifact of the old codebase and remained mostly unused. This change removes all usages of the module and if necessary introduces replacement classes.
Diffstat (limited to 'simulator/opendc-compute/opendc-compute-api/src/main')
-rw-r--r--simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeWorkload.kt46
-rw-r--r--simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Image.kt19
2 files changed, 4 insertions, 61 deletions
diff --git a/simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeWorkload.kt b/simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeWorkload.kt
deleted file mode 100644
index 64a47277..00000000
--- a/simulator/opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/ComputeWorkload.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2021 AtLarge Research
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package org.opendc.compute.api
-
-import org.opendc.core.User
-import org.opendc.core.workload.Workload
-import java.util.UUID
-
-/**
- * A workload that represents a VM.
- *
- * @property uid A unique identified of this VM.
- * @property name The name of this VM.
- * @property owner The owner of the VM.
- * @property image The image of the VM.
- */
-public data class ComputeWorkload(
- override val uid: UUID,
- override val name: String,
- override val owner: User,
- val image: Image
-) : Workload {
- override fun equals(other: Any?): Boolean = other is ComputeWorkload && uid == other.uid
-
- override fun hashCode(): Int = uid.hashCode()
-}
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 280c4d89..8b673e84 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,27 +22,16 @@
package org.opendc.compute.api
-import org.opendc.core.resource.Resource
-import org.opendc.core.resource.TagContainer
-import java.util.*
+import java.util.UUID
/**
* An image containing a bootable operating system that can directly be executed by physical or virtual server.
- *
- * OpenStack: A collection of files used to create or rebuild a server. Operators provide a number of pre-built OS
- * images by default. You may also create custom images from cloud servers you have launched. These custom images are
- * useful for backup purposes or for producing “gold” server images if you plan to deploy a particular server
- * configuration frequently.
*/
public data class Image(
public override val uid: UUID,
public override val name: String,
- public override val tags: TagContainer
+ override val labels: Map<String, String>,
+ override val meta: Map<String, Any>
) : Resource {
- public companion object {
- /**
- * An empty boot disk [Image] that exits immediately on start.
- */
- public val EMPTY: Image = Image(UUID.randomUUID(), "empty", emptyMap())
- }
+ override suspend fun refresh() {}
}