2019-04-26 23:04:24 +03:00
syntax = "proto3" ;
2019-10-23 21:31:18 -05:00
package machine ;
2019-04-26 23:04:24 +03:00
2022-11-02 15:06:45 +04:00
option go_package = "github.com/siderolabs/talos/pkg/machinery/api/machine" ;
2019-08-27 21:45:59 +00:00
2021-11-23 15:03:38 +00:00
import "common/common.proto" ;
2020-05-07 22:50:41 -07:00
import "google/protobuf/any.proto" ;
2021-11-23 15:03:38 +00:00
import "google/protobuf/duration.proto" ;
2019-04-26 23:04:24 +03:00
import "google/protobuf/empty.proto" ;
feat(init): implement services list API and osctl service CLI (#662)
This returns list of all the services registered, with their current
status, past events, health state, etc.
New CLI is `osctl service [<id>]`: without `<id>` it prints list of all
the services, with specific `<id>` it provides details for a service.
I decided to create "parallel" data structures in protobuf as Go
structures don't map nicely onto what protoc generates: pointers vs.
values, additional fields like mutexes, etc. Probably there's a better
approach, I'm open for it.
For CLI, I tried to keep CLI stuff in `cmd/` package, and I also created
simple wrapper to remove duplicated code which sets up client for each
command.
Examples:
```
$ osctl service
SERVICE STATE HEALTH LAST CHANGE LAST EVENT
containerd Running OK 21s ago Health check successful
kubeadm Running ? 2s ago Started task kubeadm (PID 280) for container kubeadm
kubelet Running ? 0s ago Started task kubelet (PID 383) for container kubelet
ntpd Running ? 14s ago Started task ntpd (PID 129) for container ntpd
osd Running ? 14s ago Started task osd (PID 126) for container osd
proxyd Waiting ? 14s ago Waiting for conditions
trustd Running ? 14s ago Started task trustd (PID 125) for container trustd
udevd Running ? 14s ago Started task udevd (PID 130) for container udevd
```
```
$ osctl service proxyd
ID proxyd
STATE Running
HEALTH ?
EVENTS [Preparing]: Running pre state (22s ago)
[Waiting]: Waiting for conditions (22s ago)
[Preparing]: Creating service runner (6s ago)
[Running]: Started task proxyd (PID 461) for container proxyd (6s ago)
```
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-05-17 18:01:12 +03:00
import "google/protobuf/timestamp.proto" ;
2020-11-02 14:54:58 -08:00
2019-09-20 16:32:34 +00:00
// The machine service definition.
2019-12-11 18:19:40 +00:00
service MachineService {
2021-11-23 15:03:38 +00:00
rpc ApplyConfiguration ( ApplyConfigurationRequest ) returns ( ApplyConfigurationResponse ) ;
2021-04-06 21:36:30 +03:00
// 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.
2020-06-09 18:48:40 +00:00
rpc Bootstrap ( BootstrapRequest ) returns ( BootstrapResponse ) ;
2020-07-13 20:56:47 +03:00
rpc Containers ( ContainersRequest ) returns ( ContainersResponse ) ;
2019-12-11 18:19:40 +00:00
rpc Copy ( CopyRequest ) returns ( stream common.Data ) ;
2020-07-15 00:11:38 +03:00
rpc CPUInfo ( google.protobuf.Empty ) returns ( CPUInfoResponse ) ;
rpc DiskStats ( google.protobuf.Empty ) returns ( DiskStatsResponse ) ;
2020-07-13 20:56:47 +03:00
rpc Dmesg ( DmesgRequest ) returns ( stream common.Data ) ;
2020-05-15 20:47:54 +03:00
rpc Events ( EventsRequest ) returns ( stream Event ) ;
2020-10-03 12:04:13 -07:00
rpc EtcdMemberList ( EtcdMemberListRequest ) returns ( EtcdMemberListResponse ) ;
2022-10-13 16:43:22 +02:00
// EtcdRemoveMemberByID removes a member from the etcd cluster identified by member ID.
// This API should be used to remove members which don't have an associated Talos node anymore.
// To remove a member with a running Talos node, use EtcdLeaveCluster API on the node to be removed.
rpc EtcdRemoveMemberByID ( EtcdRemoveMemberByIDRequest ) returns ( EtcdRemoveMemberByIDResponse ) ;
2021-11-23 15:03:38 +00:00
rpc EtcdLeaveCluster ( EtcdLeaveClusterRequest ) returns ( EtcdLeaveClusterResponse ) ;
rpc EtcdForfeitLeadership ( EtcdForfeitLeadershipRequest ) returns ( EtcdForfeitLeadershipResponse ) ;
2021-04-06 21:36:30 +03:00
// 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 ) ;
2021-03-30 23:27:10 +03:00
// 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 ) ;
2023-01-03 17:49:30 +04:00
// EtcdAlarmList lists etcd alarms for the current node.
// This method is available only on control plane nodes (which run etcd).
rpc EtcdAlarmList ( google.protobuf.Empty ) returns ( EtcdAlarmListResponse ) ;
// EtcdAlarmDisarm disarms etcd alarms for the current node.
// This method is available only on control plane nodes (which run etcd).
rpc EtcdAlarmDisarm ( google.protobuf.Empty ) returns ( EtcdAlarmDisarmResponse ) ;
// EtcdDefragment defragments etcd data directory for the current node.
// Defragmentation is a resource-heavy operation, so it should only run on a specific
// node.
// This method is available only on control plane nodes (which run etcd).
rpc EtcdDefragment ( google.protobuf.Empty ) returns ( EtcdDefragmentResponse ) ;
// EtcdStatus returns etcd status for the current member.
// This method is available only on control plane nodes (which run etcd).
rpc EtcdStatus ( google.protobuf.Empty ) returns ( EtcdStatusResponse ) ;
2021-11-23 15:03:38 +00:00
rpc GenerateConfiguration ( GenerateConfigurationRequest ) returns ( GenerateConfigurationResponse ) ;
2020-07-15 00:11:38 +03:00
rpc Hostname ( google.protobuf.Empty ) returns ( HostnameResponse ) ;
2019-12-11 18:19:40 +00:00
rpc Kubeconfig ( google.protobuf.Empty ) returns ( stream common.Data ) ;
rpc List ( ListRequest ) returns ( stream FileInfo ) ;
2020-10-13 14:31:31 +03:00
rpc DiskUsage ( DiskUsageRequest ) returns ( stream DiskUsageInfo ) ;
2020-07-15 00:11:38 +03:00
rpc LoadAvg ( google.protobuf.Empty ) returns ( LoadAvgResponse ) ;
2019-12-11 18:19:40 +00:00
rpc Logs ( LogsRequest ) returns ( stream common.Data ) ;
2024-03-11 17:01:29 +03:00
rpc LogsContainers ( google.protobuf.Empty ) returns ( LogsContainersResponse ) ;
2020-07-13 20:56:47 +03:00
rpc Memory ( google.protobuf.Empty ) returns ( MemoryResponse ) ;
2019-12-11 18:19:40 +00:00
rpc Mounts ( google.protobuf.Empty ) returns ( MountsResponse ) ;
2021-11-23 15:03:38 +00:00
rpc NetworkDeviceStats ( google.protobuf.Empty ) returns ( NetworkDeviceStatsResponse ) ;
2020-07-13 20:56:47 +03:00
rpc Processes ( google.protobuf.Empty ) returns ( ProcessesResponse ) ;
2019-12-11 18:19:40 +00:00
rpc Read ( ReadRequest ) returns ( stream common.Data ) ;
2021-12-01 21:23:57 +05:30
rpc Reboot ( RebootRequest ) returns ( RebootResponse ) ;
2020-07-13 20:56:47 +03:00
rpc Restart ( RestartRequest ) returns ( RestartResponse ) ;
2020-06-09 18:48:40 +00:00
rpc Rollback ( RollbackRequest ) returns ( RollbackResponse ) ;
2020-02-18 13:34:33 -05:00
rpc Reset ( ResetRequest ) returns ( ResetResponse ) ;
2019-12-11 18:19:40 +00:00
rpc ServiceList ( google.protobuf.Empty ) returns ( ServiceListResponse ) ;
rpc ServiceRestart ( ServiceRestartRequest ) returns ( ServiceRestartResponse ) ;
rpc ServiceStart ( ServiceStartRequest ) returns ( ServiceStartResponse ) ;
rpc ServiceStop ( ServiceStopRequest ) returns ( ServiceStopResponse ) ;
2022-01-28 22:54:32 +01:00
rpc Shutdown ( ShutdownRequest ) returns ( ShutdownResponse ) ;
2020-07-13 20:56:47 +03:00
rpc Stats ( StatsRequest ) returns ( StatsResponse ) ;
2020-07-15 00:11:38 +03:00
rpc SystemStat ( google.protobuf.Empty ) returns ( SystemStatResponse ) ;
2019-12-11 18:19:40 +00:00
rpc Upgrade ( UpgradeRequest ) returns ( UpgradeResponse ) ;
rpc Version ( google.protobuf.Empty ) returns ( VersionResponse ) ;
2021-06-15 18:47:54 +00:00
// GenerateClientConfiguration generates talosctl client configuration (talosconfig).
rpc GenerateClientConfiguration ( GenerateClientConfigurationRequest ) returns ( GenerateClientConfigurationResponse ) ;
2022-07-18 15:56:39 +04:00
// PacketCapture performs packet capture and streams back pcap file.
rpc PacketCapture ( PacketCaptureRequest ) returns ( stream common.Data ) ;
2023-03-15 14:54:42 +04:00
// Netstat provides information about network connections.
2023-03-06 01:21:08 +01:00
rpc Netstat ( NetstatRequest ) returns ( NetstatResponse ) ;
2023-03-15 14:54:42 +04:00
// MetaWrite writes a META key-value pair.
rpc MetaWrite ( MetaWriteRequest ) returns ( MetaWriteResponse ) ;
// MetaDelete deletes a META key.
rpc MetaDelete ( MetaDeleteRequest ) returns ( MetaDeleteResponse ) ;
2023-07-10 18:07:06 +04:00
// ImageList lists images in the CRI.
rpc ImageList ( ImageListRequest ) returns ( stream ImageListResponse ) ;
// ImagePull pulls an image into the CRI.
rpc ImagePull ( ImagePullRequest ) returns ( ImagePullResponse ) ;
2019-04-26 23:04:24 +03:00
}
2020-09-22 20:19:12 -04:00
// rpc applyConfiguration
2020-10-03 12:04:13 -07:00
// ApplyConfiguration describes a request to assert a new configuration upon a
// node.
2020-11-20 16:49:27 +03:00
message ApplyConfigurationRequest {
2022-01-10 19:09:20 +03:00
enum Mode {
REBOOT = 0 ;
AUTO = 1 ;
NO_REBOOT = 2 ;
STAGED = 3 ;
2022-04-20 18:41:55 +03:00
TRY = 4 ;
2022-01-10 19:09:20 +03:00
}
2020-11-20 16:49:27 +03:00
bytes data = 1 ;
2022-01-10 19:09:20 +03:00
Mode mode = 4 ;
2022-04-13 17:29:48 +03:00
bool dry_run = 5 ;
2022-04-20 18:41:55 +03:00
google.protobuf.Duration try_mode_timeout = 6 ;
2020-11-20 16:49:27 +03:00
}
2020-09-22 20:19:12 -04:00
// ApplyConfigurationResponse describes the response to a configuration request.
2021-04-08 11:42:43 +00:00
message ApplyConfiguration {
common.Metadata metadata = 1 ;
// Configuration validation warnings.
repeated string warnings = 2 ;
2022-01-10 19:09:20 +03:00
// States which mode was actually chosen.
ApplyConfigurationRequest.Mode mode = 3 ;
// Human-readable message explaining the result of the apply configuration call.
string mode_details = 4 ;
2021-04-08 11:42:43 +00:00
}
2021-11-23 15:03:38 +00:00
message ApplyConfigurationResponse {
repeated ApplyConfiguration messages = 1 ;
}
2020-09-22 20:19:12 -04:00
2019-10-21 13:21:46 -05:00
// rpc reboot
2021-12-01 21:23:57 +05:30
message RebootRequest {
enum Mode {
DEFAULT = 0 ;
POWERCYCLE = 1 ;
}
Mode mode = 1 ;
}
2019-12-11 18:19:40 +00:00
// The reboot message containing the reboot status.
2021-11-23 15:03:38 +00:00
message Reboot {
common.Metadata metadata = 1 ;
2022-08-10 17:58:55 +02:00
string actor_id = 2 ;
2021-11-23 15:03:38 +00:00
}
message RebootResponse {
repeated Reboot messages = 1 ;
}
2019-04-26 23:04:24 +03:00
2021-04-14 00:19:54 +03:00
// rpc Bootstrap
2021-04-06 21:36:30 +03:00
message BootstrapRequest {
2021-04-14 00:19:54 +03:00
// Enable etcd recovery from the snapshot.
// Snapshot should be uploaded before this call via EtcdRecover RPC.
2021-04-06 21:36:30 +03:00
bool recover_etcd = 1 ;
2021-04-14 00:19:54 +03:00
// 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 ;
2021-04-06 21:36:30 +03:00
}
2020-05-01 15:28:55 -07:00
// The bootstrap message containing the bootstrap status.
2021-11-23 15:03:38 +00:00
message Bootstrap {
common.Metadata metadata = 1 ;
}
message BootstrapResponse {
repeated Bootstrap messages = 1 ;
}
2020-05-01 15:28:55 -07:00
2020-05-07 22:50:41 -07:00
// 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 ;
}
2020-07-03 00:43:59 +03:00
message ServiceStateEvent {
string service = 1 ;
enum Action {
INITIALIZED = 0 ;
PREPARING = 1 ;
WAITING = 2 ;
RUNNING = 3 ;
STOPPING = 4 ;
FINISHED = 5 ;
FAILED = 6 ;
SKIPPED = 7 ;
2024-03-19 16:05:56 +04:00
STARTING = 8 ;
2021-11-23 15:03:38 +00:00
}
2020-07-03 00:43:59 +03:00
Action action = 2 ;
string message = 3 ;
2021-01-19 15:45:50 +03:00
ServiceHealth health = 4 ;
2021-11-23 15:03:38 +00:00
}
2020-07-03 00:43:59 +03:00
2021-01-27 22:52:26 +03:00
message RestartEvent {
int64 cmd = 1 ;
2021-11-23 15:03:38 +00:00
}
2021-01-27 22:52:26 +03:00
2021-11-17 17:49:23 +03:00
// ConfigLoadErrorEvent is reported when the config loading has failed.
message ConfigLoadErrorEvent {
string error = 1 ;
2021-11-23 15:03:38 +00:00
}
2021-11-17 17:49:23 +03:00
// ConfigValidationErrorEvent is reported when config validation has failed.
message ConfigValidationErrorEvent {
string error = 1 ;
2021-11-23 15:03:38 +00:00
}
2021-11-17 17:49:23 +03:00
// AddressEvent reports node endpoints aggregated from k8s.Endpoints and network.Hostname.
message AddressEvent {
string hostname = 1 ;
repeated string addresses = 2 ;
}
2022-07-28 21:19:56 +04:00
// MachineStatusEvent reports changes to the MachineStatus resource.
message MachineStatusEvent {
message MachineStatus {
message UnmetCondition {
string name = 1 ;
string reason = 2 ;
}
bool ready = 1 ;
repeated UnmetCondition unmet_conditions = 2 ;
}
enum MachineStage {
UNKNOWN = 0 ;
BOOTING = 1 ;
INSTALLING = 2 ;
MAINTENANCE = 3 ;
RUNNING = 4 ;
REBOOTING = 5 ;
SHUTTING_DOWN = 6 ;
RESETTING = 7 ;
UPGRADING = 8 ;
}
MachineStage stage = 1 ;
MachineStatus status = 2 ;
}
2020-07-06 23:50:45 +03:00
message EventsRequest {
int32 tail_events = 1 ;
string tail_id = 2 ;
int32 tail_seconds = 3 ;
2022-08-10 17:58:55 +02:00
string with_actor_id = 4 ;
2020-07-06 23:50:45 +03:00
}
2020-05-07 22:50:41 -07:00
message Event {
common.Metadata metadata = 1 ;
google.protobuf.Any data = 2 ;
2020-07-06 23:50:45 +03:00
string id = 3 ;
2022-08-10 17:58:55 +02:00
string actor_id = 4 ;
2020-05-07 22:50:41 -07:00
}
2019-10-21 13:21:46 -05:00
// rpc reset
2020-12-09 15:49:46 +03:00
message ResetPartitionSpec {
string label = 1 ;
bool wipe = 2 ;
}
2020-02-18 13:34:33 -05:00
message ResetRequest {
2023-02-22 16:44:08 +03:00
enum WipeMode {
ALL = 0 ;
SYSTEM_DISK = 1 ;
USER_DISKS = 2 ;
}
2020-12-09 15:49:46 +03:00
// Graceful indicates whether node should leave etcd before the upgrade, it also
// enforces etcd checks before leaving.
2020-02-18 13:34:33 -05:00
bool graceful = 1 ;
2020-12-09 15:49:46 +03:00
// Reboot indicates whether node should reboot or halt after resetting.
2020-02-18 18:40:54 -08:00
bool reboot = 2 ;
2020-12-09 15:49:46 +03:00
// 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 ;
2023-02-22 16:44:08 +03:00
// UserDisksToWipe lists specific connected block devices to be reset (wiped).
repeated string user_disks_to_wipe = 4 ;
// WipeMode defines which devices should be wiped.
WipeMode mode = 5 ;
2020-02-18 13:34:33 -05:00
}
2020-02-18 18:40:54 -08:00
2019-12-11 18:19:40 +00:00
// The reset message containing the restart status.
2021-11-23 15:03:38 +00:00
message Reset {
common.Metadata metadata = 1 ;
2022-08-10 17:58:55 +02:00
string actor_id = 2 ;
2021-11-23 15:03:38 +00:00
}
message ResetResponse {
repeated Reset messages = 1 ;
}
2020-04-28 10:27:19 -07:00
2019-10-21 13:21:46 -05:00
// rpc shutdown
2019-12-11 18:19:40 +00:00
// The messages message containing the shutdown status.
2021-11-23 15:03:38 +00:00
message Shutdown {
common.Metadata metadata = 1 ;
2022-08-10 17:58:55 +02:00
string actor_id = 2 ;
2021-11-23 15:03:38 +00:00
}
2022-01-28 22:54:32 +01:00
message ShutdownRequest {
// Force indicates whether node should shutdown without first cordening and draining
bool force = 1 ;
}
2021-11-23 15:03:38 +00:00
message ShutdownResponse {
repeated Shutdown messages = 1 ;
}
2019-04-26 23:04:24 +03:00
2019-10-21 13:21:46 -05:00
// rpc upgrade
2019-08-27 21:45:59 +00:00
message UpgradeRequest {
2023-06-26 17:33:25 +02:00
enum RebootMode {
DEFAULT = 0 ;
POWERCYCLE = 1 ;
}
2019-08-28 03:58:47 +00:00
string image = 1 ;
2020-03-10 07:52:10 -07:00
bool preserve = 2 ;
2020-12-03 23:56:00 +03:00
bool stage = 3 ;
2021-02-08 22:52:41 +03:00
bool force = 4 ;
2023-06-26 17:33:25 +02:00
RebootMode reboot_mode = 5 ;
2019-08-27 21:45:59 +00:00
}
2020-03-10 07:52:10 -07:00
2019-12-11 18:19:40 +00:00
message Upgrade {
common.Metadata metadata = 1 ;
2019-10-21 13:21:46 -05:00
string ack = 2 ;
2022-08-10 17:58:55 +02:00
string actor_id = 3 ;
2019-10-21 13:21:46 -05:00
}
2021-11-23 15:03:38 +00:00
message UpgradeResponse {
repeated Upgrade messages = 1 ;
}
feat(init): implement services list API and osctl service CLI (#662)
This returns list of all the services registered, with their current
status, past events, health state, etc.
New CLI is `osctl service [<id>]`: without `<id>` it prints list of all
the services, with specific `<id>` it provides details for a service.
I decided to create "parallel" data structures in protobuf as Go
structures don't map nicely onto what protoc generates: pointers vs.
values, additional fields like mutexes, etc. Probably there's a better
approach, I'm open for it.
For CLI, I tried to keep CLI stuff in `cmd/` package, and I also created
simple wrapper to remove duplicated code which sets up client for each
command.
Examples:
```
$ osctl service
SERVICE STATE HEALTH LAST CHANGE LAST EVENT
containerd Running OK 21s ago Health check successful
kubeadm Running ? 2s ago Started task kubeadm (PID 280) for container kubeadm
kubelet Running ? 0s ago Started task kubelet (PID 383) for container kubelet
ntpd Running ? 14s ago Started task ntpd (PID 129) for container ntpd
osd Running ? 14s ago Started task osd (PID 126) for container osd
proxyd Waiting ? 14s ago Waiting for conditions
trustd Running ? 14s ago Started task trustd (PID 125) for container trustd
udevd Running ? 14s ago Started task udevd (PID 130) for container udevd
```
```
$ osctl service proxyd
ID proxyd
STATE Running
HEALTH ?
EVENTS [Preparing]: Running pre state (22s ago)
[Waiting]: Waiting for conditions (22s ago)
[Preparing]: Creating service runner (6s ago)
[Running]: Started task proxyd (PID 461) for container proxyd (6s ago)
```
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-05-17 18:01:12 +03:00
2019-10-21 13:21:46 -05:00
// rpc servicelist
2019-12-11 18:19:40 +00:00
message ServiceList {
common.Metadata metadata = 1 ;
2019-10-21 13:21:46 -05:00
repeated ServiceInfo services = 2 ;
}
2021-11-23 15:03:38 +00:00
message ServiceListResponse {
repeated ServiceList messages = 1 ;
}
feat(init): implement services list API and osctl service CLI (#662)
This returns list of all the services registered, with their current
status, past events, health state, etc.
New CLI is `osctl service [<id>]`: without `<id>` it prints list of all
the services, with specific `<id>` it provides details for a service.
I decided to create "parallel" data structures in protobuf as Go
structures don't map nicely onto what protoc generates: pointers vs.
values, additional fields like mutexes, etc. Probably there's a better
approach, I'm open for it.
For CLI, I tried to keep CLI stuff in `cmd/` package, and I also created
simple wrapper to remove duplicated code which sets up client for each
command.
Examples:
```
$ osctl service
SERVICE STATE HEALTH LAST CHANGE LAST EVENT
containerd Running OK 21s ago Health check successful
kubeadm Running ? 2s ago Started task kubeadm (PID 280) for container kubeadm
kubelet Running ? 0s ago Started task kubelet (PID 383) for container kubelet
ntpd Running ? 14s ago Started task ntpd (PID 129) for container ntpd
osd Running ? 14s ago Started task osd (PID 126) for container osd
proxyd Waiting ? 14s ago Waiting for conditions
trustd Running ? 14s ago Started task trustd (PID 125) for container trustd
udevd Running ? 14s ago Started task udevd (PID 130) for container udevd
```
```
$ osctl service proxyd
ID proxyd
STATE Running
HEALTH ?
EVENTS [Preparing]: Running pre state (22s ago)
[Waiting]: Waiting for conditions (22s ago)
[Preparing]: Creating service runner (6s ago)
[Running]: Started task proxyd (PID 461) for container proxyd (6s ago)
```
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-05-17 18:01:12 +03:00
message ServiceInfo {
string id = 1 ;
string state = 2 ;
ServiceEvents events = 3 ;
ServiceHealth health = 4 ;
}
2021-11-23 15:03:38 +00:00
message ServiceEvents {
repeated ServiceEvent events = 1 ;
}
feat(init): implement services list API and osctl service CLI (#662)
This returns list of all the services registered, with their current
status, past events, health state, etc.
New CLI is `osctl service [<id>]`: without `<id>` it prints list of all
the services, with specific `<id>` it provides details for a service.
I decided to create "parallel" data structures in protobuf as Go
structures don't map nicely onto what protoc generates: pointers vs.
values, additional fields like mutexes, etc. Probably there's a better
approach, I'm open for it.
For CLI, I tried to keep CLI stuff in `cmd/` package, and I also created
simple wrapper to remove duplicated code which sets up client for each
command.
Examples:
```
$ osctl service
SERVICE STATE HEALTH LAST CHANGE LAST EVENT
containerd Running OK 21s ago Health check successful
kubeadm Running ? 2s ago Started task kubeadm (PID 280) for container kubeadm
kubelet Running ? 0s ago Started task kubelet (PID 383) for container kubelet
ntpd Running ? 14s ago Started task ntpd (PID 129) for container ntpd
osd Running ? 14s ago Started task osd (PID 126) for container osd
proxyd Waiting ? 14s ago Waiting for conditions
trustd Running ? 14s ago Started task trustd (PID 125) for container trustd
udevd Running ? 14s ago Started task udevd (PID 130) for container udevd
```
```
$ osctl service proxyd
ID proxyd
STATE Running
HEALTH ?
EVENTS [Preparing]: Running pre state (22s ago)
[Waiting]: Waiting for conditions (22s ago)
[Preparing]: Creating service runner (6s ago)
[Running]: Started task proxyd (PID 461) for container proxyd (6s ago)
```
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-05-17 18:01:12 +03:00
message ServiceEvent {
string msg = 1 ;
string state = 2 ;
google.protobuf.Timestamp ts = 3 ;
}
message ServiceHealth {
bool unknown = 1 ;
bool healthy = 2 ;
2019-08-27 21:45:59 +00:00
string last_message = 3 ;
google.protobuf.Timestamp last_change = 4 ;
feat(init): implement services list API and osctl service CLI (#662)
This returns list of all the services registered, with their current
status, past events, health state, etc.
New CLI is `osctl service [<id>]`: without `<id>` it prints list of all
the services, with specific `<id>` it provides details for a service.
I decided to create "parallel" data structures in protobuf as Go
structures don't map nicely onto what protoc generates: pointers vs.
values, additional fields like mutexes, etc. Probably there's a better
approach, I'm open for it.
For CLI, I tried to keep CLI stuff in `cmd/` package, and I also created
simple wrapper to remove duplicated code which sets up client for each
command.
Examples:
```
$ osctl service
SERVICE STATE HEALTH LAST CHANGE LAST EVENT
containerd Running OK 21s ago Health check successful
kubeadm Running ? 2s ago Started task kubeadm (PID 280) for container kubeadm
kubelet Running ? 0s ago Started task kubelet (PID 383) for container kubelet
ntpd Running ? 14s ago Started task ntpd (PID 129) for container ntpd
osd Running ? 14s ago Started task osd (PID 126) for container osd
proxyd Waiting ? 14s ago Waiting for conditions
trustd Running ? 14s ago Started task trustd (PID 125) for container trustd
udevd Running ? 14s ago Started task udevd (PID 130) for container udevd
```
```
$ osctl service proxyd
ID proxyd
STATE Running
HEALTH ?
EVENTS [Preparing]: Running pre state (22s ago)
[Waiting]: Waiting for conditions (22s ago)
[Preparing]: Creating service runner (6s ago)
[Running]: Started task proxyd (PID 461) for container proxyd (6s ago)
```
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-05-17 18:01:12 +03:00
}
2019-10-21 13:21:46 -05:00
// rpc servicestart
2021-11-23 15:03:38 +00:00
message ServiceStartRequest {
string id = 1 ;
}
2019-09-12 01:31:25 +03:00
2019-12-11 18:19:40 +00:00
message ServiceStart {
common.Metadata metadata = 1 ;
2019-10-21 13:21:46 -05:00
string resp = 2 ;
}
2019-09-12 01:31:25 +03:00
2021-11-23 15:03:38 +00:00
message ServiceStartResponse {
repeated ServiceStart messages = 1 ;
}
message ServiceStopRequest {
string id = 1 ;
}
2019-09-12 01:31:25 +03:00
2019-12-11 18:19:40 +00:00
message ServiceStop {
common.Metadata metadata = 1 ;
2019-10-21 13:21:46 -05:00
string resp = 2 ;
}
2019-09-12 01:31:25 +03:00
2021-11-23 15:03:38 +00:00
message ServiceStopResponse {
repeated ServiceStop messages = 1 ;
}
message ServiceRestartRequest {
string id = 1 ;
}
2019-09-12 01:31:25 +03:00
2019-12-11 18:19:40 +00:00
message ServiceRestart {
common.Metadata metadata = 1 ;
2019-10-21 13:21:46 -05:00
string resp = 2 ;
}
2021-11-23 15:03:38 +00:00
message ServiceRestartResponse {
repeated ServiceRestart messages = 1 ;
}
2019-09-12 01:31:25 +03:00
2019-12-11 18:19:40 +00:00
// CopyRequest describes a request to copy data out of Talos node
2019-06-21 03:02:58 +03:00
//
2019-12-11 18:19:40 +00:00
// Copy produces .tar.gz archive which is streamed back to the caller
message CopyRequest {
2019-06-21 03:02:58 +03:00
// Root path to start copying data out, it might be either a file or directory
string root_path = 1 ;
}
2019-06-21 22:29:39 +03:00
2020-12-23 23:05:12 +03:00
// ListRequest describes a request to list the contents of a directory.
2019-12-11 18:19:40 +00:00
message ListRequest {
2020-12-23 23:05:12 +03:00
// Root indicates the root directory for the list. If not indicated, '/' is
2019-07-24 14:14:30 +00:00
// presumed.
2019-06-21 22:29:39 +03:00
string root = 1 ;
// Recurse indicates that subdirectories should be recursed.
bool recurse = 2 ;
2019-07-24 14:14:30 +00:00
// RecursionDepth indicates how many levels of subdirectories should be
2020-12-23 23:05:12 +03:00
// recursed. The default (0) indicates that no limit should be enforced.
2019-06-21 22:29:39 +03:00
int32 recursion_depth = 3 ;
2020-12-23 23:05:12 +03:00
// 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 ;
2019-06-21 22:29:39 +03:00
}
2020-10-13 14:31:31 +03:00
// DiskUsageRequest describes a request to list disk usage of directories and regular files
message DiskUsageRequest {
// RecursionDepth indicates how many levels of subdirectories should be
2020-12-23 23:05:12 +03:00
// recursed. The default (0) indicates that no limit should be enforced.
2020-10-13 14:31:31 +03:00
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 ;
}
2019-06-21 22:29:39 +03:00
// FileInfo describes a file or directory's information
message FileInfo {
2019-12-11 18:19:40 +00:00
common.Metadata metadata = 1 ;
2019-06-21 22:29:39 +03:00
// Name is the name (including prefixed path) of the file or directory
2019-11-27 23:39:38 +03:00
string name = 2 ;
2019-06-21 22:29:39 +03:00
// Size indicates the number of bytes contained within the file
2019-11-27 23:39:38 +03:00
int64 size = 3 ;
2019-06-21 22:29:39 +03:00
// Mode is the bitmap of UNIX mode/permission flags of the file
2019-11-27 23:39:38 +03:00
uint32 mode = 4 ;
2019-06-21 22:29:39 +03:00
// Modified indicates the UNIX timestamp at which the file was last modified
2021-11-23 15:03:38 +00:00
int64 modified = 5 ;
2019-06-21 22:29:39 +03:00
// IsDir indicates that the file is a directory
2019-11-27 23:39:38 +03:00
bool is_dir = 6 ;
2019-07-24 14:14:30 +00:00
// Error describes any error encountered while trying to read the file
// information.
2019-11-27 23:39:38 +03:00
string error = 7 ;
2019-06-26 17:43:09 +03:00
// Link is filled with symlink target
2019-11-27 23:39:38 +03:00
string link = 8 ;
2019-06-26 17:43:09 +03:00
// RelativeName is the name of the file or directory relative to the RootPath
2019-11-27 23:39:38 +03:00
string relative_name = 9 ;
2021-08-12 23:42:11 +03:00
// Owner uid
uint32 uid = 10 ;
// Owner gid
uint32 gid = 11 ;
2019-06-21 22:29:39 +03:00
}
2019-07-24 14:14:30 +00:00
2020-10-13 14:31:31 +03:00
// 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 ;
}
2019-12-11 18:19:40 +00:00
// The messages message containing the requested df stats.
message Mounts {
common.Metadata metadata = 1 ;
2019-10-21 13:21:46 -05:00
repeated MountStat stats = 2 ;
}
2021-11-23 15:03:38 +00:00
message MountsResponse {
repeated Mounts messages = 1 ;
}
2019-07-24 14:14:30 +00:00
2019-12-11 18:19:40 +00:00
// The messages message containing the requested processes.
2019-09-20 16:32:34 +00:00
message MountStat {
2019-07-24 14:14:30 +00:00
string filesystem = 1 ;
uint64 size = 2 ;
uint64 available = 3 ;
string mounted_on = 4 ;
}
2019-09-19 21:24:09 +00:00
2019-12-11 18:19:40 +00:00
message Version {
common.Metadata metadata = 1 ;
2019-10-25 20:19:11 +00:00
VersionInfo version = 2 ;
2019-11-11 21:51:24 +03:00
PlatformInfo platform = 3 ;
2021-06-28 10:02:52 +00:00
// Features describe individual Talos features that can be switched on or off.
FeaturesInfo features = 4 ;
2019-10-21 13:21:46 -05:00
}
2021-11-23 15:03:38 +00:00
message VersionResponse {
repeated Version messages = 1 ;
}
2019-10-21 13:21:46 -05:00
message VersionInfo {
2019-09-19 21:24:09 +00:00
string tag = 1 ;
string sha = 2 ;
string built = 3 ;
string go_version = 4 ;
string os = 5 ;
string arch = 6 ;
}
2019-11-04 22:43:58 +00:00
2019-11-11 21:51:24 +03:00
message PlatformInfo {
string name = 1 ;
string mode = 2 ;
}
2021-06-28 10:02:52 +00:00
// 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 ;
}
2019-11-04 22:43:58 +00:00
// 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 ;
2019-12-05 21:20:27 +03:00
bool follow = 4 ;
2019-12-17 01:28:48 +03:00
int32 tail_lines = 5 ;
2019-11-04 22:43:58 +00:00
}
2019-11-24 14:40:06 +00:00
2021-11-23 15:03:38 +00:00
message ReadRequest {
string path = 1 ;
}
2020-06-09 18:48:40 +00:00
2024-03-11 17:01:29 +03:00
// LogsContainer desribes all avalaible registered log containers.
message LogsContainer {
common.Metadata metadata = 1 ;
repeated string ids = 2 ;
}
message LogsContainersResponse {
repeated LogsContainer messages = 1 ;
}
2020-06-09 18:48:40 +00:00
// rpc rollback
message RollbackRequest { }
2021-11-23 15:03:38 +00:00
message Rollback {
common.Metadata metadata = 1 ;
}
message RollbackResponse {
repeated Rollback messages = 1 ;
}
2020-07-13 20:56:47 +03:00
// 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 ;
2023-03-24 08:36:19 +01:00
string network_namespace = 8 ;
2020-07-13 20:56:47 +03:00
}
// The messages message containing the requested containers.
message Container {
common.Metadata metadata = 1 ;
repeated ContainerInfo containers = 2 ;
}
2021-11-23 15:03:38 +00:00
message ContainersResponse {
repeated Container messages = 1 ;
}
2020-07-13 20:56:47 +03:00
// dmesg
message DmesgRequest {
bool follow = 1 ;
bool tail = 2 ;
}
// rpc processes
2021-11-23 15:03:38 +00:00
message ProcessesResponse {
repeated Process messages = 1 ;
}
2020-07-13 20:56:47 +03:00
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 ;
2024-04-19 14:03:21 +03:00
string label = 11 ;
2020-07-13 20:56:47 +03:00
}
// 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 ;
}
2021-11-23 15:03:38 +00:00
message Restart {
common.Metadata metadata = 1 ;
}
2020-07-13 20:56:47 +03:00
// The messages message containing the restart status.
2021-11-23 15:03:38 +00:00
message RestartResponse {
repeated Restart messages = 1 ;
}
2020-07-13 20:56:47 +03:00
// 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 ;
}
2021-11-23 15:03:38 +00:00
message StatsResponse {
repeated Stats messages = 1 ;
}
2020-07-13 20:56:47 +03:00
// 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 ;
}
2021-11-23 15:03:38 +00:00
message MemoryResponse {
repeated Memory messages = 1 ;
}
2020-07-13 20:56:47 +03:00
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 ;
}
2020-07-15 00:11:38 +03:00
// rpc Hostname
2021-11-23 15:03:38 +00:00
message HostnameResponse {
repeated Hostname messages = 1 ;
}
2020-07-15 00:11:38 +03:00
message Hostname {
common.Metadata metadata = 1 ;
string hostname = 2 ;
}
// rpc LoadAvg
2021-11-23 15:03:38 +00:00
message LoadAvgResponse {
repeated LoadAvg messages = 1 ;
}
2020-07-15 00:11:38 +03:00
message LoadAvg {
common.Metadata metadata = 1 ;
double load1 = 2 ;
double load5 = 3 ;
double load15 = 4 ;
}
// rpc SystemStat
2021-11-23 15:03:38 +00:00
message SystemStatResponse {
repeated SystemStat messages = 1 ;
}
2020-07-15 00:11:38 +03:00
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
2021-11-23 15:03:38 +00:00
message CPUInfoResponse {
repeated CPUsInfo messages = 1 ;
}
2020-07-15 00:11:38 +03:00
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
2021-11-23 15:03:38 +00:00
message NetworkDeviceStatsResponse {
repeated NetworkDeviceStats messages = 1 ;
}
2020-07-15 00:11:38 +03:00
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
2021-11-23 15:03:38 +00:00
message DiskStatsResponse {
repeated DiskStats messages = 1 ;
}
2020-07-15 00:11:38 +03:00
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 ;
}
2020-10-03 12:04:13 -07:00
message EtcdLeaveClusterRequest { }
2021-11-23 15:03:38 +00:00
message EtcdLeaveCluster {
common.Metadata metadata = 1 ;
}
message EtcdLeaveClusterResponse {
repeated EtcdLeaveCluster messages = 1 ;
}
2020-10-03 12:04:13 -07:00
2021-02-26 19:37:13 +03:00
message EtcdRemoveMemberRequest {
string member = 1 ;
}
2021-11-23 15:03:38 +00:00
message EtcdRemoveMember {
common.Metadata metadata = 1 ;
}
message EtcdRemoveMemberResponse {
repeated EtcdRemoveMember messages = 1 ;
}
2021-02-26 19:37:13 +03:00
2022-10-13 16:43:22 +02:00
message EtcdRemoveMemberByIDRequest {
uint64 member_id = 1 ;
}
message EtcdRemoveMemberByID {
common.Metadata metadata = 1 ;
}
message EtcdRemoveMemberByIDResponse {
repeated EtcdRemoveMemberByID messages = 1 ;
}
2020-10-03 12:04:13 -07:00
message EtcdForfeitLeadershipRequest { }
2021-11-23 15:03:38 +00:00
2020-10-03 12:04:13 -07:00
message EtcdForfeitLeadership {
common.Metadata metadata = 1 ;
string member = 2 ;
}
2021-11-23 15:03:38 +00:00
2020-10-03 12:04:13 -07:00
message EtcdForfeitLeadershipResponse {
repeated EtcdForfeitLeadership messages = 1 ;
}
2020-12-22 17:03:24 +03:00
message EtcdMemberListRequest {
bool query_local = 1 ;
}
2021-04-15 16:16:41 +03:00
// 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 ;
2021-06-17 17:03:38 +03:00
// learner flag
bool is_learner = 6 ;
2021-04-15 16:16:41 +03:00
}
// EtcdMembers contains the list of members registered on the host.
message EtcdMembers {
2020-10-03 12:04:13 -07:00
common.Metadata metadata = 1 ;
2021-04-15 16:16:41 +03:00
// list of member hostnames.
repeated string legacy_members = 2 ;
// the list of etcd members registered on the node.
repeated EtcdMember members = 3 ;
2020-10-03 12:04:13 -07:00
}
2021-11-23 15:03:38 +00:00
message EtcdMemberListResponse {
repeated EtcdMembers messages = 1 ;
}
2020-11-12 20:17:24 +03:00
2021-03-30 23:27:10 +03:00
message EtcdSnapshotRequest { }
2021-04-06 21:36:30 +03:00
message EtcdRecover {
common.Metadata metadata = 1 ;
}
2021-11-23 15:03:38 +00:00
message EtcdRecoverResponse {
repeated EtcdRecover messages = 1 ;
}
2021-04-06 21:36:30 +03:00
2023-01-03 17:49:30 +04:00
message EtcdAlarmListResponse {
repeated EtcdAlarm messages = 1 ;
}
message EtcdAlarm {
common.Metadata metadata = 1 ;
repeated EtcdMemberAlarm member_alarms = 2 ;
}
message EtcdMemberAlarm {
enum AlarmType {
NONE = 0 ;
NOSPACE = 1 ;
CORRUPT = 2 ;
}
uint64 member_id = 1 ;
AlarmType alarm = 2 ;
}
message EtcdAlarmDisarmResponse {
repeated EtcdAlarmDisarm messages = 1 ;
}
message EtcdAlarmDisarm {
common.Metadata metadata = 1 ;
repeated EtcdMemberAlarm member_alarms = 2 ;
}
message EtcdDefragmentResponse {
repeated EtcdDefragment messages = 1 ;
}
message EtcdDefragment {
common.Metadata metadata = 1 ;
}
message EtcdStatusResponse {
repeated EtcdStatus messages = 1 ;
}
message EtcdStatus {
common.Metadata metadata = 1 ;
EtcdMemberStatus member_status = 2 ;
}
message EtcdMemberStatus {
uint64 member_id = 10 ;
string protocol_version = 1 ;
int64 db_size = 2 ;
int64 db_size_in_use = 3 ;
uint64 leader = 4 ;
uint64 raft_index = 5 ;
uint64 raft_term = 6 ;
uint64 raft_applied_index = 7 ;
repeated string errors = 8 ;
bool is_learner = 9 ;
}
2020-11-12 20:17:24 +03:00
// rpc generateConfiguration
2020-12-02 18:05:10 +03:00
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 ;
}
2020-11-12 20:17:24 +03:00
message NetworkConfig {
string hostname = 1 ;
2020-12-02 18:05:10 +03:00
repeated NetworkDeviceConfig interfaces = 2 ;
2020-11-12 20:17:24 +03:00
}
message InstallConfig {
string install_disk = 1 ;
string install_image = 2 ;
}
message MachineConfig {
enum MachineType {
TYPE_UNKNOWN = 0 ;
TYPE_INIT = 1 ;
TYPE_CONTROL_PLANE = 2 ;
2021-07-08 12:29:41 +00:00
TYPE_WORKER = 3 ;
2021-11-23 15:03:38 +00:00
}
2020-11-12 20:17:24 +03:00
MachineType type = 1 ;
InstallConfig install_config = 2 ;
NetworkConfig network_config = 3 ;
string kubernetes_version = 4 ;
}
message ControlPlaneConfig {
string endpoint = 1 ;
}
2020-11-26 02:39:56 +03:00
message CNIConfig {
string name = 1 ;
repeated string urls = 2 ;
}
2020-11-12 20:17:24 +03:00
message ClusterNetworkConfig {
string dns_domain = 1 ;
2020-11-26 02:39:56 +03:00
CNIConfig cni_config = 2 ;
2020-11-12 20:17:24 +03:00
}
message ClusterConfig {
string name = 1 ;
ControlPlaneConfig control_plane = 2 ;
ClusterNetworkConfig cluster_network = 3 ;
2022-07-09 02:20:19 +05:30
bool allow_scheduling_on_control_planes = 4 ;
2020-11-12 20:17:24 +03:00
}
// 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 ;
2020-12-03 14:50:26 +03:00
google.protobuf.Timestamp override_time = 4 ;
2020-11-12 20:17:24 +03:00
}
2021-02-11 16:31:40 +03:00
2020-11-12 20:17:24 +03:00
// GenerateConfiguration describes the response to a generate configuration request.
2021-02-11 16:31:40 +03:00
message GenerateConfiguration {
2020-11-12 20:17:24 +03:00
common.Metadata metadata = 1 ;
repeated bytes data = 2 ;
2020-11-16 17:48:16 +03:00
bytes talosconfig = 3 ;
2020-11-12 20:17:24 +03:00
}
2021-02-11 16:31:40 +03:00
message GenerateConfigurationResponse {
repeated GenerateConfiguration messages = 1 ;
}
2021-02-09 22:48:18 +03:00
2021-06-15 18:47:54 +00:00
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 ;
}
2022-07-18 15:56:39 +04:00
message PacketCaptureRequest {
// Interface name to perform packet capture on.
string interface = 1 ;
// Enable promiscuous mode.
bool promiscuous = 2 ;
// Snap length in bytes.
uint32 snap_len = 3 ;
// BPF filter.
repeated BPFInstruction bpf_filter = 4 ;
}
message BPFInstruction {
uint32 op = 1 ;
uint32 jt = 2 ;
uint32 jf = 3 ;
uint32 k = 4 ;
}
2023-03-06 01:21:08 +01:00
message NetstatRequest {
enum Filter {
ALL = 0 ;
CONNECTED = 1 ;
LISTENING = 2 ;
}
Filter filter = 1 ;
message Feature {
bool pid = 1 ;
}
Feature feature = 2 ;
message L4proto {
bool tcp = 1 ;
bool tcp6 = 2 ;
bool udp = 3 ;
bool udp6 = 4 ;
bool udplite = 5 ;
bool udplite6 = 6 ;
bool raw = 7 ;
bool raw6 = 8 ;
}
L4proto l4proto = 3 ;
2023-03-24 08:36:19 +01:00
message NetNS {
bool hostnetwork = 1 ;
repeated string netns = 2 ;
bool allnetns = 3 ;
}
NetNS netns = 4 ;
2023-03-06 01:21:08 +01:00
}
message ConnectRecord {
string l4proto = 1 ;
string localip = 2 ;
uint32 localport = 3 ;
string remoteip = 4 ;
uint32 remoteport = 5 ;
enum State {
RESERVED = 0 ;
ESTABLISHED = 1 ;
SYN_SENT = 2 ;
SYN_RECV = 3 ;
FIN_WAIT1 = 4 ;
FIN_WAIT2 = 5 ;
TIME_WAIT = 6 ;
CLOSE = 7 ;
CLOSEWAIT = 8 ;
LASTACK = 9 ;
LISTEN = 10 ;
CLOSING = 11 ;
}
State state = 6 ;
uint64 txqueue = 7 ;
uint64 rxqueue = 8 ;
enum TimerActive {
OFF = 0 ;
ON = 1 ;
KEEPALIVE = 2 ;
TIMEWAIT = 3 ;
PROBE = 4 ;
}
TimerActive tr = 9 ;
uint64 timerwhen = 10 ;
uint64 retrnsmt = 11 ;
uint32 uid = 12 ;
uint64 timeout = 13 ;
uint64 inode = 14 ;
uint64 ref = 15 ;
uint64 pointer = 16 ;
message Process {
uint32 pid = 1 ;
string name = 2 ;
}
Process process = 17 ;
2023-03-24 08:36:19 +01:00
string netns = 18 ;
2023-03-06 01:21:08 +01:00
}
message Netstat {
common.Metadata metadata = 1 ;
repeated ConnectRecord connectrecord = 2 ;
}
message NetstatResponse {
repeated Netstat messages = 1 ;
}
2023-03-15 14:54:42 +04:00
message MetaWriteRequest {
uint32 key = 1 ;
bytes value = 2 ;
}
message MetaWrite {
common.Metadata metadata = 1 ;
}
message MetaWriteResponse {
repeated MetaWrite messages = 1 ;
}
message MetaDeleteRequest {
uint32 key = 1 ;
}
message MetaDelete {
common.Metadata metadata = 1 ;
}
message MetaDeleteResponse {
repeated MetaDelete messages = 1 ;
}
2023-07-10 18:07:06 +04:00
message ImageListRequest {
// Containerd namespace to use.
common.ContainerdNamespace namespace = 1 ;
}
message ImageListResponse {
common.Metadata metadata = 1 ;
string name = 2 ;
string digest = 3 ;
int64 size = 4 ;
google.protobuf.Timestamp created_at = 5 ;
}
message ImagePullRequest {
// Containerd namespace to use.
common.ContainerdNamespace namespace = 1 ;
// Image reference to pull.
string reference = 2 ;
}
message ImagePull {
common.Metadata metadata = 1 ;
}
message ImagePullResponse {
repeated ImagePull messages = 1 ;
}