syntax = "proto3";

package containerd.runhcs.v1.diag;
option go_package = "github.com/Microsoft/hcsshim/internal/shimdiag;shimdiag";

service ShimDiag {
    rpc DiagExecInHost(ExecProcessRequest) returns (ExecProcessResponse);
    rpc DiagStacks(StacksRequest) returns (StacksResponse);
    rpc DiagTasks(TasksRequest) returns (TasksResponse);
    rpc DiagShare(ShareRequest) returns (ShareResponse);
    rpc DiagPid(PidRequest) returns (PidResponse);
}

message ExecProcessRequest {
    repeated string args = 1;
    string workdir = 2;
    bool terminal = 3;
    string stdin = 4;
    string stdout = 5;
    string stderr = 6;
}

message ExecProcessResponse {
    int32 exit_code = 1;
}

message StacksRequest {
}

message StacksResponse {
    string stacks = 1;
    string guest_stacks =2;
}

message ShareRequest {
    string host_path = 1;
    string uvm_path = 2;
    bool read_only = 3;
}

message ShareResponse {
}

message PidRequest{
}

message PidResponse{
    int32 pid = 1;
}

message TasksRequest {
    bool execs = 1;
}

message Task {
    string id = 1;
    repeated Exec execs = 2;
}

message Exec {
    string id = 1;
    string state = 2;
}

message TasksResponse {
    repeated Task tasks = 1;
}

