syntax = "proto3"; package os; option go_package = "github.com/talos-systems/talos/api/os"; option java_multiple_files = true; option java_outer_classname = "OsApi"; option java_package = "com.os.api"; import "google/protobuf/empty.proto"; import "common/common.proto"; // The OS service definition. // // OS Service also implements all the API of Init Service service OS { rpc Containers(ContainersRequest) returns (ContainersReply); rpc Dmesg(google.protobuf.Empty) returns (common.DataReply); rpc Logs(LogsRequest) returns (stream common.Data); rpc Processes(google.protobuf.Empty) returns (ProcessesReply); rpc Restart(RestartRequest) returns (RestartReply); rpc Stats(StatsRequest) returns (StatsReply); } // rpc Containers // The request message containing the containerd namespace. enum ContainerDriver { CONTAINERD = 0; CRI = 1; } message ContainersRequest { string namespace = 1; // driver might be default "containerd" or "cri" ContainerDriver driver = 2; } // The response message containing the requested containers. message Container { string namespace = 1; string id = 2; string image = 3; uint32 pid = 4; string status = 5; string pod_id = 6; string name = 7; } // The response message containing the requested containers. message ContainerResponse { common.NodeMetadata metadata = 1; repeated Container containers = 2; } message ContainersReply { repeated ContainerResponse response = 1; } // rpc dmesg // rpc kubeconfig // rpc logs // The request message containing the process name. message LogsRequest { string namespace = 1; string id = 2; // driver might be default "containerd" or "cri" ContainerDriver driver = 3; } // rpc processes message ProcessesRequest {} message ProcessesReply { repeated ProcessResponse response = 1; } message ProcessResponse { common.NodeMetadata metadata = 1; repeated Process processes = 2; } message Process { int32 pid = 1; int32 ppid = 2; string state = 3; int32 threads = 4; double cpu_time = 5; uint64 virtual_memory = 6; uint64 resident_memory = 7; string command = 8; string executable = 9; string args = 10; } // rpc restart // The request message containing the process to restart. message RestartRequest { string namespace = 1; string id = 2; // driver might be default "containerd" or "cri" ContainerDriver driver = 3; } message RestartResponse { common.NodeMetadata metadata = 1; } // The response message containing the restart status. message RestartReply { repeated RestartResponse response = 1; } // rpc stats // The request message containing the containerd namespace. message StatsRequest { string namespace = 1; // driver might be default "containerd" or "cri" ContainerDriver driver = 2; } // The response message containing the requested stats. message StatsResponse { common.NodeMetadata metadata = 1; repeated Stat stats = 2; } message StatsReply { repeated StatsResponse response = 1; } // The response message containing the requested stat. message Stat { string namespace = 1; string id = 2; uint64 memory_usage = 4; uint64 cpu_usage = 5; string pod_id = 6; string name = 7; }