Documentation
¶
Overview ¶
Package v1alpha1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterMicroVMExecHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMicroVMExecHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MicroVMExecClient) error
- func RegisterMicroVMExecHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMicroVMExecHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MicroVMExecServer) error
- func RegisterMicroVMExecServer(s grpc.ServiceRegistrar, srv MicroVMExecServer)
- type ExecCommandRequest
- func (*ExecCommandRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ExecCommandRequest) GetPayload() isExecCommandRequest_Payload
- func (x *ExecCommandRequest) GetStart() *ExecStart
- func (x *ExecCommandRequest) GetStdin() []byte
- func (x *ExecCommandRequest) GetStdinEof() bool
- func (*ExecCommandRequest) ProtoMessage()
- func (x *ExecCommandRequest) ProtoReflect() protoreflect.Message
- func (x *ExecCommandRequest) Reset()
- func (x *ExecCommandRequest) String() string
- type ExecCommandRequest_Start
- type ExecCommandRequest_Stdin
- type ExecCommandRequest_StdinEof
- type ExecCommandResponse
- func (*ExecCommandResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ExecCommandResponse) GetError() string
- func (x *ExecCommandResponse) GetExitCode() int32
- func (x *ExecCommandResponse) GetPayload() isExecCommandResponse_Payload
- func (x *ExecCommandResponse) GetStderr() []byte
- func (x *ExecCommandResponse) GetStdout() []byte
- func (*ExecCommandResponse) ProtoMessage()
- func (x *ExecCommandResponse) ProtoReflect() protoreflect.Message
- func (x *ExecCommandResponse) Reset()
- func (x *ExecCommandResponse) String() string
- type ExecCommandResponse_Error
- type ExecCommandResponse_ExitCode
- type ExecCommandResponse_Stderr
- type ExecCommandResponse_Stdout
- type ExecStart
- func (*ExecStart) Descriptor() ([]byte, []int)deprecated
- func (x *ExecStart) GetArgs() []string
- func (x *ExecStart) GetCmd() string
- func (x *ExecStart) GetCwd() string
- func (x *ExecStart) GetEnv() map[string]string
- func (x *ExecStart) GetHasStdin() bool
- func (x *ExecStart) GetShell() bool
- func (x *ExecStart) GetTimeoutSeconds() int32
- func (x *ExecStart) GetUid() string
- func (x *ExecStart) GetUser() string
- func (*ExecStart) ProtoMessage()
- func (x *ExecStart) ProtoReflect() protoreflect.Message
- func (x *ExecStart) Reset()
- func (x *ExecStart) String() string
- type MicroVMExecClient
- type MicroVMExecServer
- type MicroVMExec_ExecCommandClient
- type MicroVMExec_ExecCommandServer
- type UnimplementedMicroVMExecServer
- type UnsafeMicroVMExecServer
Constants ¶
const (
MicroVMExec_ExecCommand_FullMethodName = "/microvmexec.services.api.v1alpha1.MicroVMExec/ExecCommand"
)
Variables ¶
var File_services_microvmexec_v1alpha1_microvmexec_proto protoreflect.FileDescriptor
var MicroVMExec_ServiceDesc = grpc.ServiceDesc{ ServiceName: "microvmexec.services.api.v1alpha1.MicroVMExec", HandlerType: (*MicroVMExecServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "ExecCommand", Handler: _MicroVMExec_ExecCommand_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "services/microvmexec/v1alpha1/microvmexec.proto", }
MicroVMExec_ServiceDesc is the grpc.ServiceDesc for MicroVMExec service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMicroVMExecHandler ¶
func RegisterMicroVMExecHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterMicroVMExecHandler registers the http handlers for service MicroVMExec to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterMicroVMExecHandlerClient ¶
func RegisterMicroVMExecHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MicroVMExecClient) error
RegisterMicroVMExecHandlerClient registers the http handlers for service MicroVMExec to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MicroVMExecClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MicroVMExecClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MicroVMExecClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterMicroVMExecHandlerFromEndpoint ¶
func RegisterMicroVMExecHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterMicroVMExecHandlerFromEndpoint is same as RegisterMicroVMExecHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterMicroVMExecHandlerServer ¶
func RegisterMicroVMExecHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MicroVMExecServer) error
RegisterMicroVMExecHandlerServer registers the http handlers for service MicroVMExec to "mux". UnaryRPC :call MicroVMExecServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMicroVMExecHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterMicroVMExecServer ¶
func RegisterMicroVMExecServer(s grpc.ServiceRegistrar, srv MicroVMExecServer)
Types ¶
type ExecCommandRequest ¶
type ExecCommandRequest struct {
// Types that are valid to be assigned to Payload:
//
// *ExecCommandRequest_Start
// *ExecCommandRequest_Stdin
// *ExecCommandRequest_StdinEof
Payload isExecCommandRequest_Payload `protobuf_oneof:"payload"`
// contains filtered or unexported fields
}
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.
func (*ExecCommandRequest) Descriptor
deprecated
func (*ExecCommandRequest) Descriptor() ([]byte, []int)
Deprecated: Use ExecCommandRequest.ProtoReflect.Descriptor instead.
func (*ExecCommandRequest) GetPayload ¶
func (x *ExecCommandRequest) GetPayload() isExecCommandRequest_Payload
func (*ExecCommandRequest) GetStart ¶
func (x *ExecCommandRequest) GetStart() *ExecStart
func (*ExecCommandRequest) GetStdin ¶
func (x *ExecCommandRequest) GetStdin() []byte
func (*ExecCommandRequest) GetStdinEof ¶
func (x *ExecCommandRequest) GetStdinEof() bool
func (*ExecCommandRequest) ProtoMessage ¶
func (*ExecCommandRequest) ProtoMessage()
func (*ExecCommandRequest) ProtoReflect ¶
func (x *ExecCommandRequest) ProtoReflect() protoreflect.Message
func (*ExecCommandRequest) Reset ¶
func (x *ExecCommandRequest) Reset()
func (*ExecCommandRequest) String ¶
func (x *ExecCommandRequest) String() string
type ExecCommandRequest_Start ¶
type ExecCommandRequest_Start struct {
Start *ExecStart `protobuf:"bytes,1,opt,name=start,proto3,oneof"`
}
type ExecCommandRequest_Stdin ¶
type ExecCommandRequest_Stdin struct {
Stdin []byte `protobuf:"bytes,2,opt,name=stdin,proto3,oneof"`
}
type ExecCommandRequest_StdinEof ¶
type ExecCommandRequest_StdinEof struct {
StdinEof bool `protobuf:"varint,3,opt,name=stdin_eof,json=stdinEof,proto3,oneof"`
}
type ExecCommandResponse ¶
type ExecCommandResponse struct {
// Types that are valid to be assigned to Payload:
//
// *ExecCommandResponse_Stdout
// *ExecCommandResponse_Stderr
// *ExecCommandResponse_ExitCode
// *ExecCommandResponse_Error
Payload isExecCommandResponse_Payload `protobuf_oneof:"payload"`
// contains filtered or unexported fields
}
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.
func (*ExecCommandResponse) Descriptor
deprecated
func (*ExecCommandResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExecCommandResponse.ProtoReflect.Descriptor instead.
func (*ExecCommandResponse) GetError ¶
func (x *ExecCommandResponse) GetError() string
func (*ExecCommandResponse) GetExitCode ¶
func (x *ExecCommandResponse) GetExitCode() int32
func (*ExecCommandResponse) GetPayload ¶
func (x *ExecCommandResponse) GetPayload() isExecCommandResponse_Payload
func (*ExecCommandResponse) GetStderr ¶
func (x *ExecCommandResponse) GetStderr() []byte
func (*ExecCommandResponse) GetStdout ¶
func (x *ExecCommandResponse) GetStdout() []byte
func (*ExecCommandResponse) ProtoMessage ¶
func (*ExecCommandResponse) ProtoMessage()
func (*ExecCommandResponse) ProtoReflect ¶
func (x *ExecCommandResponse) ProtoReflect() protoreflect.Message
func (*ExecCommandResponse) Reset ¶
func (x *ExecCommandResponse) Reset()
func (*ExecCommandResponse) String ¶
func (x *ExecCommandResponse) String() string
type ExecCommandResponse_Error ¶
type ExecCommandResponse_Error struct {
Error string `protobuf:"bytes,4,opt,name=error,proto3,oneof"`
}
type ExecCommandResponse_ExitCode ¶
type ExecCommandResponse_ExitCode struct {
ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3,oneof"`
}
type ExecCommandResponse_Stderr ¶
type ExecCommandResponse_Stderr struct {
Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3,oneof"`
}
type ExecCommandResponse_Stdout ¶
type ExecCommandResponse_Stdout struct {
Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3,oneof"`
}
type ExecStart ¶
type ExecStart struct {
// uid is the microvm identifier, as used by MicroVM.GetMicroVM/DeleteMicroVM.
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
Cmd string `protobuf:"bytes,2,opt,name=cmd,proto3" json:"cmd,omitempty"`
Args []string `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"`
// cwd is the working directory; empty means the guest-agent's cwd.
Cwd string `protobuf:"bytes,4,opt,name=cwd,proto3" json:"cwd,omitempty"`
// env entries are added to (and override) the guest-agent's environment.
Env map[string]string `` /* 133-byte string literal not displayed */
// shell runs "sh -c <cmd + args joined>" instead of a direct exec.
Shell bool `protobuf:"varint,6,opt,name=shell,proto3" json:"shell,omitempty"`
// user, if set, runs the command as that guest system user.
User string `protobuf:"bytes,7,opt,name=user,proto3" json:"user,omitempty"`
// timeout_seconds bounds the run; 0 means unbounded.
TimeoutSeconds int32 `protobuf:"varint,8,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"`
// has_stdin tells the server to expect streamed stdin messages.
HasStdin bool `protobuf:"varint,9,opt,name=has_stdin,json=hasStdin,proto3" json:"has_stdin,omitempty"`
// contains filtered or unexported fields
}
ExecStart describes the microvm to target and the command to run, mirroring the guest-agent's own exec request fields.
func (*ExecStart) Descriptor
deprecated
func (*ExecStart) GetHasStdin ¶
func (*ExecStart) GetTimeoutSeconds ¶
func (*ExecStart) ProtoMessage ¶
func (*ExecStart) ProtoMessage()
func (*ExecStart) ProtoReflect ¶
func (x *ExecStart) ProtoReflect() protoreflect.Message
type MicroVMExecClient ¶
type MicroVMExecClient interface {
ExecCommand(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ExecCommandRequest, ExecCommandResponse], error)
}
MicroVMExecClient is the client API for MicroVMExec service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
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.
func NewMicroVMExecClient ¶
func NewMicroVMExecClient(cc grpc.ClientConnInterface) MicroVMExecClient
type MicroVMExecServer ¶
type MicroVMExecServer interface {
ExecCommand(grpc.BidiStreamingServer[ExecCommandRequest, ExecCommandResponse]) error
}
MicroVMExecServer is the server API for MicroVMExec service. All implementations should embed UnimplementedMicroVMExecServer for forward compatibility.
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.
type MicroVMExec_ExecCommandClient ¶
type MicroVMExec_ExecCommandClient = grpc.BidiStreamingClient[ExecCommandRequest, ExecCommandResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type MicroVMExec_ExecCommandServer ¶
type MicroVMExec_ExecCommandServer = grpc.BidiStreamingServer[ExecCommandRequest, ExecCommandResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type UnimplementedMicroVMExecServer ¶
type UnimplementedMicroVMExecServer struct{}
UnimplementedMicroVMExecServer should be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedMicroVMExecServer) ExecCommand ¶
func (UnimplementedMicroVMExecServer) ExecCommand(grpc.BidiStreamingServer[ExecCommandRequest, ExecCommandResponse]) error
type UnsafeMicroVMExecServer ¶
type UnsafeMicroVMExecServer interface {
// contains filtered or unexported methods
}
UnsafeMicroVMExecServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MicroVMExecServer will result in compilation errors.