Skip to main content

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

NameSummary
actionval action: String
The action performed ("backup" or "restore").
messageval message: String
Human-readable message.
pathval path: String
Filesystem path of the backup file.
percentageval percentage: Int = 0
Progress percentage (0-100).
statusval status: String
Status: "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

NameSummary
clientIdval clientId: String
Client ID that deployed this mim.
createdval created: String
ISO 8601 creation timestamp.
envval env: Map<String, String>
Environment variables set at deployment.
idval id: String
Unique identifier.
imageval image: String
Source image name.
imageIdval imageId: String
Source image ID.
nameval name: String
Mim instance name (user-specified at deployment).
stateval state: String
Runtime state (e.g., "started").
statusval status: String
Operational 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

NameSummary
createdval created: String
ISO 8601 creation timestamp.
digestval digest: String
Content digest.
idval id: String
Image ID.
nameval name: String
Image name.
repoTagsval repoTags: List<String>
Repository tags.
sizeval size: Long = 0
Image 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

NameSummary
envval env: Map<String, String>
Environment variables for the mim.
imageval image: String
Source image name.
nameval name: String
Mim instance name (no spaces).