io.systemd.MachineInstance¶
| Property | Value |
|---|---|
| Go package | github.com/rossedman/sdvarlink/systemd/latest/machineinstance |
| Available since | systemd v262 |
| Methods · types · errors | 10 · 0 · 7 |
Methods¶
Terminate¶
Forcefully terminate the machine immediately
PowerOff¶
Request a clean shutdown of the machine
Reboot¶
Reboot the machine
Pause¶
Pause/freeze the machine
Resume¶
Resume a paused machine
Describe¶
Query the current status of the machine
Reply
| Field | Type | Description |
|---|---|---|
running |
bool |
True iff vCPUs are executing |
status |
string |
Backend-specific state string (e.g. 'running', 'paused', 'shutdown'); 'unknown' if unavailable |
SubscribeEvents¶
streaming (requires more)
Subscribe to machine events. Returns a stream of events as they occur.
func (c *Client) SubscribeEvents(ctx context.Context, in SubscribeEventsIn) iter.Seq2[*SubscribeEventsOut, error]
Parameters
| Field | Type | Description |
|---|---|---|
filter |
?[]string |
If specified, only deliver events whose name matches one of these strings; null means all events |
Reply
| Field | Type | Description |
|---|---|---|
event |
string |
Name of the event |
data |
?object |
Event-specific payload |
AddStorage¶
Attach a storage volume (passed via file descriptor) to the running machine
Parameters
| Field | Type | Description |
|---|---|---|
fileDescriptorIndex |
int |
Index of the attached file descriptor for the storage volume |
name |
string |
Caller-supplied identifier for this binding (any non-empty string; machinectl uses ' |
config |
?string |
Backend-specific configuration |
RemoveStorage¶
Detach a previously-attached storage volume from the running machine
Parameters
| Field | Type | Description |
|---|---|---|
name |
string |
Identifier of the binding to detach (as supplied to AddStorage) |
ReplaceStorage¶
Replace the backing of a previously-attached storage volume in place
Parameters
| Field | Type | Description |
|---|---|---|
fileDescriptorIndex |
int |
Index of the attached file descriptor for the new backing storage |
name |
string |
Identifier of the existing binding whose backing is being replaced (as supplied to AddStorage) |
Errors¶
| Error | Go type | Description |
|---|---|---|
NotConnected |
NotConnectedError |
The connection to the machine backend is not available |
NotSupported |
NotSupportedError |
The requested operation is not supported |
NoSuchStorage |
NoSuchStorageError |
The named storage binding does not exist |
StorageExists |
StorageExistsError |
A storage binding with this name already exists |
StorageImmutable |
StorageImmutableError |
The storage binding cannot be detached at runtime (e.g. attached at boot) |
BadConfig |
BadConfigError |
The supplied 'config' value is not valid for this backend |
ConfigNotSupported |
ConfigNotSupportedError |
The supplied 'config' value is recognized but not supported by this backend |