syntax = "proto3"; package machine; option go_package = "github.com/talos-systems/talos/pkg/machinery/api/machine"; import "google/protobuf/any.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; import "common/common.proto"; // The machine service definition. service MachineService { rpc ApplyConfiguration(ApplyConfigurationRequest) returns (ApplyConfigurationResponse); // Bootstrap method makes control plane node enter etcd bootstrap mode. // // Node aborts etcd join sequence and creates single-node etcd cluster. // // If recover_etcd argument is specified, etcd is recovered from a snapshot // uploaded with EtcdRecover. rpc Bootstrap(BootstrapRequest) returns (BootstrapResponse); rpc Containers(ContainersRequest) returns (ContainersResponse); rpc Copy(CopyRequest) returns (stream common.Data); rpc CPUInfo(google.protobuf.Empty) returns (CPUInfoResponse); rpc DiskStats(google.protobuf.Empty) returns (DiskStatsResponse); rpc Dmesg(DmesgRequest) returns (stream common.Data); rpc Events(EventsRequest) returns (stream Event); rpc EtcdMemberList(EtcdMemberListRequest) returns (EtcdMemberListResponse); rpc EtcdRemoveMember(EtcdRemoveMemberRequest) returns (EtcdRemoveMemberResponse); rpc EtcdLeaveCluster(EtcdLeaveClusterRequest) returns (EtcdLeaveClusterResponse); rpc EtcdForfeitLeadership(EtcdForfeitLeadershipRequest) returns (EtcdForfeitLeadershipResponse); // EtcdRecover method uploads etcd data snapshot created with EtcdSnapshot // to the node. // // Snapshot can be later used to recover the cluster via Bootstrap method. rpc EtcdRecover(stream common.Data) returns (EtcdRecoverResponse); // EtcdSnapshot method creates etcd data snapshot (backup) from the local etcd instance // and streams it back to the client. // // This method is available only on control plane nodes (which run etcd). rpc EtcdSnapshot(EtcdSnapshotRequest) returns (stream common.Data); rpc GenerateConfiguration(GenerateConfigurationRequest) returns (GenerateConfigurationResponse); rpc Hostname(google.protobuf.Empty) returns (HostnameResponse); rpc Kubeconfig(google.protobuf.Empty) returns (stream common.Data); rpc List(ListRequest) returns (stream FileInfo); rpc DiskUsage(DiskUsageRequest) returns (stream DiskUsageInfo); rpc LoadAvg(google.protobuf.Empty) returns (LoadAvgResponse); rpc Logs(LogsRequest) returns (stream common.Data); rpc Memory(google.protobuf.Empty) returns (MemoryResponse); rpc Mounts(google.protobuf.Empty) returns (MountsResponse); rpc NetworkDeviceStats(google.protobuf.Empty) returns (NetworkDeviceStatsResponse); rpc Processes(google.protobuf.Empty) returns (ProcessesResponse); rpc Read(ReadRequest) returns (stream common.Data); rpc Reboot(google.protobuf.Empty) returns (RebootResponse); rpc Restart(RestartRequest) returns (RestartResponse); rpc Rollback(RollbackRequest) returns (RollbackResponse); rpc Reset(ResetRequest) returns (ResetResponse); rpc ServiceList(google.protobuf.Empty) returns (ServiceListResponse); rpc ServiceRestart(ServiceRestartRequest) returns (ServiceRestartResponse); rpc ServiceStart(ServiceStartRequest) returns (ServiceStartResponse); rpc ServiceStop(ServiceStopRequest) returns (ServiceStopResponse); rpc Shutdown(google.protobuf.Empty) returns (ShutdownResponse); rpc Stats(StatsRequest) returns (StatsResponse); rpc SystemStat(google.protobuf.Empty) returns (SystemStatResponse); rpc Upgrade(UpgradeRequest) returns (UpgradeResponse); rpc Version(google.protobuf.Empty) returns (VersionResponse); // GenerateClientConfiguration generates talosctl client configuration (talosconfig). rpc GenerateClientConfiguration(GenerateClientConfigurationRequest) returns (GenerateClientConfigurationResponse); } // rpc applyConfiguration // ApplyConfiguration describes a request to assert a new configuration upon a // node. message ApplyConfigurationRequest { bytes data = 1; bool on_reboot = 2; bool immediate = 3; } // ApplyConfigurationResponse describes the response to a configuration request. message ApplyConfiguration { common.Metadata metadata = 1; // Configuration validation warnings. repeated string warnings = 2; } message ApplyConfigurationResponse { repeated ApplyConfiguration messages = 1; } // rpc reboot // The reboot message containing the reboot status. message Reboot { common.Metadata metadata = 1; } message RebootResponse { repeated Reboot messages = 1; } // rpc Bootstrap message BootstrapRequest { // Enable etcd recovery from the snapshot. // // Snapshot should be uploaded before this call via EtcdRecover RPC. bool recover_etcd = 1; // Skip hash check on the snapshot (etcd). // // Enable this when recovering from data directory copy to skip integrity check. bool recover_skip_hash_check = 2; } // The bootstrap message containing the bootstrap status. message Bootstrap { common.Metadata metadata = 1; } message BootstrapResponse { repeated Bootstrap messages = 1; } // rpc events message SequenceEvent { string sequence = 1; enum Action { NOOP = 0; START = 1; STOP = 2; } Action action = 2; common.Error error = 3; } message PhaseEvent { string phase = 1; enum Action { START = 0; STOP = 1; } Action action = 2; } message TaskEvent { string task = 1; enum Action { START = 0; STOP = 1; } Action action = 2; } message ServiceStateEvent { string service = 1; enum Action { INITIALIZED = 0; PREPARING = 1; WAITING = 2; RUNNING = 3; STOPPING = 4; FINISHED = 5; FAILED = 6; SKIPPED = 7; }; Action action = 2; string message = 3; ServiceHealth health = 4; }; message RestartEvent { int64 cmd = 1; }; message EventsRequest { int32 tail_events = 1; string tail_id = 2; int32 tail_seconds = 3; } message Event { common.Metadata metadata = 1; google.protobuf.Any data = 2; string id = 3; } // rpc reset message ResetPartitionSpec { string label = 1; bool wipe = 2; } message ResetRequest { // Graceful indicates whether node should leave etcd before the upgrade, it also // enforces etcd checks before leaving. bool graceful = 1; // Reboot indicates whether node should reboot or halt after resetting. bool reboot = 2; // System_partitions_to_wipe lists specific system disk partitions to be reset (wiped). // If system_partitions_to_wipe is empty, all the partitions are erased. repeated ResetPartitionSpec system_partitions_to_wipe = 3; } // The reset message containing the restart status. message Reset { common.Metadata metadata = 1; } message ResetResponse { repeated Reset messages = 1; } // rpc shutdown // The messages message containing the shutdown status. message Shutdown { common.Metadata metadata = 1; } message ShutdownResponse { repeated Shutdown messages = 1; } // rpc upgrade message UpgradeRequest { string image = 1; bool preserve = 2; bool stage = 3; bool force = 4; } message Upgrade { common.Metadata metadata = 1; string ack = 2; } message UpgradeResponse { repeated Upgrade messages = 1; } // rpc servicelist message ServiceList { common.Metadata metadata = 1; repeated ServiceInfo services = 2; } message ServiceListResponse { repeated ServiceList messages = 1; } message ServiceInfo { string id = 1; string state = 2; ServiceEvents events = 3; ServiceHealth health = 4; } message ServiceEvents { repeated ServiceEvent events = 1; } message ServiceEvent { string msg = 1; string state = 2; google.protobuf.Timestamp ts = 3; } message ServiceHealth { bool unknown = 1; bool healthy = 2; string last_message = 3; google.protobuf.Timestamp last_change = 4; } // rpc servicestart message ServiceStartRequest { string id = 1; } message ServiceStart { common.Metadata metadata = 1; string resp = 2; } message ServiceStartResponse { repeated ServiceStart messages = 1; } message ServiceStopRequest { string id = 1; } message ServiceStop { common.Metadata metadata = 1; string resp = 2; } message ServiceStopResponse { repeated ServiceStop messages = 1; } message ServiceRestartRequest { string id = 1; } message ServiceRestart { common.Metadata metadata = 1; string resp = 2; } message ServiceRestartResponse { repeated ServiceRestart messages = 1; } message StartRequest { option deprecated = true; string id = 1; } message StartResponse { option deprecated = true; string resp = 1; } message StopRequest { option deprecated = true; string id = 1; } message StopResponse { option deprecated = true; string resp = 1; } // CopyRequest describes a request to copy data out of Talos node // // Copy produces .tar.gz archive which is streamed back to the caller message CopyRequest { // Root path to start copying data out, it might be either a file or directory string root_path = 1; } // ListRequest describes a request to list the contents of a directory. message ListRequest { // Root indicates the root directory for the list. If not indicated, '/' is // presumed. string root = 1; // Recurse indicates that subdirectories should be recursed. bool recurse = 2; // RecursionDepth indicates how many levels of subdirectories should be // recursed. The default (0) indicates that no limit should be enforced. int32 recursion_depth = 3; // File type. enum Type { // Regular file (not directory, symlink, etc). REGULAR = 0; // Directory. DIRECTORY = 1; // Symbolic link. SYMLINK = 2; } // Types indicates what file type should be returned. If not indicated, // all files will be returned. repeated Type types = 4; } // DiskUsageRequest describes a request to list disk usage of directories and regular files message DiskUsageRequest { // RecursionDepth indicates how many levels of subdirectories should be // recursed. The default (0) indicates that no limit should be enforced. int32 recursion_depth = 1; // All write sizes for all files, not just directories. bool all = 2; // Threshold exclude entries smaller than SIZE if positive, // or entries greater than SIZE if negative. int64 threshold = 3; // DiskUsagePaths is the list of directories to calculate disk usage for. repeated string paths = 4; } // FileInfo describes a file or directory's information message FileInfo { common.Metadata metadata = 1; // Name is the name (including prefixed path) of the file or directory string name = 2; // Size indicates the number of bytes contained within the file int64 size = 3; // Mode is the bitmap of UNIX mode/permission flags of the file uint32 mode = 4; // Modified indicates the UNIX timestamp at which the file was last modified int64 modified = 5; // TODO: unix timestamp or include proto's Date type // IsDir indicates that the file is a directory bool is_dir = 6; // Error describes any error encountered while trying to read the file // information. string error = 7; // Link is filled with symlink target string link = 8; // RelativeName is the name of the file or directory relative to the RootPath string relative_name = 9; // Owner uid uint32 uid = 10; // Owner gid uint32 gid = 11; } // DiskUsageInfo describes a file or directory's information for du command message DiskUsageInfo { common.Metadata metadata = 1; // Name is the name (including prefixed path) of the file or directory string name = 2; // Size indicates the number of bytes contained within the file int64 size = 3; // Error describes any error encountered while trying to read the file // information. string error = 4; // RelativeName is the name of the file or directory relative to the RootPath string relative_name = 5; } // The messages message containing the requested df stats. message Mounts { common.Metadata metadata = 1; repeated MountStat stats = 2; } message MountsResponse { repeated Mounts messages = 1; } // The messages message containing the requested processes. message MountStat { string filesystem = 1; uint64 size = 2; uint64 available = 3; string mounted_on = 4; } message Version { common.Metadata metadata = 1; VersionInfo version = 2; PlatformInfo platform = 3; // Features describe individual Talos features that can be switched on or off. FeaturesInfo features = 4; } message VersionResponse { repeated Version messages = 1; } message VersionInfo { string tag = 1; string sha = 2; string built = 3; string go_version = 4; string os = 5; string arch = 6; } message PlatformInfo { string name = 1; string mode = 2; } // FeaturesInfo describes individual Talos features that can be switched on or off. message FeaturesInfo { // RBAC is true if role-based access control is enabled. bool rbac = 1; } // rpc logs // The request message containing the process name. message LogsRequest { string namespace = 1; string id = 2; // driver might be default "containerd" or "cri" common.ContainerDriver driver = 3; bool follow = 4; int32 tail_lines = 5; } message ReadRequest { string path = 1; } // rpc rollback message RollbackRequest {} message Rollback { common.Metadata metadata = 1; } message RollbackResponse { repeated Rollback messages = 1; } // rpc Containers message ContainersRequest { string namespace = 1; // driver might be default "containerd" or "cri" common.ContainerDriver driver = 2; } // The messages message containing the requested containers. message ContainerInfo { string namespace = 1; string id = 2; string image = 3; uint32 pid = 4; string status = 5; string pod_id = 6; string name = 7; } // The messages message containing the requested containers. message Container { common.Metadata metadata = 1; repeated ContainerInfo containers = 2; } message ContainersResponse { repeated Container messages = 1; } // dmesg message DmesgRequest { bool follow = 1; bool tail = 2; } // rpc processes message ProcessesResponse { repeated Process messages = 1; } message Process { common.Metadata metadata = 1; repeated ProcessInfo processes = 2; } message ProcessInfo { 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" common.ContainerDriver driver = 3; } message Restart { common.Metadata metadata = 1; } // The messages message containing the restart status. message RestartResponse { repeated Restart messages = 1; } // rpc stats // The request message containing the containerd namespace. message StatsRequest { string namespace = 1; // driver might be default "containerd" or "cri" common.ContainerDriver driver = 2; } // The messages message containing the requested stats. message Stats { common.Metadata metadata = 1; repeated Stat stats = 2; } message StatsResponse { repeated Stats messages = 1; } // The messages 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; } message Memory { common.Metadata metadata = 1; MemInfo meminfo = 2; } message MemoryResponse { repeated Memory messages = 1; } message MemInfo { uint64 memtotal = 1; uint64 memfree = 2; uint64 memavailable = 3; uint64 buffers = 4; uint64 cached = 5; uint64 swapcached = 6; uint64 active = 7; uint64 inactive = 8; uint64 activeanon = 9; uint64 inactiveanon = 10; uint64 activefile = 11; uint64 inactivefile = 12; uint64 unevictable = 13; uint64 mlocked = 14; uint64 swaptotal = 15; uint64 swapfree = 16; uint64 dirty = 17; uint64 writeback = 18; uint64 anonpages = 19; uint64 mapped = 20; uint64 shmem = 21; uint64 slab = 22; uint64 sreclaimable = 23; uint64 sunreclaim = 24; uint64 kernelstack = 25; uint64 pagetables = 26; uint64 nfsunstable = 27; uint64 bounce = 28; uint64 writebacktmp = 29; uint64 commitlimit = 30; uint64 committedas = 31; uint64 vmalloctotal = 32; uint64 vmallocused = 33; uint64 vmallocchunk = 34; uint64 hardwarecorrupted = 35; uint64 anonhugepages = 36; uint64 shmemhugepages = 37; uint64 shmempmdmapped = 38; uint64 cmatotal = 39; uint64 cmafree = 40; uint64 hugepagestotal = 41; uint64 hugepagesfree = 42; uint64 hugepagesrsvd = 43; uint64 hugepagessurp = 44; uint64 hugepagesize = 45; uint64 directmap4k = 46; uint64 directmap2m = 47; uint64 directmap1g = 48; } // rpc Hostname message HostnameResponse { repeated Hostname messages = 1; } message Hostname { common.Metadata metadata = 1; string hostname = 2; } // rpc LoadAvg message LoadAvgResponse { repeated LoadAvg messages = 1; } message LoadAvg { common.Metadata metadata = 1; double load1 = 2; double load5 = 3; double load15 = 4; } // rpc SystemStat message SystemStatResponse { repeated SystemStat messages = 1; } message SystemStat { common.Metadata metadata = 1; uint64 boot_time = 2; CPUStat cpu_total = 3; repeated CPUStat cpu = 4; uint64 irq_total = 5; repeated uint64 irq = 6; uint64 context_switches = 7; uint64 process_created = 8; uint64 process_running = 9; uint64 process_blocked = 10; uint64 soft_irq_total = 11; SoftIRQStat soft_irq = 12; } message CPUStat { double user = 1; double nice = 2; double system = 3; double idle = 4; double iowait = 5; double irq = 6; double soft_irq = 7; double steal = 8; double guest = 9; double guest_nice = 10; } message SoftIRQStat { uint64 hi = 1; uint64 timer = 2; uint64 net_tx = 3; uint64 net_rx = 4; uint64 block = 5; uint64 block_io_poll = 6; uint64 tasklet = 7; uint64 sched = 8; uint64 hrtimer = 9; uint64 rcu = 10; } // rpc CPUInfo message CPUInfoResponse { repeated CPUsInfo messages = 1; } message CPUsInfo { common.Metadata metadata = 1; repeated CPUInfo cpu_info = 2; } message CPUInfo { uint32 processor = 1; string vendor_id = 2; string cpu_family = 3; string model = 4; string model_name = 5; string stepping = 6; string microcode = 7; double cpu_mhz = 8; string cache_size = 9; string physical_id = 10; uint32 siblings = 11; string core_id = 12; uint32 cpu_cores = 13; string apic_id = 14; string initial_apic_id = 15; string fpu = 16; string fpu_exception = 17; uint32 cpu_id_level = 18; string wp = 19; repeated string flags = 20; repeated string bugs = 21; double bogo_mips = 22; uint32 cl_flush_size = 23; uint32 cache_alignment = 24; string address_sizes = 25; string power_management = 26; } // rpc NetworkDeviceStats message NetworkDeviceStatsResponse { repeated NetworkDeviceStats messages = 1; } message NetworkDeviceStats { common.Metadata metadata = 1; NetDev total = 2; repeated NetDev devices = 3; } message NetDev { string name = 1; uint64 rx_bytes = 2; uint64 rx_packets = 3; uint64 rx_errors = 4; uint64 rx_dropped = 5; uint64 rx_fifo = 6; uint64 rx_frame = 7; uint64 rx_compressed = 8; uint64 rx_multicast = 9; uint64 tx_bytes = 10; uint64 tx_packets = 11; uint64 tx_errors = 12; uint64 tx_dropped = 13; uint64 tx_fifo = 14; uint64 tx_collisions = 15; uint64 tx_carrier = 16; uint64 tx_compressed = 17; } // rpc DiskStats message DiskStatsResponse { repeated DiskStats messages = 1; } message DiskStats { common.Metadata metadata = 1; DiskStat total = 2; repeated DiskStat devices = 3; } message DiskStat { string name = 1; uint64 read_completed = 2; uint64 read_merged = 3; uint64 read_sectors = 4; uint64 read_time_ms = 5; uint64 write_completed = 6; uint64 write_merged = 7; uint64 write_sectors = 8; uint64 write_time_ms = 9; uint64 io_in_progress = 10; uint64 io_time_ms = 11; uint64 io_time_weighted_ms = 12; uint64 discard_completed = 13; uint64 discard_merged = 14; uint64 discard_sectors = 15; uint64 discard_time_ms = 16; } message EtcdLeaveClusterRequest {} message EtcdLeaveCluster { common.Metadata metadata = 1; } message EtcdLeaveClusterResponse { repeated EtcdLeaveCluster messages = 1; } message EtcdRemoveMemberRequest { string member = 1; } message EtcdRemoveMember { common.Metadata metadata = 1; } message EtcdRemoveMemberResponse { repeated EtcdRemoveMember messages = 1; } message EtcdForfeitLeadershipRequest {} message EtcdForfeitLeadership { common.Metadata metadata = 1; string member = 2; } message EtcdForfeitLeadershipResponse { repeated EtcdForfeitLeadership messages = 1; } message EtcdMemberListRequest { bool query_local = 1; } // EtcdMember describes a single etcd member. message EtcdMember { // member ID. uint64 id = 2; // human-readable name of the member. string hostname = 3; // the list of URLs the member exposes to clients for communication. repeated string peer_urls = 4; // the list of URLs the member exposes to the cluster for communication. repeated string client_urls = 5; // learner flag bool is_learner = 6; } // EtcdMembers contains the list of members registered on the host. message EtcdMembers { common.Metadata metadata = 1; // list of member hostnames. repeated string legacy_members = 2; // the list of etcd members registered on the node. repeated EtcdMember members = 3; } message EtcdMemberListResponse { repeated EtcdMembers messages = 1; } message EtcdSnapshotRequest {} message EtcdRecover { common.Metadata metadata = 1; } message EtcdRecoverResponse { repeated EtcdRecover messages = 1; } // rpc generateConfiguration message RouteConfig { string network = 1; string gateway = 2; uint32 metric = 3; } message DHCPOptionsConfig { uint32 route_metric = 1; } message NetworkDeviceConfig { string interface = 1; string cidr = 2; int32 mtu = 3; bool dhcp = 4; bool ignore = 5; DHCPOptionsConfig dhcp_options = 6; repeated RouteConfig routes = 7; } message NetworkConfig { string hostname = 1; repeated NetworkDeviceConfig interfaces = 2; } message InstallConfig { string install_disk = 1; string install_image = 2; } message MachineConfig { enum MachineType { option allow_alias = true; TYPE_UNKNOWN = 0; TYPE_INIT = 1; TYPE_CONTROL_PLANE = 2; TYPE_WORKER = 3; // Alias for TYPE_WORKER. TYPE_JOIN = 3 [deprecated = true]; }; MachineType type = 1; InstallConfig install_config = 2; NetworkConfig network_config = 3; string kubernetes_version = 4; } message ControlPlaneConfig { string endpoint = 1; } message CNIConfig { string name = 1; repeated string urls = 2; } message ClusterNetworkConfig { string dns_domain = 1; CNIConfig cni_config = 2; } message ClusterConfig { string name = 1; ControlPlaneConfig control_plane = 2; ClusterNetworkConfig cluster_network = 3; bool allow_scheduling_on_masters = 4; } // GenerateConfigurationRequest describes a request to generate a new configuration // on a node. message GenerateConfigurationRequest { string config_version = 1; ClusterConfig cluster_config = 2; MachineConfig machine_config = 3; google.protobuf.Timestamp override_time = 4; } // GenerateConfiguration describes the response to a generate configuration request. message GenerateConfiguration { common.Metadata metadata = 1; repeated bytes data = 2; bytes talosconfig = 3; } message GenerateConfigurationResponse { repeated GenerateConfiguration messages = 1; } message GenerateClientConfigurationRequest { // Roles in the generated client certificate. repeated string roles = 1; // Client certificate TTL. google.protobuf.Duration crt_ttl = 2; } message GenerateClientConfiguration { common.Metadata metadata = 1; // PEM-encoded CA certificate. bytes ca = 2; // PEM-encoded generated client certificate. bytes crt = 3; // PEM-encoded generated client key. bytes key = 4; // Client configuration (talosconfig) file content. bytes talosconfig = 5; } message GenerateClientConfigurationResponse { repeated GenerateClientConfiguration messages = 1; }