| #ifndef THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_STORE_STORE_H_ |
| #define THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_STORE_STORE_H_ |
| |
| #include <cstddef> |
| #include <cstdint> |
| #include <memory> |
| #include <optional> |
| #include <ostream> |
| #include <string> |
| #include <utility> |
| #include <vector> |
| |
| #include "absl/time/time.h" |
| #include "tlbmc/collector/gpio_collector.h" |
| #include "tlbmc/collector/led_collector.h" |
| #include "tlbmc/collector/sensor_collector.h" |
| #include "resource.pb.h" |
| #include "tlbmc/thermal/controller/dff_controller.h" |
| #include "tlbmc/thermal/controller/eat_controller.h" |
| #include "tlbmc/true_hitless_metrics.pb.h" |
| #include "router_interface.h" |
| |
| #pragma GCC diagnostic push |
| #pragma GCC diagnostic warning "-Wconversion" |
| |
| #include "absl/status/status.h" |
| #include "absl/status/statusor.h" |
| #include "absl/strings/string_view.h" |
| #include <nlohmann/json.hpp> |
| #include "tlbmc/collector/collector.h" |
| #include "tlbmc/collector/fru_collector.h" |
| #include "tlbmc/collector/monitoring_change_base.h" |
| #include "tlbmc/collector/pcie_collector.h" |
| #include "tlbmc/collector/power_control_collector.h" |
| #include "power_control.pb.h" |
| #include "topology_config.pb.h" |
| #include "tlbmc/credentials/credential_manager.h" |
| #include "fru.pb.h" |
| #include "power_fault_log_entry.pb.h" |
| #include "software_metrics.pb.h" |
| #include "tlbmc/sensors/sensor.h" |
| #include "tlbmc/thermal/controller/fan_pid_controller.h" |
| #include "tlbmc/thermal/controller/pid_controller.h" |
| #include "tlbmc/thermal/controller/stepwise_controller.h" |
| #include "tlbmc/thermal/zone_manager.h" |
| |
| namespace milotic_tlbmc { |
| |
| // Store is responsible for creating, owning and managing all the telemetry |
| // collectors and facilitating access to the data collected by collectors. |
| class Store { |
| public: |
| struct Metrics { |
| nlohmann::json ToJson() const { |
| nlohmann::json json; |
| json["ConfigParseDuration"] = absl::FormatDuration(config_parse_duration); |
| json["FruScanAndCollectorCreateDuration"] = |
| absl::FormatDuration(fru_scan_and_collector_create_duration); |
| json["TopologyConfigLoadDuration"] = |
| absl::FormatDuration(topology_config_load_duration); |
| json["SensorCollectorCreateDuration"] = |
| absl::FormatDuration(sensor_collector_create_duration); |
| json["TimeToReady"] = absl::FormatDuration(time_to_ready); |
| return json; |
| } |
| |
| // Key Time based metrics which would be tracked to catch any performance |
| // regressions. |
| absl::Duration config_parse_duration = absl::InfiniteDuration(); |
| absl::Duration fru_scan_and_collector_create_duration = |
| absl::InfiniteDuration(); |
| absl::Duration topology_config_load_duration = absl::InfiniteDuration(); |
| absl::Duration sensor_collector_create_duration = absl::InfiniteDuration(); |
| absl::Duration time_to_ready = absl::InfiniteDuration(); |
| |
| // TODO(rahulkpr): Add runtime correctable and uncorrectable errors. |
| }; |
| |
| virtual ~Store() = default; |
| |
| virtual bool IsDeterministicBmcEnabled() const = 0; |
| virtual bool IsDeterministicPeriodicFruScanningEnabled() const = 0; |
| |
| // Configures FRU deterministic collection. |
| virtual absl::Status ConfigureDeterministicCollection( |
| const Collector::Config& config) const = 0; |
| |
| virtual std::unique_ptr<MonitoringChangeBase> CreateMonitoringChange() = 0; |
| |
| // Returns the sorted list of sensor names contained by the given config key. |
| virtual std::vector<std::string> GetAllSensorKeysByConfigKey( |
| const std::string& board_config_key) const = 0; |
| |
| // Returns all the sensors sorted by sensor name. |
| virtual std::vector<std::shared_ptr<const Sensor>> GetAllSensors() const = 0; |
| |
| // Returns all the sensors sorted by sensor name. |
| virtual std::vector<std::string> GetAllSharedMemorySensorKeys() const = 0; |
| |
| // Returns the sensor for the given sensor key. |
| virtual std::shared_ptr<const Sensor> GetSensorBySensorKey( |
| const std::string& sensor_key) const = 0; |
| |
| // Returns the sensor for the given board config key and given sensor |
| // key. |
| virtual std::shared_ptr<const Sensor> GetSensorByConfigKeyAndSensorKey( |
| const std::string& board_config_key, |
| const std::string& sensor_key) const = 0; |
| |
| virtual absl::Status WriteToSensor(const std::string& sensor_key, |
| const SensorValue& value) = 0; |
| |
| // Software sensor override APIs |
| virtual absl::Status SetSensorOverride(const std::string& sensor_key, |
| const SensorValue& value) = 0; |
| virtual absl::Status ClearSensorOverride(const std::string& sensor_key) = 0; |
| virtual absl::Status ClearAllSensorOverrides() = 0; |
| virtual std::vector<std::string> GetOverriddenSensorKeys() const = 0; |
| virtual absl::StatusOr<bool> IsSensorOverridden( |
| const std::string& sensor_key) const = 0; |
| |
| // Returns the sensor devpath for the given sensor object. |
| virtual absl::StatusOr<const std::string&> GetDevpathFromSensor( |
| std::shared_ptr<const Sensor> sensor) const = 0; |
| |
| // FRU accessors. |
| virtual absl::StatusOr<const Fru*> GetFru(absl::string_view key) const = 0; |
| virtual absl::StatusOr<const FruTable*> GetAllFrus() const = 0; |
| virtual absl::StatusOr<const TopologyConfigNode*> GetFruTopology( |
| absl::string_view config_key) const = 0; |
| // Returns the topology config of all configs. |
| virtual absl::StatusOr<const TopologyConfig*> GetTopologyConfig() const = 0; |
| // Returns all the config keys. |
| virtual absl::StatusOr<std::vector<std::string>> GetAllConfigKeys() const = 0; |
| // Returns true if tlBMC for the given config key owns all the sensors. |
| // In this case, tlBMC will own the SensorCollection. |
| virtual bool IsConfigKeyOwningAllSensors( |
| absl::string_view config_key) const = 0; |
| // Returns the config key of the given FRU key. |
| virtual absl::StatusOr<std::string> GetConfigKeyByFruKey( |
| absl::string_view fru_key) const = 0; |
| virtual absl::StatusOr<std::string> GetFruKeyByConfigKey( |
| absl::string_view config_key) const = 0; |
| // Returns the fan info of the given config key. (fan_id, fan_key) |
| // fan_id: the name of the fan. |
| // fan_key: the FRU key of the fan. |
| virtual absl::StatusOr<std::vector<std::pair<std::string, std::string>>> |
| GetFanInfoByConfigKey(absl::string_view config_key) const = 0; |
| // Converts the store to a JSON object. |
| virtual nlohmann::json ToJson() const = 0; |
| // Returns the scheduler stats for the store. |
| virtual nlohmann::json GetSchedulerStats() const = 0; |
| // Returns the metrics for the store. |
| virtual Metrics GetMetrics() const = 0; |
| // Set Smart Router to let it know of any updates to store. |
| virtual void SetSmartRouter(::crow::RouterInterface* smart_router) = 0; |
| // Converts the store to a string. |
| virtual std::string ToString() const = 0; |
| |
| // Thermal control info. |
| // Returns all the thermal zones. |
| virtual absl::StatusOr<std::vector<const thermal::ZoneManager*>> |
| GetAllThermalZones() const = 0; |
| // Returns all the PID controllers. |
| virtual absl::StatusOr<std::vector<const thermal::PidController*>> |
| GetAllPidControllers() const = 0; |
| // Returns all the stepwise controllers. |
| virtual absl::StatusOr<std::vector<const thermal::StepwiseController*>> |
| GetAllStepwiseControllers() const = 0; |
| // Returns all the fan PID controllers. |
| virtual absl::StatusOr<std::vector<const thermal::FanPidController*>> |
| GetAllFanPidControllers() const = 0; |
| // Returns all the DFF controllers. |
| virtual absl::StatusOr<std::vector<const thermal::DffController*>> |
| GetAllDffControllers() const = 0; |
| // Returns all the EAT controllers. |
| virtual absl::StatusOr<std::vector<const thermal::EatController*>> |
| GetAllEatControllers() const = 0; |
| |
| virtual PowerControlCollector* GetPowerControlCollector() const = 0; |
| |
| virtual FruCollector* GetFruCollector() const = 0; |
| virtual GpioCollector* GetGpioCollector() const = 0; |
| virtual LedCollector* GetLedCollector() const = 0; |
| virtual PcieCollector* GetPcieCollector() const = 0; |
| |
| virtual SoftwareMetricsValue GetMetricValues() const = 0; |
| |
| virtual SocketStatStates GetMetricSocketStatValues() const = 0; |
| |
| virtual NetFilterStates GetMetricNetFilterValues() const = 0; |
| |
| virtual std::string GetBmcUuid() const = 0; |
| |
| virtual std::string GetBmcFirmwareVersion() const = 0; |
| |
| virtual std::string GetBmcFirmwareVersionId() const = 0; |
| |
| virtual absl::StatusOr<std::string> GenerateCsr( |
| const CredentialManager::CsrParams& csr_params) const = 0; |
| virtual absl::Status InstallServerCert( |
| const std::string& certificate) const = 0; |
| virtual absl::Status InstallTrustBundle( |
| const std::string& trust_bundle, const std::string& signature) const = 0; |
| virtual absl::Status InstallOsVerificationCertificate( |
| const std::string& cert_string) const = 0; |
| virtual absl::Status InstallSerialConsoleTrustedUserCAKeys( |
| const std::string& trusted_user_ca_keys, |
| const std::string& signature) const = 0; |
| virtual absl::Status InstallSyslogCert(const std::string& cert_string, |
| const std::string& target_ip, |
| int64_t target_port, |
| SyslogProtocol protocol, |
| SyslogTlsMode tls_mode) const = 0; |
| virtual bool IsFirmwareUpdateable() const = 0; |
| virtual absl::StatusOr<std::optional<std::string>> GetOwnerVerificationCert() |
| const = 0; |
| virtual absl::StatusOr< |
| std::optional<owner_certificate::OwnerVerificationCertConfiguration>> |
| GetOwnerVerificationCertConfiguration() const = 0; |
| virtual absl::StatusOr<std::optional<std::string>> |
| GetBmcSshTrustedUserCAKeysSignature() const = 0; |
| virtual absl::StatusOr<std::optional<std::string>> GetTrustBundle() const = 0; |
| virtual absl::StatusOr<std::optional<std::string>> GetTrustBundleSignature() |
| const = 0; |
| virtual absl::StatusOr<std::optional<std::string>> GetServerCert() const = 0; |
| virtual absl::StatusOr<std::optional<std::string>> GetOsVerificationCert() |
| const = 0; |
| virtual absl::StatusOr<std::optional<std::string>> |
| GetSerialConsoleTrustedUserCAKeys() const = 0; |
| virtual absl::StatusOr<std::optional<std::string>> |
| GetSerialConsoleDetatchedSignature() const = 0; |
| virtual absl::StatusOr<std::optional<SyslogTargetConfig>> |
| GetSyslogClientConf() const = 0; |
| virtual absl::StatusOr<std::optional<std::string>> GetSyslogRootCert() |
| const = 0; |
| virtual std::shared_ptr<CredentialManager> GetCredentialManager() const = 0; |
| |
| // Returns the true hitless metrics for the store. |
| virtual TrueHitlessMetrics GetTrueHitlessMetrics() const = 0; |
| |
| virtual absl::Time GetCurrentTime() const = 0; |
| |
| virtual absl::Time GetLastResetTime() const = 0; |
| |
| // Set GPIO value. Passing into gpio collector to set the value. |
| virtual absl::Status SetGpio(absl::string_view gpio_name, bool value) = 0; |
| // Set GPIO to active state. This is only used for hotswap. |
| virtual absl::Status SetGpioActive(absl::string_view gpio_name) = 0; |
| // Press GPIO for a given duration. |
| virtual absl::Status SetGpioActiveForDuration(absl::string_view gpio_name, |
| absl::Duration duration) = 0; |
| // Get GPIO value. |
| virtual absl::StatusOr<bool> GetGpio(absl::string_view gpio_name) = 0; |
| virtual absl::Status SendSystemResetRequest(absl::string_view system_id, |
| ResetType reset_type, |
| absl::Duration delay) = 0; |
| // Get hotswap GPIO name for AC power cycle. |
| virtual absl::StatusOr<std::string> GetHotswapGpioName() = 0; |
| |
| // Returns supported custom reset types for a target chassis. |
| virtual absl::StatusOr<std::vector<ResetType>> |
| GetSupportedCustomChassisResetTypes(absl::string_view chassis_id) const = 0; |
| // Checks if a chassis supports a custom reset action. |
| virtual absl::StatusOr<bool> SupportsCustomChassisReset( |
| absl::string_view chassis_id) const = 0; |
| |
| // Executes custom reset action for a target chassis. |
| virtual absl::Status ExecuteCustomChassisReset(absl::string_view chassis_id, |
| ResetType reset_type) = 0; |
| |
| // Get power fault log entries. |
| virtual PowerFaultLogEntries GetPowerFaultLogEntries() const = 0; |
| |
| // Get power fault log file content. |
| virtual absl::StatusOr<std::string> GetPowerFaultLogFileContent( |
| absl::string_view folder_name, absl::string_view file_name) const = 0; |
| |
| // SEL accessors. |
| virtual std::vector<nlohmann::json> GetSelEntriesForward( |
| uint64_t start_id, size_t max_count) const = 0; |
| virtual std::vector<nlohmann::json> GetSelEntriesBackward( |
| uint64_t start_id, size_t max_count) const = 0; |
| virtual std::vector<nlohmann::json> GetLatestSelEntries( |
| size_t max_count) const = 0; |
| virtual void DumpSelEntriesRaw(uint64_t start_id, std::ostream& os) const = 0; |
| |
| // Get PSI metrics for the system |
| virtual absl::StatusOr<PsiMetrics> GetPsiMetrics() const = 0; |
| |
| // Get available services for PSI metrics |
| virtual absl::StatusOr<std::vector<std::string>> GetAvailableServices() |
| const = 0; |
| |
| // Get PSI metrics for a specific service |
| virtual absl::StatusOr<PsiMetrics> GetPsiMetricsForService( |
| const std::string& service_name) const = 0; |
| |
| // Set manual fan mode |
| virtual void SetManualMode(bool enable_manual_mode) = 0; |
| // Set manual PWM for a fan |
| virtual void SetManualPwm(absl::string_view fan_name, double pwm) = 0; |
| |
| // Thermal controller coefficient setters (e.g., for tuning purposes). |
| // PID controller setters. |
| virtual absl::Status SetPidControllerCoefficients( |
| absl::string_view controller_id, |
| const thermal::PidController::PidControllerCoefficients& coefficients, |
| absl::Duration timeout) = 0; |
| // Fan PID controller setters. |
| virtual absl::Status SetFanPidControllerCoefficients( |
| absl::string_view controller_id, |
| const thermal::FanPidController::FanPidControllerCoefficients& |
| coefficients, |
| absl::Duration timeout) = 0; |
| }; |
| |
| // Empty implementation of Store interface. |
| // This class is used when the real store implementation fails to create. |
| // This class is thread-safe. |
| // Behaviors: |
| // 1. Returns empty values for all getter methods. If a getter returns a status, |
| // an unimplemented error is returned. |
| // 2. Returns unimplemented error for action methods. |
| class EmptyStore : public Store { |
| public: |
| ~EmptyStore() override = default; |
| |
| bool IsDeterministicBmcEnabled() const override { return false; } |
| bool IsDeterministicPeriodicFruScanningEnabled() const override { |
| return false; |
| } |
| |
| absl::Status ConfigureDeterministicCollection( |
| [[maybe_unused]] const Collector::Config& config) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::ConfigureDeterministicCollection is not implemented"); |
| } |
| |
| std::unique_ptr<MonitoringChangeBase> CreateMonitoringChange() override { |
| return std::make_unique<FailingMonitoringChange>(); |
| } |
| |
| std::vector<std::string> GetAllSensorKeysByConfigKey( |
| [[maybe_unused]] const std::string& board_config_key) const override { |
| return {}; |
| } |
| |
| std::vector<std::shared_ptr<const Sensor>> GetAllSensors() const override { |
| return {}; |
| } |
| |
| std::vector<std::string> GetAllSharedMemorySensorKeys() const override { |
| return {}; |
| } |
| |
| std::shared_ptr<const Sensor> GetSensorBySensorKey( |
| [[maybe_unused]] const std::string& sensor_key) const override { |
| return nullptr; |
| } |
| |
| std::shared_ptr<const Sensor> GetSensorByConfigKeyAndSensorKey( |
| [[maybe_unused]] const std::string& board_config_key, |
| [[maybe_unused]] const std::string& sensor_key) const override { |
| return nullptr; |
| } |
| |
| absl::Status WriteToSensor( |
| [[maybe_unused]] const std::string& sensor_key, |
| [[maybe_unused]] const SensorValue& value) override { |
| return absl::UnimplementedError( |
| "EmptyStore::WriteToSensor is not implemented"); |
| } |
| |
| absl::Status SetSensorOverride( |
| [[maybe_unused]] const std::string& sensor_key, |
| [[maybe_unused]] const SensorValue& value) override { |
| return absl::UnimplementedError( |
| "EmptyStore::SetSensorOverride is not implemented"); |
| } |
| |
| absl::Status ClearSensorOverride( |
| [[maybe_unused]] const std::string& sensor_key) override { |
| return absl::UnimplementedError( |
| "EmptyStore::ClearSensorOverride is not implemented"); |
| } |
| |
| absl::Status ClearAllSensorOverrides() override { |
| return absl::UnimplementedError( |
| "EmptyStore::ClearAllSensorOverrides is not implemented"); |
| } |
| |
| std::vector<std::string> GetOverriddenSensorKeys() const override { |
| return {}; |
| } |
| |
| absl::StatusOr<bool> IsSensorOverridden( |
| [[maybe_unused]] const std::string& sensor_key) const override { |
| return false; |
| } |
| |
| absl::StatusOr<const std::string&> GetDevpathFromSensor( |
| [[maybe_unused]] std::shared_ptr<const Sensor> sensor) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetDevpathFromSensor is not implemented"); |
| } |
| |
| absl::StatusOr<const Fru*> GetFru( |
| [[maybe_unused]] absl::string_view key) const override { |
| return absl::UnimplementedError("EmptyStore::GetFru is not implemented"); |
| } |
| |
| absl::StatusOr<const FruTable*> GetAllFrus() const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetAllFrus is not implemented"); |
| } |
| |
| absl::StatusOr<const TopologyConfigNode*> GetFruTopology( |
| [[maybe_unused]] absl::string_view config_key) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetFruTopology is not implemented"); |
| } |
| |
| absl::StatusOr<const TopologyConfig*> GetTopologyConfig() const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetTopologyConfig is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<std::string>> GetAllConfigKeys() const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetAllConfigKeys is not implemented"); |
| } |
| |
| bool IsConfigKeyOwningAllSensors( |
| [[maybe_unused]] absl::string_view config_key) const override { |
| return false; |
| } |
| |
| absl::StatusOr<std::string> GetConfigKeyByFruKey( |
| [[maybe_unused]] absl::string_view fru_key) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetConfigKeyByFruKey is not implemented"); |
| } |
| |
| absl::StatusOr<std::string> GetFruKeyByConfigKey( |
| [[maybe_unused]] absl::string_view config_key) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetFruKeyByConfigKey is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<std::pair<std::string, std::string>>> |
| GetFanInfoByConfigKey( |
| [[maybe_unused]] absl::string_view config_key) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetFanInfoByConfigKey is not implemented"); |
| } |
| |
| nlohmann::json ToJson() const override { |
| return nlohmann::json("EmptyStore"); |
| } |
| |
| nlohmann::json GetSchedulerStats() const override { return nlohmann::json(); } |
| |
| Metrics GetMetrics() const override { return Metrics(); } |
| |
| void SetSmartRouter( |
| [[maybe_unused]] ::crow::RouterInterface* smart_router) override {} |
| |
| std::string ToString() const override { return "EmptyStore"; } |
| |
| absl::StatusOr<std::vector<const thermal::ZoneManager*>> GetAllThermalZones() |
| const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetAllThermalZones is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<const thermal::PidController*>> |
| GetAllPidControllers() const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetAllPidControllers is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<const thermal::StepwiseController*>> |
| GetAllStepwiseControllers() const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetAllStepwiseControllers is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<const thermal::FanPidController*>> |
| GetAllFanPidControllers() const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetAllFanPidControllers is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<const thermal::DffController*>> |
| GetAllDffControllers() const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetAllDffControllers is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<const thermal::EatController*>> |
| GetAllEatControllers() const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetAllEatControllers is not implemented"); |
| } |
| |
| PowerControlCollector* GetPowerControlCollector() const override { |
| return nullptr; |
| } |
| |
| FruCollector* GetFruCollector() const override { return nullptr; } |
| GpioCollector* GetGpioCollector() const override { return nullptr; } |
| LedCollector* GetLedCollector() const override { return nullptr; } |
| PcieCollector* GetPcieCollector() const override { return nullptr; } |
| |
| SoftwareMetricsValue GetMetricValues() const override { |
| return SoftwareMetricsValue(); |
| } |
| |
| SocketStatStates GetMetricSocketStatValues() const override { |
| return SocketStatStates(); |
| } |
| |
| NetFilterStates GetMetricNetFilterValues() const override { |
| return NetFilterStates(); |
| } |
| |
| std::string GetBmcUuid() const override { return ""; } |
| |
| std::string GetBmcFirmwareVersion() const override { return ""; } |
| |
| std::string GetBmcFirmwareVersionId() const override { return ""; } |
| |
| absl::StatusOr<std::string> GenerateCsr( |
| [[maybe_unused]] const CredentialManager::CsrParams& csr_params) |
| const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GenerateCsr is not implemented"); |
| } |
| |
| absl::Status InstallServerCert( |
| [[maybe_unused]] const std::string& certificate) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::InstallServerCert is not implemented"); |
| } |
| |
| absl::Status InstallTrustBundle( |
| [[maybe_unused]] const std::string& trust_bundle, |
| [[maybe_unused]] const std::string& signature) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::InstallTrustBundle is not implemented"); |
| } |
| |
| absl::Status InstallOsVerificationCertificate( |
| [[maybe_unused]] const std::string& cert_string) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::InstallOsVerificationCertificate is not implemented"); |
| } |
| |
| absl::Status InstallSerialConsoleTrustedUserCAKeys( |
| [[maybe_unused]] const std::string& trusted_user_ca_keys, |
| [[maybe_unused]] const std::string& signature) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::InstallSerialConsoleTrustedUserCAKeys is not implemented"); |
| } |
| |
| absl::Status InstallSyslogCert( |
| [[maybe_unused]] const std::string& cert_string, |
| [[maybe_unused]] const std::string& target_ip, |
| [[maybe_unused]] int64_t target_port, |
| [[maybe_unused]] SyslogProtocol protocol, |
| [[maybe_unused]] SyslogTlsMode tls_mode) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::InstallSyslogCert is not implemented"); |
| } |
| bool IsFirmwareUpdateable() const override { return true; } |
| |
| absl::StatusOr<std::optional<std::string>> GetOwnerVerificationCert() |
| const override { |
| return std::nullopt; |
| } |
| absl::StatusOr< |
| std::optional<owner_certificate::OwnerVerificationCertConfiguration>> |
| GetOwnerVerificationCertConfiguration() const override { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> |
| GetBmcSshTrustedUserCAKeysSignature() const override { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> GetTrustBundle() const override { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> GetTrustBundleSignature() |
| const override { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> GetServerCert() const override { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> GetOsVerificationCert() |
| const override { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> GetSerialConsoleTrustedUserCAKeys() |
| const override { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> |
| GetSerialConsoleDetatchedSignature() const override { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<SyslogTargetConfig>> GetSyslogClientConf() |
| const override { |
| return std::nullopt; |
| } |
| absl::StatusOr<std::optional<std::string>> GetSyslogRootCert() |
| const override { |
| return std::nullopt; |
| } |
| std::shared_ptr<CredentialManager> GetCredentialManager() const override { |
| return nullptr; |
| } |
| |
| TrueHitlessMetrics GetTrueHitlessMetrics() const override { |
| return TrueHitlessMetrics(); |
| } |
| |
| absl::Time GetCurrentTime() const override { return absl::UnixEpoch(); } |
| |
| absl::Time GetLastResetTime() const override { return absl::UnixEpoch(); } |
| |
| absl::Status SetGpio([[maybe_unused]] absl::string_view gpio_name, |
| [[maybe_unused]] bool value) override { |
| return absl::UnimplementedError("EmptyStore::SetGpio is not implemented"); |
| } |
| |
| absl::Status SetGpioActive( |
| [[maybe_unused]] absl::string_view gpio_name) override { |
| return absl::UnimplementedError( |
| "EmptyStore::SetGpioActive is not implemented"); |
| } |
| |
| absl::Status SetGpioActiveForDuration( |
| [[maybe_unused]] absl::string_view gpio_name, |
| [[maybe_unused]] absl::Duration duration) override { |
| return absl::UnimplementedError( |
| "EmptyStore::SetGpioActiveForDuration is not implemented"); |
| } |
| |
| absl::StatusOr<bool> GetGpio( |
| [[maybe_unused]] absl::string_view gpio_name) override { |
| return absl::UnimplementedError("EmptyStore::GetGpio is not implemented"); |
| } |
| |
| absl::Status SendSystemResetRequest( |
| [[maybe_unused]] absl::string_view system_id, |
| [[maybe_unused]] ResetType reset_type, |
| [[maybe_unused]] absl::Duration delay) override { |
| return absl::UnimplementedError( |
| "EmptyStore::SendSystemResetRequest is not implemented"); |
| } |
| |
| absl::StatusOr<std::string> GetHotswapGpioName() override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetHotswapGpioName is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<ResetType>> GetSupportedCustomChassisResetTypes( |
| [[maybe_unused]] absl::string_view chassis_id) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetSupportedCustomChassisResetTypes is not implemented"); |
| } |
| |
| absl::StatusOr<bool> SupportsCustomChassisReset( |
| [[maybe_unused]] absl::string_view chassis_id) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::SupportsCustomChassisReset is not implemented"); |
| } |
| |
| absl::Status ExecuteCustomChassisReset( |
| [[maybe_unused]] absl::string_view chassis_id, |
| [[maybe_unused]] ResetType reset_type) override { |
| return absl::UnimplementedError( |
| "EmptyStore::ExecuteCustomChassisReset is not implemented"); |
| } |
| |
| PowerFaultLogEntries GetPowerFaultLogEntries() const override { |
| return PowerFaultLogEntries(); |
| } |
| |
| absl::StatusOr<std::string> GetPowerFaultLogFileContent( |
| [[maybe_unused]] absl::string_view folder_name, |
| [[maybe_unused]] absl::string_view file_name) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetPowerFaultLogFileContent is not implemented"); |
| } |
| |
| std::vector<nlohmann::json> GetSelEntriesForward( |
| [[maybe_unused]] uint64_t start_id, |
| [[maybe_unused]] size_t max_count) const override { |
| return {}; |
| } |
| |
| std::vector<nlohmann::json> GetSelEntriesBackward( |
| [[maybe_unused]] uint64_t start_id, |
| [[maybe_unused]] size_t max_count) const override { |
| return {}; |
| } |
| |
| std::vector<nlohmann::json> GetLatestSelEntries( |
| [[maybe_unused]] size_t max_count) const override { |
| return {}; |
| } |
| |
| void DumpSelEntriesRaw([[maybe_unused]] uint64_t start_id, |
| [[maybe_unused]] std::ostream& os) const override { |
| // Empty store, do nothing |
| } |
| |
| absl::StatusOr<PsiMetrics> GetPsiMetrics() const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetPsiMetrics is not implemented"); |
| } |
| |
| absl::StatusOr<std::vector<std::string>> GetAvailableServices() |
| const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetAvailableServices is not implemented"); |
| } |
| |
| absl::StatusOr<PsiMetrics> GetPsiMetricsForService( |
| [[maybe_unused]] const std::string& service_name) const override { |
| return absl::UnimplementedError( |
| "EmptyStore::GetPsiMetricsForService is not implemented"); |
| } |
| |
| void SetManualMode([[maybe_unused]] bool enable_manual_mode) override {} |
| void SetManualPwm([[maybe_unused]] absl::string_view fan_name, |
| [[maybe_unused]] double pwm) override {} |
| |
| absl::Status SetPidControllerCoefficients( |
| [[maybe_unused]] absl::string_view controller_id, |
| [[maybe_unused]] const thermal::PidController::PidControllerCoefficients& |
| coefficients, |
| [[maybe_unused]] absl::Duration timeout) override { |
| return absl::UnimplementedError( |
| "EmptyStore::SetPidControllerCoefficients is not implemented"); |
| } |
| absl::Status SetFanPidControllerCoefficients( |
| [[maybe_unused]] absl::string_view controller_id, |
| [[maybe_unused]] const thermal::FanPidController:: |
| FanPidControllerCoefficients& coefficients, |
| [[maybe_unused]] absl::Duration timeout) override { |
| return absl::UnimplementedError( |
| "EmptyStore::SetFanPidControllerCoefficients is not implemented"); |
| } |
| }; |
| |
| } // namespace milotic_tlbmc |
| |
| #pragma GCC diagnostic pop |
| |
| #endif // THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_STORE_STORE_H_ |