Compute Manager (MCM)
Package: com.mimik.mimoe.mcm
Microservice deployment and container management.
DataStoreResult
@Serializable
data class DataStoreResult(
val action: String,
val status: String,
val message: String = "",
val path: String = "",
val percentage: Int = 0
)
Result of a datastore backup/restore operation.
Response from POST /mcm/v1/mims/{id}/dataStore.
Constructors
constructor(
action: String,
status: String,
message: String = "",
path: String = "",
percentage: Int = 0
)
Properties
| Name | Summary |
|---|---|
action | val action: StringThe action performed ("backup" or "restore"). |
message | val message: StringHuman-readable message. |
path | val path: StringFilesystem path of the backup file. |
percentage | val percentage: Int = 0Progress percentage (0-100). |
status | val status: StringStatus: "completed", "failed", or "inProgress". |
McmClient
class McmClient
MCM (mimik Compute Manager) sub-client.
Manages mim deployment, images, compositions, and datastore operations. Base path: /mcm/v1
Requires authentication: Bearer token (access token with edge:mcm scope, or MCM API key from mimoe-api-key.env).
Access via client.mcm.
Functions
backupDataStore
suspend fun backupDataStore(mimId: String, path: String): Result<DataStoreResult>
Backup a mim's datastore.
deleteImage
suspend fun deleteImage(id: String): Result<Unit>
Delete an uploaded image.
deployComposition
suspend fun deployComposition(mims: List<MimSpec>): Result<List<Mim>>
Deploy a composition of multiple mims.
deployMim
suspend fun deployMim(name: String, image: String, env: Map<String, String> = emptyMap()): Result<Mim>
Deploy a mim from an uploaded image.
listImages
suspend fun listImages(): Result<List<MimImage>>
List all uploaded images.
listMims
suspend fun listMims(): Result<List<Mim>>
List all deployed mims.
removeMim
suspend fun removeMim(id: String): Result<Unit>
Remove a deployed mim.
restoreDataStore
suspend fun restoreDataStore(mimId: String, path: String): Result<DataStoreResult>
Restore a mim's datastore from backup.
uploadImage
suspend fun uploadImage(file: File): Result<MimImage>
Upload a mim image from a file.
suspend fun uploadImage(name: String, inputStream: InputStream): Result<MimImage>
Upload a mim image from an InputStream.
suspend fun uploadImage(name: String, data: ByteArray): Result<MimImage>
Upload a mim image from a byte array.
Mim
@Serializable
data class Mim(
val id: String,
val name: String,
val image: String,
val imageId: String = "",
val clientId: String = "",
val created: String = "",
val state: String = "",
val status: String = "",
val env: Map<String, String> = emptyMap()
)
A deployed mim (microservice) on the mimOE runtime.
Fields match the MCM API response from GET /mcm/v1/mims.
Constructors
constructor(
id: String,
name: String,
image: String,
imageId: String = "",
clientId: String = "",
created: String = "",
state: String = "",
status: String = "",
env: Map<String, String> = emptyMap()
)
Properties
| Name | Summary |
|---|---|
clientId | val clientId: StringClient ID that deployed this mim. |
created | val created: StringISO 8601 creation timestamp. |
env | val env: Map<String, String>Environment variables set at deployment. |
id | val id: StringUnique identifier. |
image | val image: StringSource image name. |
imageId | val imageId: StringSource image ID. |
name | val name: StringMim instance name (user-specified at deployment). |
state | val state: StringRuntime state (e.g., "started"). |
status | val status: StringOperational status (e.g., "up"). |
MimImage
@Serializable
data class MimImage(
val id: String,
val name: String,
val digest: String = "",
val repoTags: List<String> = emptyList(),
val created: String = "",
val size: Long = 0
)
An uploaded mim image on the mimOE runtime.
Fields match the MCM API response from GET /mcm/v1/images.
Constructors
constructor(
id: String,
name: String,
digest: String = "",
repoTags: List<String> = emptyList(),
created: String = "",
size: Long = 0
)
Properties
| Name | Summary |
|---|---|
created | val created: StringISO 8601 creation timestamp. |
digest | val digest: StringContent digest. |
id | val id: StringImage ID. |
name | val name: StringImage name. |
repoTags | val repoTags: List<String>Repository tags. |
size | val size: Long = 0Image size in bytes. |
MimSpec
@Serializable
data class MimSpec(
val name: String,
val image: String,
val env: Map<String, String> = emptyMap()
)
Specification for deploying a mim.
Used for both single deployment (POST /mcm/v1/mims) and composition deployment (POST /mcm/v1/compositions).
Constructors
constructor(name: String, image: String, env: Map<String, String> = emptyMap())
Properties
| Name | Summary |
|---|---|
env | val env: Map<String, String>Environment variables for the mim. |
image | val image: StringSource image name. |
name | val name: StringMim instance name (no spaces). |