Skip to content
microvmexec.services.api.v1alpha1

microvmexec.services.api.v1alpha1

Table of Contents

Top

services/microvmexec/v1alpha1/microvmexec.proto

ExecCommandRequest

ExecCommandRequest is one message in the client->server stream. The first message on a stream must carry start; all following messages carry stdin (only meaningful if start.has_stdin was set) or stdin_eof.

FieldTypeLabelDescription
startExecStart
stdinbytes
stdin_eofbool

ExecCommandResponse

ExecCommandResponse is one message in the server->client stream. Only exit_code terminates the stream; error may be sent (typically followed by exit_code) without ending the exchange.

FieldTypeLabelDescription
stdoutbytes
stderrbytes
exit_codeint32
errorstring

ExecStart

ExecStart describes the microvm to target and the command to run, mirroring the guest-agent’s own exec request fields.

FieldTypeLabelDescription
uidstringuid is the microvm identifier, as used by MicroVM.GetMicroVM/DeleteMicroVM.
cmdstring
argsstringrepeated
cwdstringcwd is the working directory; empty means the guest-agent’s cwd.
envExecStart.EnvEntryrepeatedenv entries are added to (and override) the guest-agent’s environment.
shellboolshell runs “sh -c <cmd + args joined>” instead of a direct exec.
userstringuser, if set, runs the command as that guest system user.
timeout_secondsint32timeout_seconds bounds the run; 0 means unbounded.
has_stdinboolhas_stdin tells the server to expect streamed stdin messages.

ExecStart.EnvEntry

FieldTypeLabelDescription
keystring
valuestring

MicroVMExec

MicroVMExec runs commands inside a microvm’s guest-agent over vsock, streaming stdin in and stdout/stderr/exit back out. It requires the target microvm to have been created with AllowGuestAgent set, to be in the created state, and for the server to have been started with exec enabled.

Method NameRequest TypeResponse TypeDescription
ExecCommandExecCommandRequest streamExecCommandResponse stream

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)