@@ -2,14 +2,14 @@ syntax = "proto3";
22
33package talos.resource.definitions.block ;
44
5- option go_package = "github.com/siderolabs/talos/pkg/machinery/api/resource/definitions/block" ;
6- option java_package = "dev.talos.api.resource.definitions.block" ;
7-
85import "google/api/expr/v1alpha1/checked.proto" ;
96import "google/protobuf/duration.proto" ;
107import "google/protobuf/timestamp.proto" ;
118import "resource/definitions/enums/enums.proto" ;
129
10+ option go_package = "github.com/siderolabs/talos/pkg/machinery/api/resource/definitions/block" ;
11+ option java_package = "dev.talos.api.resource.definitions.block" ;
12+
1313// DeviceSpec is the spec for devices status.
1414message DeviceSpec {
1515 string type = 1 ;
@@ -242,6 +242,45 @@ message ProvisioningSpec {
242242 FilesystemSpec filesystem_spec = 4 ;
243243}
244244
245+ // SMARTAttribute is a single ATA SMART attribute.
246+ message SMARTAttribute {
247+ uint32 id = 1 ;
248+ string name = 2 ;
249+ uint32 current = 3 ;
250+ uint32 worst = 4 ;
251+ uint32 threshold = 5 ;
252+ uint64 raw_value = 6 ;
253+ bool failing = 7 ;
254+ }
255+
256+ // SMARTStatusSpec is the spec for SMARTStatus resource.
257+ message SMARTStatusSpec {
258+ // DevPath is the path to the block device, e.g. /dev/sda.
259+ string dev_path = 1 ;
260+ // DeviceType is the SMART device type: "nvme", "sata" or "scsi".
261+ string device_type = 2 ;
262+ // Healthy is the overall SMART health verdict computed by Talos.
263+ bool healthy = 3 ;
264+ // Message carries additional details, e.g. why the disk is unhealthy or that
265+ // the probe was skipped because the disk was in standby.
266+ string message = 4 ;
267+ // PowerState reports the disk power mode observed during the last probe, e.g.
268+ // "active", "idle" or "standby". SMART data is not refreshed while the disk is
269+ // in standby (to avoid spinning it up).
270+ string power_state = 5 ;
271+ // Temperature is the disk temperature in degrees Celsius.
272+ uint32 temperature = 6 ;
273+ uint64 power_on_hours = 7 ;
274+ uint64 power_cycles = 8 ;
275+ // NVMe-specific fields.
276+ uint32 percent_used = 9 ;
277+ uint32 available_spare = 10 ;
278+ uint32 critical_warning = 11 ;
279+ uint64 media_errors = 12 ;
280+ // Attributes is the raw ATA SMART attribute table (empty for NVMe/SCSI).
281+ repeated SMARTAttribute attributes = 13 ;
282+ }
283+
245284// SwapStatusSpec is the spec for SwapStatuss resource.
246285message SwapStatusSpec {
247286 string device = 1 ;
@@ -394,4 +433,3 @@ message ZswapStatusSpec {
394433 uint64 reject_compress_poor = 9 ;
395434 uint64 written_back_pages = 10 ;
396435}
397-
0 commit comments