An instance is a unikernel virtual machine running an application.
List Instances
Get one or many instances with their current status and configuration. It's possible to filter this list by ID(s) (name or UUID).
query Parameters
details
booleanWhether to include details about the instance in the response. By default this is set to true, meaning that all information about the instance will be included in the response. If set to false, only the basic information about the instance will be included, such as its name and UUID.
Request Body
Decision Table
Variant | Matching Criteria |
---|---|
type = object · requires: uuid | |
type = object · requires: name |
uuid
string · uuid · requiredMutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 432
Create Instance
Create an instance in Unikraft Cloud.
Request Body
image
string · requiredThe image to use for the instance.
Example: nginx:latest
name
string(Optional). The name of the instance.
If not provided, a random name will be generated. The name must be unique.
Example: funky-town-g756b5dargs
string[](Optional). The arguments to pass to the instance when it starts.
Example: --port=8080 --debugenv
object(Optional). Environment variables to set for the instance.
Example: {"ENV_VAR1":"value1","ENV_VAR2":"value2"}memory_mb
integer · int64(Optional). Memory in MB to allocate for the instance. Default is 128.
Example: 256service_group
object(Optional). The service group configuration when creating an instance.
When creating an instance, either a previously created (persistent) service group can be referenced (either through its name or UUID), or a new (ephemeral) service group can be created for the instance by specifying the list of services it should expose and optionally the domains it should use.
volumes
object[]Volumes to attach to the instance.
This list can contain both existing and new volumes to create as part of the instance creation. Existing volumes can be referenced by their name or UUID. New volumes can be created by specifying a name, size in MiB, and mount point in the instance. The mount point is the directory in the instance where the volume will be mounted.
autostart
booleanWhether the instance should start automatically on creation.
Example: truereplicas
integer · int64Number of replicas for the instance.
Example: 5restart_policy
string · enum · enumRestart policy for the instance. This defines how the instance should behave when it stops or crashes.
Enum values:neveralwayson_failurescale_to_zero
objectScale-to-zero configuration for the instance.
vcpus
integer · int32Number of vCPUs to allocate for the instance.
Example: 1wait_timeout_ms
integer · int64Timeout to wait for all new instances to reach running state in milliseconds. If you autostart your new instance, you can wait for it to finish starting with a blocking API call if you specify a wait timeout greater than zero. No wait performed for a value of 0.
Example: 2000features
string[]Features to enable for the instance. Features are specific configurations or capabilities that can be enabled for the instance.
Enum values:delete_on_stop
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 875
Delete Instances
Delete the specified instance(s) by ID(s) (name or UUID). After this call the name of the instances are no longer valid. If the instances are currently running, they are force-stopped.
Request Body
Decision Table
Variant | Matching Criteria |
---|---|
type = object · requires: uuid | |
type = object · requires: name |
uuid
string · uuid · requiredMutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 221
Update Instances
Update (modify) one or more instances by ID(s) (name or UUID). The instances must be in a stopped state for most update operations.
Request Body
prop
string · enum · enum · requiredThe property to modify.
Enum values:imageargsenvmemory_mbvcpusscale_to_zerotagsdelete_lockExample: memory_mbop
string · enum · enum · requiredThe operation to perform on the property.
Enum values:setadddelExample: set
id
string(Optional). A client-provided identifier for tracking this operation in the response.
Example: op-1uuid
string · uuidThe UUID of the instance to update. Mutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000name
stringThe name of the instance to update. Mutually exclusive with UUID.
Example: funky-town-g756b5dvalue
The value for the update operation. The type depends on the property and operation:
- For "image": string
- For "args": string or array of strings
- For "env": object (for SET/ADD) or string/array of strings (for DEL)
- For "memory_mb": integer
- For "vcpus": integer
- For "scale_to_zero": object with cooldown_time_ms, policy, and stateful fields
- For "tags": array of strings
- For "delete_lock": boolean
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 76
Get Instances Logs
Retrieve the logs of one or more instances by ID(s) (name or UUID).
Request Body
uuid
string · uuid · requiredThe UUID of the instance to retrieve logs for. Mutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000name
string · requiredThe name of the instance to retrieve logs for. Mutually exclusive with UUID.
Example: funky-town-g756b5d
offset
integer · uint64The byte offset of the log output to receive. A negative sign makes the offset relative to the end of the log.
Example: 450limit
integer · int64The amount of bytes to return at most.
Example: 3000
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 47
Get Instances Metrics
Get the metrics of an instance by its UUID or name.
query Parameters
uuid
stringMutually exclusive with name.
name
stringMutually exclusive with UUID.
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 76
Start Instances
Start previously stopped instances by ID(s) (name or UUID) or do nothing if the instances are already running.
Request Body
Decision Table
Variant | Matching Criteria |
---|---|
type = object · requires: uuid | |
type = object · requires: name |
uuid
string · uuid · requiredMutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 256
Stop Instances
Stop one or more running instance by ID(s) (name or UUID) or do nothing if the instances are already stopped.
Request Body
uuid
string · uuid · requiredThe UUID of the instance to stop. Mutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000name
string · requiredThe name of the instance to stop. Mutually exclusive with UUID.
Example: funky-town-g756b5d
force
booleanWhether to immediately force stop the instance.
Example: falsedrain_timeout_ms
integer · uint64Timeout for draining connections in milliseconds. The instance does not receive new connections in the draining phase. The instance is stopped when the last connection has been closed or the timeout expired. The maximum timeout may vary. Use -1 for the largest possible value.
Note: This endpoint does not block. Use the wait endpoint for the instance to reach the stopped state.
Example: 250
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 23
Wait for Instances States
Wait for one or more instances to reach certain states by ID(s) (name or UUID).
If the instances are already in the desired states, the request will return immediately. If the instances are not in the desired state, the request will block until the instances reach the desired state or the timeout is reached. If the timeout is reached, the request will fail with an error. If the timeout is -1, the request will block indefinitely until the instances reach the desired states.
query Parameters
state
string · enum · enumThe desired state to wait for. Default is
running
.Enum values:stoppedstartingrunningdrainingstoppingstandbytimeout_ms
integer · int64Timeout in milliseconds to wait for the instance to reach the desired state. If the timeout is reached, the request will fail with an error. A value of -1 means to wait indefinitely until the instance reaches the desired state.
Request Body
Decision Table
Variant | Matching Criteria |
---|---|
type = object · requires: uuid | |
type = object · requires: name |
uuid
string · uuid · requiredMutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 450
Get Instance by UUID
Get a single instance by its UUID.
path Parameters
uuid
string · uuid · requiredThe UUID of the instance to get.
query Parameters
details
booleanWhether to include details about the instance in the response. By default this is set to true, meaning that all information about the instance will be included in the response. If set to false, only the basic information about the instance will be included, such as its name and UUID.
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 432
Delete Instance by UUID
Delete a specified instance by its UUID. After this call the UUID of the instance is no longer valid. If the instance is currently running, it is force-stopped.
path Parameters
uuid
string · uuid · requiredThe UUID of the instance to delete.
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 221
Update Instance by UUID
Update (modify) an instance by its UUID. The instance must be in a stopped state for most update operations.
path Parameters
uuid
string · uuid · requiredThe UUID of the instance to update.
Example: 123e4567-e89b-12d3-a456-426614174000
Request Body
prop
string · enum · enum · requiredThe property to modify.
Enum values:imageargsenvmemory_mbvcpusscale_to_zerotagsdelete_lockExample: memory_mbop
string · enum · enum · requiredThe operation to perform on the property.
Enum values:setadddelExample: set
id
string(Optional). A client-provided identifier for tracking this operation in the response.
Example: op-1value
The value for the update operation. The type depends on the property and operation:
- For "image": string
- For "args": string or array of strings
- For "env": object (for SET/ADD) or string/array of strings (for DEL)
- For "memory_mb": integer
- For "vcpus": integer
- For "scale_to_zero": object with cooldown_time_ms, policy, and stateful fields
- For "tags": array of strings
- For "delete_lock": boolean
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 76
Get Instance Logs by UUID
Retrieve the logs of an instance by its UUID.
path Parameters
uuid
string · uuid · requiredThe UUID of the instance to retrieve logs for.
Example: 123e4567-e89b-12d3-a456-426614174000
Request Body
offset
integer · uint64The byte offset of the log output to receive. A negative sign makes the offset relative to the end of the log.
Example: 56000limit
integer · int64The amount of bytes to return at most.
Example: 1500
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 47
Get Instance Metrics by UUID
Get the metrics of an instance by its UUID.
path Parameters
uuid
string · uuid · requiredThe UUID of the instance to retrieve metrics for.
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 76
Start Instance by UUID
Start a previously stopped instance by its UUID or do nothing if the instance is already running.
path Parameters
uuid
string · uuid · requiredThe UUID of the instance to start.
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 256
Stop Instance by UUID
Stop a running instance by its UUID or do nothing if the instance is already stopped.
path Parameters
uuid
string · uuid · requiredThe UUID of the instance to stop.
query Parameters
force
booleanWhether to immediately force stop the instance.
drain_timeout_ms
integer · uint64Timeout for draining connections in milliseconds. The instance does not receive new connections in the draining phase. The instance is stopped when the last connection has been closed or the timeout expired. The maximum timeout may vary. Use -1 for the largest possible value.
Note: This endpoint does not block. Use the wait endpoint for the instance to reach the stopped state.
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 23
Wait for Instance State by UUID
Wait for an instance to reach a certain state, by its UUID.
If the instance is already in the desired state, the request will return immediately. If the instance is not in the desired state, the request will block until the instance reaches the desired state or the timeout is reached. If the timeout is reached, the request will fail with an error. If the timeout is -1, the request will block indefinitely until the instance reaches the desired state.
path Parameters
uuid
string · uuid · requiredThe UUID of the instance to wait for.
Example: 123e4567-e89b-12d3-a456-426614174000
Request Body
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
timeout_ms
integer · int64Timeout in milliseconds to wait for the instance to reach the desired state. If the timeout is reached, the request will fail with an error. A value of -1 means to wait indefinitely until the instance reaches the desired state.
Example: 450
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 450