blob: caeb2de9e03c5f17fecfb65e777d3caf585894db [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto3";
service GuestInteractionService {
rpc Get(GetRequest) returns (stream GetResponse);
rpc Put(stream PutRequest) returns (PutResponse);
rpc Exec(stream ExecRequest) returns (stream ExecResponse);
}
enum OperationStatus {
OK = 0;
GRPC_FAILURE = 1;
CLIENT_MISSING_FILE_FAILURE = 2;
CLIENT_CREATE_FILE_FAILURE = 3;
CLIENT_FILE_READ_FAILURE = 4;
CLIENT_FILE_WRITE_FAILURE = 5;
SERVER_MISSING_FILE_FAILURE = 6;
SERVER_CREATE_FILE_FAILURE = 7;
SERVER_FILE_READ_FAILURE = 8;
SERVER_FILE_WRITE_FAILURE = 9;
SERVER_EXEC_COMMAND_PARSE_FAILURE = 10;
SERVER_EXEC_FORK_FAILURE = 11;
}
message GetRequest {
string source = 1;
}
message GetResponse {
OperationStatus status = 1;
bytes data = 2;
}
message PutRequest {
string destination = 1;
bytes data = 2;
}
message PutResponse {
OperationStatus status = 1;
}
// ExecEnv encapsulates shell envirnoment variable key-value pairs to be
// injected when exec-ing a user's command.
message ExecEnv {
string key = 1;
string value = 2;
}
// ExecRequest mirrors the arguments to execve. The caller provides the path
// to the binary to be exec-ed along with arguments to be provided to the
// command and environment variables to be injected into the shell.
//
// The caller can continually stream stdin input to the forked child process.
message ExecRequest {
string argv = 1;
repeated ExecEnv env_vars = 2;
bytes std_in = 3;
}
message ExecResponse {
bytes std_out = 1;
bytes std_err = 2;
int32 ret_code = 3;
OperationStatus status = 4;
}