Migrate redfish-core/lib part 3

this migration include:
- redfish-core/include/gzfile
- redfish-core/include/task_messages
- redfish-core/lib/external_storer
- redfish-core/lib/fabric_adapters
- redfish-core/lib/fan
- redfish-core/lib/hypervisor_system
- redfish-core/lib/log_services (log_services_eventlog)
- redfish-core/lib/task
(2176 linter issues solved && all libs compiled with blaze)

beside normal migration work (implement copybara transform, resolve linter issues, header replacement, add blaze rule to build new code as library, format code, etc), this CL also does the following:
1. log_services.cc: change function `getJournalMetadata` to `getJournalMetadataToInt64` to remove ambiguity since the function only used for base 10 severity parsing. Use `absl::SimpleAtoi` instead of strtol safer conversion. absl::string_view is not guaranteed to be null terminated. Also add error log and check conversion result, if fail, return EINVAL
```
  bool parsed = absl::SimpleAtoi(metadata, &contents);
  if (!parsed) {
    BMCWEB_LOG_ERROR <<
    return -EINVAL;
  }
```
2.Add support for meson options and their preprocessor/macro, configure it for defines of lib `log_service` and `task` in blaze
- redfish_rasmanager_log(BMCWEB_ENABLE_RASMANAGER_EVENT_LOG): default to False
- cper_crashdump_use_faultlog_id(BMCWEB_ENABLE_CPER_CRASHDUMP_USE_FAULTLOG_ID): default to False
- redfish_host_logger(BMCWEB_ENABLE_REDFISH_HOST_LOGGER): default to True
- redfish_system_fault_log(BMCWEB_ENABLE_REDFISH_SYSTEM_FAULT_LOG): default to False
- redfish_event_log(BMCWEB_ENABLE_REDFISH_EVENT_LOG): default to False
- redfish_dump_log(BMCWEB_ENABLE_REDFISH_DUMP_LOG): default to False
- redfish_cpu_log(BMCWEB_ENABLE_REDFISH_CPU_LOG): default to False
- redfish_ppr(BMCWEB_ENABLE_PPR): default to False
- redfish_external_storer(BMCWEB_ENABLE_REDFISH_EXTERNAL_STORER): default to True
- redfish_boot_time_log(BMCWEB_ENABLE_REDFISH_BOOT_TIME_LOG): default to False
- redfish_bmc_journal(BMCWEB_ENABLE_REDFISH_BMC_JOURNAL): default to True
- health_populate(HEALTH_POPULATE): default to True
3. fix the transformation for health.hpp to avoid unexpected change in commment: `#include \"third_party/gbmcweb/redfish_core/lib/ethernet.h` <-> `#include \"ethernet.hpp`

reverse workflow tested with: https://gbmc-review.git.corp.google.com/c/gbmcweb/+/47934 -> cl/784442672

#gbmcweb-g3

PiperOrigin-RevId: 817872503
Change-Id: I8baf3329ff420b66fc55bcaeae2158c4b0a3642b
diff --git a/copy.bara.sky b/copy.bara.sky
index 4633cda..79cd777 100644
--- a/copy.bara.sky
+++ b/copy.bara.sky
@@ -116,6 +116,7 @@
     "google3/third_party/gbmcweb/redfish_core/include/error_messages_test.cc",
     "google3/third_party/gbmcweb/redfish_core/include/event_service_manager.h",
     "google3/third_party/gbmcweb/redfish_core/include/generated/enums/**",
+    "google3/third_party/gbmcweb/redfish_core/include/gzfile.h",
     "google3/third_party/gbmcweb/redfish_core/include/privileges.h",
     "google3/third_party/gbmcweb/redfish_core/include/privileges_test.cc",
     "google3/third_party/gbmcweb/redfish_core/include/query.cc",
@@ -133,6 +134,7 @@
     "google3/third_party/gbmcweb/redfish_core/include/registries_test.cc",
     "google3/third_party/gbmcweb/redfish_core/include/schemas.h",
     "google3/third_party/gbmcweb/redfish_core/include/server_sent_events.h",
+    "google3/third_party/gbmcweb/redfish_core/include/task_messages.h",
     "google3/third_party/gbmcweb/redfish_core/include/utils/boottime.h",
     "google3/third_party/gbmcweb/redfish_core/include/utils/chassis_utils.h",
     "google3/third_party/gbmcweb/redfish_core/include/utils/collection.h",
@@ -170,10 +172,19 @@
     "google3/third_party/gbmcweb/redfish_core/lib/environment_metrics.h",
     "google3/third_party/gbmcweb/redfish_core/lib/ethernet.h",
     "google3/third_party/gbmcweb/redfish_core/lib/event_service.h",
+    "google3/third_party/gbmcweb/redfish_core/lib/external_storer.cc",
+    "google3/third_party/gbmcweb/redfish_core/lib/external_storer.h",
+    "google3/third_party/gbmcweb/redfish_core/lib/fabric_adapters.h",
+    "google3/third_party/gbmcweb/redfish_core/lib/fan.h",
     "google3/third_party/gbmcweb/redfish_core/lib/health.h",
+    "google3/third_party/gbmcweb/redfish_core/lib/hypervisor_system.h",
     "google3/third_party/gbmcweb/redfish_core/lib/led.h",
+    "google3/third_party/gbmcweb/redfish_core/lib/log_services.cc",
+    "google3/third_party/gbmcweb/redfish_core/lib/log_services.h",
+    "google3/third_party/gbmcweb/redfish_core/lib/log_services_eventlog.cc",
     "google3/third_party/gbmcweb/redfish_core/lib/metric_report.h",
     "google3/third_party/gbmcweb/redfish_core/lib/redfish_util.h",
+    "google3/third_party/gbmcweb/redfish_core/lib/task.h",
     "google3/third_party/gbmcweb/scripts/generate_schema_collections.py",
     "google3/third_party/gbmcweb/scripts/generate_schema_enums.py",
     "google3/third_party/gbmcweb/scripts/parse_registries.py",
@@ -239,6 +250,7 @@
     "redfish-core/include/error_messages.hpp",
     "redfish-core/include/event_service_manager.hpp",
     "redfish-core/include/generated/enums/**",
+    "redfish-core/include/gzfile.hpp",
     "redfish-core/include/privileges.hpp",
     "redfish-core/include/query.cpp",
     "redfish-core/include/query.hpp",
@@ -251,6 +263,7 @@
     "redfish-core/include/registries/task_event_message_registry.hpp",
     "redfish-core/include/schemas.hpp",
     "redfish-core/include/server_sent_events.hpp",
+    "redfish-core/include/task_messages.hpp",
     "redfish-core/include/utils/boottime.hpp",
     "redfish-core/include/utils/chassis_utils.hpp",
     "redfish-core/include/utils/collection.hpp",
@@ -280,10 +293,19 @@
     "redfish-core/lib/environment_metrics.hpp",
     "redfish-core/lib/ethernet.hpp",
     "redfish-core/lib/event_service.hpp",
+    "redfish-core/lib/external_storer.cpp",
+    "redfish-core/lib/external_storer.hpp",
+    "redfish-core/lib/fabric_adapters.hpp",
+    "redfish-core/lib/fan.hpp",
     "redfish-core/lib/health.hpp",
+    "redfish-core/lib/hypervisor_system.hpp",
     "redfish-core/lib/led.hpp",
+    "redfish-core/lib/log_services.cpp",
+    "redfish-core/lib/log_services.hpp",
+    "redfish-core/lib/log_services_eventlog.cpp",
     "redfish-core/lib/metric_report.hpp",
     "redfish-core/lib/redfish_util.hpp",
+    "redfish-core/lib/task.hpp",
     "redfish-core/src/error_messages.cpp",
     "redfish-core/src/registries.cpp",
     "redfish-core/src/utils/json_utils.cpp",
@@ -859,6 +881,36 @@
         paths = glob(_g3_cc_files),
     ),
     core.replace(
+        before = "third_party/gbmcweb/redfish_core/lib/external_storer.h",
+        after = "external_storer.hpp",
+        paths = glob(_g3_cc_files),
+    ),
+    core.replace(
+        before = "#include \"third_party/gbmcweb/redfish_core/lib/ethernet.h",
+        after = "#include \"ethernet.hpp",
+        paths = glob(_g3_cc_files),
+    ),
+    core.replace(
+        before = "third_party/gbmcweb/redfish_core/lib/log_services.h",
+        after = "log_services.hpp",
+        paths = glob(_g3_cc_files),
+    ),
+    core.replace(
+        before = "third_party/gbmcweb/redfish_core/include/gzfile.h",
+        after = "gzfile.hpp",
+        paths = glob(_g3_cc_files),
+    ),
+    core.replace(
+        before = "third_party/gbmcweb/redfish_core/lib/task.h",
+        after = "task.hpp",
+        paths = glob(_g3_cc_files),
+    ),
+    core.replace(
+        before = "third_party/gbmcweb/redfish_core/include/task_messages.h",
+        after = "task_messages.hpp",
+        paths = glob(_g3_cc_files),
+    ),
+    core.replace(
         # replace for third_party/gbmcweb/scripts/update_schemas.py
         before = "from google3.third_party.gbmcweb.scripts.generate_schema_collections import generate_top_collections",
         after = "from generate_schema_collections import generate_top_collections",
@@ -1355,6 +1407,50 @@
         after = "redfish-core/lib/redfish_util.hpp",
     ),
     core.move(
+        before = "google3/third_party/gbmcweb/redfish_core/lib/external_storer.cc",
+        after = "redfish-core/lib/external_storer.cpp",
+    ),
+    core.move(
+        before = "google3/third_party/gbmcweb/redfish_core/lib/external_storer.h",
+        after = "redfish-core/lib/external_storer.hpp",
+    ),
+    core.move(
+        before = "google3/third_party/gbmcweb/redfish_core/lib/fabric_adapters.h",
+        after = "redfish-core/lib/fabric_adapters.hpp",
+    ),
+    core.move(
+        before = "google3/third_party/gbmcweb/redfish_core/lib/fan.h",
+        after = "redfish-core/lib/fan.hpp",
+    ),
+    core.move(
+        before = "google3/third_party/gbmcweb/redfish_core/lib/hypervisor_system.h",
+        after = "redfish-core/lib/hypervisor_system.hpp",
+    ),
+    core.move(
+        before = "google3/third_party/gbmcweb/redfish_core/lib/log_services.cc",
+        after = "redfish-core/lib/log_services.cpp",
+    ),
+    core.move(
+        before = "google3/third_party/gbmcweb/redfish_core/lib/log_services.h",
+        after = "redfish-core/lib/log_services.hpp",
+    ),
+    core.move(
+        before = "google3/third_party/gbmcweb/redfish_core/lib/log_services_eventlog.cc",
+        after = "redfish-core/lib/log_services_eventlog.cpp",
+    ),
+    core.move(
+        before = "google3/third_party/gbmcweb/redfish_core/lib/task.h",
+        after = "redfish-core/lib/task.hpp",
+    ),
+    core.move(
+        before = "google3/third_party/gbmcweb/redfish_core/include/gzfile.h",
+        after = "redfish-core/include/gzfile.hpp",
+    ),
+    core.move(
+        before = "google3/third_party/gbmcweb/redfish_core/include/task_messages.h",
+        after = "redfish-core/include/task_messages.hpp",
+    ),
+    core.move(
         before = "google3/third_party/gbmcweb/scripts/parse_registries.py",
         after = "scripts/parse_registries.py",
     ),
@@ -1927,6 +2023,36 @@
         paths = glob(_gob_cc_files),
     ),
     core.replace(
+        before = "external_storer.hpp",
+        after = "third_party/gbmcweb/redfish_core/lib/external_storer.h",
+        paths = glob(_gob_cc_files),
+    ),
+    core.replace(
+        before = "#include \"ethernet.hpp",
+        after = "#include \"third_party/gbmcweb/redfish_core/lib/ethernet.h",
+        paths = glob(_gob_cc_files),
+    ),
+    core.replace(
+        before = "log_services.hpp",
+        after = "third_party/gbmcweb/redfish_core/lib/log_services.h",
+        paths = glob(_gob_cc_files),
+    ),
+    core.replace(
+        before = "gzfile.hpp",
+        after = "third_party/gbmcweb/redfish_core/include/gzfile.h",
+        paths = glob(_gob_cc_files),
+    ),
+    core.replace(
+        before = "task.hpp",
+        after = "third_party/gbmcweb/redfish_core/lib/task.h",
+        paths = glob(_gob_cc_files),
+    ),
+    core.replace(
+        before = "task_messages.hpp",
+        after = "third_party/gbmcweb/redfish_core/include/task_messages.h",
+        paths = glob(_gob_cc_files),
+    ),
+    core.replace(
         # replace for scripts/update_schemas.py
         before = "from generate_schema_collections import generate_top_collections",
         after = "from google3.third_party.gbmcweb.scripts.generate_schema_collections import generate_top_collections",
@@ -2423,6 +2549,50 @@
         after = "google3/third_party/gbmcweb/redfish_core/lib/redfish_util.h",
     ),
     core.move(
+        before = "redfish-core/lib/external_storer.cpp",
+        after = "google3/third_party/gbmcweb/redfish_core/lib/external_storer.cc",
+    ),
+    core.move(
+        before = "redfish-core/lib/external_storer.hpp",
+        after = "google3/third_party/gbmcweb/redfish_core/lib/external_storer.h",
+    ),
+    core.move(
+        before = "redfish-core/lib/fabric_adapters.hpp",
+        after = "google3/third_party/gbmcweb/redfish_core/lib/fabric_adapters.h",
+    ),
+    core.move(
+        before = "redfish-core/lib/fan.hpp",
+        after = "google3/third_party/gbmcweb/redfish_core/lib/fan.h",
+    ),
+    core.move(
+        before = "redfish-core/lib/hypervisor_system.hpp",
+        after = "google3/third_party/gbmcweb/redfish_core/lib/hypervisor_system.h",
+    ),
+    core.move(
+        before = "redfish-core/lib/log_services.cpp",
+        after = "google3/third_party/gbmcweb/redfish_core/lib/log_services.cc",
+    ),
+    core.move(
+        before = "redfish-core/lib/log_services.hpp",
+        after = "google3/third_party/gbmcweb/redfish_core/lib/log_services.h",
+    ),
+    core.move(
+        before = "redfish-core/lib/log_services_eventlog.cpp",
+        after = "google3/third_party/gbmcweb/redfish_core/lib/log_services_eventlog.cc",
+    ),
+    core.move(
+        before = "redfish-core/lib/task.hpp",
+        after = "google3/third_party/gbmcweb/redfish_core/lib/task.h",
+    ),
+    core.move(
+        before = "redfish-core/include/gzfile.hpp",
+        after = "google3/third_party/gbmcweb/redfish_core/include/gzfile.h",
+    ),
+    core.move(
+        before = "redfish-core/include/task_messages.hpp",
+        after = "google3/third_party/gbmcweb/redfish_core/include/task_messages.h",
+    ),
+    core.move(
         before = "scripts/parse_registries.py",
         after = "google3/third_party/gbmcweb/scripts/parse_registries.py",
     ),
diff --git a/redfish-core/include/gzfile.hpp b/redfish-core/include/gzfile.hpp
index 844932a..1722dc2 100644
--- a/redfish-core/include/gzfile.hpp
+++ b/redfish-core/include/gzfile.hpp
@@ -1,215 +1,182 @@
-#pragma once
-
-#include "logging.hpp"
+#ifndef THIRD_PARTY_GBMCWEB_REDFISH_CORE_INCLUDE_GZFILE_H_
+#define THIRD_PARTY_GBMCWEB_REDFISH_CORE_INCLUDE_GZFILE_H_
 
 #include <zlib.h>
 
-#include <array>
-#include <filesystem>
+#include <cstddef>
+#include <cstdint>
+#include <iterator>
 #include <string>
+#include <utility>
 #include <vector>
 
-class GzFileReader
-{
-  public:
-    bool gzGetLines(const std::string& filename, uint64_t skip, uint64_t top,
-                    std::vector<std::string>& logEntries, size_t& logCount)
-    {
-        gzFile logStream = gzopen(filename.c_str(), "r");
-        if (logStream == nullptr)
-        {
-            BMCWEB_LOG_ERROR << "Can't open gz file: " << filename << '\n';
+#include "logging.hpp"
+
+class GzFileReader {
+ public:
+  bool gzGetLines(const std::string& filename, uint64_t skip, uint64_t top,
+                  std::vector<std::string>& logEntries, size_t& logCount) {
+    gzFile logStream = gzopen(filename.c_str(), "r");
+    if (logStream == nullptr) {
+      BMCWEB_LOG_ERROR << "Can't open gz file: " << filename << '\n';
+      return false;
+    }
+
+    if (!readFile(logStream, skip, top, logEntries, logCount)) {
+      gzclose(logStream);
+      return false;
+    }
+    gzclose(logStream);
+    return true;
+  }
+
+  std::string getLastMessage() { return lastMessage; }
+
+ private:
+  std::string lastMessage;
+  std::string lastDelimiter;
+  size_t totalFilesSize = 0;
+
+  static void printErrorMessage(gzFile logStream) {
+    int errNum = 0;
+    const char* errMsg = gzerror(logStream, &errNum);
+
+    BMCWEB_LOG_ERROR << "Error reading gz compressed data.\n"
+                     << "Error Message: " << errMsg << '\n'
+                     << "Error Number: " << errNum;
+  }
+
+  bool readFile(gzFile logStream, uint64_t skip, uint64_t top,
+                std::vector<std::string>& logEntries, size_t& logCount) {
+    constexpr int bufferLimitSize = 1024;
+    do {
+      std::string bufferStr;
+      bufferStr.resize(bufferLimitSize);
+
+      int bytesRead = gzread(logStream, bufferStr.data(),
+                             static_cast<unsigned int>(bufferStr.size()));
+      // On errors, gzread() shall return a value less than 0.
+      if (bytesRead < 0) {
+        printErrorMessage(logStream);
+        return false;
+      }
+      bufferStr.resize(static_cast<size_t>(bytesRead));
+      if (!hostLogEntryParser(bufferStr, skip, top, logEntries, logCount)) {
+        BMCWEB_LOG_ERROR << "Error occurs during parsing host log.\n";
+        return false;
+      }
+    } while (gzeof(logStream) != 1);
+
+    return true;
+  }
+
+  bool hostLogEntryParser(const std::string& bufferStr, uint64_t skip,
+                          uint64_t top, std::vector<std::string>& logEntries,
+                          size_t& logCount) {
+    // Assume we have 8 files, and the max size of each file is
+    // 16k, so define the max size as 256kb (double of 8 files *
+    // 16kb)
+    constexpr size_t maxTotalFilesSize = 262144;
+
+    // It may contain several log entry in one line, and
+    // the end of each log entry will be '\r\n' or '\r'.
+    // So we need to go through and split string by '\n' and '\r'
+    size_t pos = bufferStr.find_first_of("\n\r");
+    size_t initialPos = 0;
+    std::string newLastMessage;
+
+    while (pos != std::string::npos) {
+      std::string logEntry = bufferStr.substr(initialPos, pos - initialPos);
+      // Since there might be consecutive delimiters like "\r\n", we need
+      // to filter empty strings.
+      if (!logEntry.empty()) {
+        logCount++;
+        if (!lastMessage.empty()) {
+          logEntry.insert(0, lastMessage);
+          lastMessage.clear();
+        }
+        if (logCount > skip && logCount <= (skip + top)) {
+          totalFilesSize += logEntry.size();
+          if (totalFilesSize > maxTotalFilesSize) {
+            BMCWEB_LOG_ERROR << "File size exceeds maximum allowed size of "
+                             << maxTotalFilesSize;
             return false;
+          }
+          logEntries.push_back(logEntry);
         }
-
-        if (!readFile(logStream, skip, top, logEntries, logCount))
-        {
-            gzclose(logStream);
-            return false;
+      } else {
+        // Handle consecutive delimiter. '\r\n' act as a single
+        // delimiter, the other case like '\n\n', '\n\r' or '\r\r' will
+        // push back a "\n" as a log.
+        std::string delimiters;
+        if (pos > 0) {
+          delimiters = bufferStr.substr(pos - 1, 2);
         }
-        gzclose(logStream);
-        return true;
+        // Handle consecutive delimiter but spilt between two files.
+        if (pos == 0 && !(lastDelimiter.empty())) {
+          delimiters = lastDelimiter + bufferStr.substr(0, 1);
+        }
+        if (delimiters != "\r\n") {
+          logCount++;
+          if (logCount > skip && logCount <= (skip + top)) {
+            totalFilesSize++;
+            if (totalFilesSize > maxTotalFilesSize) {
+              BMCWEB_LOG_ERROR << "File size exceeds maximum allowed size of "
+                               << maxTotalFilesSize;
+              return false;
+            }
+            logEntries.emplace_back("\n");
+          }
+        }
+      }
+      initialPos = pos + 1;
+      pos = bufferStr.find_first_of("\n\r", initialPos);
     }
 
-    std::string getLastMessage()
-    {
-        return lastMessage;
+    // Store the last message
+    if (initialPos < bufferStr.size()) {
+      newLastMessage = bufferStr.substr(initialPos);
+    } else if (initialPos ==
+               bufferStr.size()) {  // If consecutive delimiter spilt
+                                    // by buffer or file, the last
+                                    // character must be the delimiter.
+      lastDelimiter = std::string(1, bufferStr.back());
     }
+    // If file doesn't contain any "\r" or "\n", initialPos should be zero
+    if (initialPos == 0) {
+      // Solved an edge case that the log doesn't in skip and top range,
+      // but consecutive files don't contain a single delimiter, this
+      // lastMessage becomes unnecessarily large. Since last message will
+      // prepend to next log, logCount need to plus 1
+      if ((logCount + 1) > skip && (logCount + 1) <= (skip + top)) {
+        lastMessage.insert(lastMessage.end(),
+                           std::make_move_iterator(newLastMessage.begin()),
+                           std::make_move_iterator(newLastMessage.end()));
 
-  private:
-    std::string lastMessage;
-    std::string lastDelimiter;
-    size_t totalFilesSize = 0;
-
-    static void printErrorMessage(gzFile logStream)
-    {
-        int errNum = 0;
-        const char* errMsg = gzerror(logStream, &errNum);
-
-        BMCWEB_LOG_ERROR << "Error reading gz compressed data.\n"
-                         << "Error Message: " << errMsg << '\n'
-                         << "Error Number: " << errNum;
+        // Following the previous question, protect lastMessage don't
+        // larger than max total files size
+        size_t tmpMessageSize = totalFilesSize + lastMessage.size();
+        if (tmpMessageSize > maxTotalFilesSize) {
+          BMCWEB_LOG_ERROR << "File size exceeds maximum allowed size of "
+                           << maxTotalFilesSize;
+          return false;
+        }
+      }
+    } else {
+      if (!newLastMessage.empty()) {
+        lastMessage = std::move(newLastMessage);
+      }
     }
+    return true;
+  }
 
-    bool readFile(gzFile logStream, uint64_t skip, uint64_t top,
-                  std::vector<std::string>& logEntries, size_t& logCount)
-    {
-        constexpr int bufferLimitSize = 1024;
-        do
-        {
-            std::string bufferStr;
-            bufferStr.resize(bufferLimitSize);
-
-            int bytesRead = gzread(logStream, bufferStr.data(),
-                                   static_cast<unsigned int>(bufferStr.size()));
-            // On errors, gzread() shall return a value less than 0.
-            if (bytesRead < 0)
-            {
-                printErrorMessage(logStream);
-                return false;
-            }
-            bufferStr.resize(static_cast<size_t>(bytesRead));
-            if (!hostLogEntryParser(bufferStr, skip, top, logEntries, logCount))
-            {
-                BMCWEB_LOG_ERROR << "Error occurs during parsing host log.\n";
-                return false;
-            }
-        } while (gzeof(logStream) != 1);
-
-        return true;
-    }
-
-    bool hostLogEntryParser(const std::string& bufferStr, uint64_t skip,
-                            uint64_t top, std::vector<std::string>& logEntries,
-                            size_t& logCount)
-    {
-        // Assume we have 8 files, and the max size of each file is
-        // 16k, so define the max size as 256kb (double of 8 files *
-        // 16kb)
-        constexpr size_t maxTotalFilesSize = 262144;
-
-        // It may contain several log entry in one line, and
-        // the end of each log entry will be '\r\n' or '\r'.
-        // So we need to go through and split string by '\n' and '\r'
-        size_t pos = bufferStr.find_first_of("\n\r");
-        size_t initialPos = 0;
-        std::string newLastMessage;
-
-        while (pos != std::string::npos)
-        {
-            std::string logEntry =
-                bufferStr.substr(initialPos, pos - initialPos);
-            // Since there might be consecutive delimiters like "\r\n", we need
-            // to filter empty strings.
-            if (!logEntry.empty())
-            {
-                logCount++;
-                if (!lastMessage.empty())
-                {
-                    logEntry.insert(0, lastMessage);
-                    lastMessage.clear();
-                }
-                if (logCount > skip && logCount <= (skip + top))
-                {
-                    totalFilesSize += logEntry.size();
-                    if (totalFilesSize > maxTotalFilesSize)
-                    {
-                        BMCWEB_LOG_ERROR
-                            << "File size exceeds maximum allowed size of "
-                            << maxTotalFilesSize;
-                        return false;
-                    }
-                    logEntries.push_back(logEntry);
-                }
-            }
-            else
-            {
-                // Handle consecutive delimiter. '\r\n' act as a single
-                // delimiter, the other case like '\n\n', '\n\r' or '\r\r' will
-                // push back a "\n" as a log.
-                std::string delimiters;
-                if (pos > 0)
-                {
-                    delimiters = bufferStr.substr(pos - 1, 2);
-                }
-                // Handle consecutive delimiter but spilt between two files.
-                if (pos == 0 && !(lastDelimiter.empty()))
-                {
-                    delimiters = lastDelimiter + bufferStr.substr(0, 1);
-                }
-                if (delimiters != "\r\n")
-                {
-                    logCount++;
-                    if (logCount > skip && logCount <= (skip + top))
-                    {
-                        totalFilesSize++;
-                        if (totalFilesSize > maxTotalFilesSize)
-                        {
-                            BMCWEB_LOG_ERROR
-                                << "File size exceeds maximum allowed size of "
-                                << maxTotalFilesSize;
-                            return false;
-                        }
-                        logEntries.emplace_back("\n");
-                    }
-                }
-            }
-            initialPos = pos + 1;
-            pos = bufferStr.find_first_of("\n\r", initialPos);
-        }
-
-        // Store the last message
-        if (initialPos < bufferStr.size())
-        {
-            newLastMessage = bufferStr.substr(initialPos);
-        }
-        // If consecutive delimiter spilt by buffer or file, the last character
-        // must be the delimiter.
-        else if (initialPos == bufferStr.size())
-        {
-            lastDelimiter = std::string(1, bufferStr.back());
-        }
-        // If file doesn't contain any "\r" or "\n", initialPos should be zero
-        if (initialPos == 0)
-        {
-            // Solved an edge case that the log doesn't in skip and top range,
-            // but consecutive files don't contain a single delimiter, this
-            // lastMessage becomes unnecessarily large. Since last message will
-            // prepend to next log, logCount need to plus 1
-            if ((logCount + 1) > skip && (logCount + 1) <= (skip + top))
-            {
-                lastMessage.insert(
-                    lastMessage.end(),
-                    std::make_move_iterator(newLastMessage.begin()),
-                    std::make_move_iterator(newLastMessage.end()));
-
-                // Following the previous question, protect lastMessage don't
-                // larger than max total files size
-                size_t tmpMessageSize = totalFilesSize + lastMessage.size();
-                if (tmpMessageSize > maxTotalFilesSize)
-                {
-                    BMCWEB_LOG_ERROR
-                        << "File size exceeds maximum allowed size of "
-                        << maxTotalFilesSize;
-                    return false;
-                }
-            }
-        }
-        else
-        {
-            if (!newLastMessage.empty())
-            {
-                lastMessage = std::move(newLastMessage);
-            }
-        }
-        return true;
-    }
-
-  public:
-    GzFileReader() = default;
-    ~GzFileReader() = default;
-    GzFileReader(const GzFileReader&) = delete;
-    GzFileReader& operator=(const GzFileReader&) = delete;
-    GzFileReader(GzFileReader&&) = delete;
-    GzFileReader& operator=(GzFileReader&&) = delete;
+ public:
+  GzFileReader() = default;
+  ~GzFileReader() = default;
+  GzFileReader(const GzFileReader&) = delete;
+  GzFileReader& operator=(const GzFileReader&) = delete;
+  GzFileReader(GzFileReader&&) = delete;
+  GzFileReader& operator=(GzFileReader&&) = delete;
 };
+
+#endif  // THIRD_PARTY_GBMCWEB_REDFISH_CORE_INCLUDE_GZFILE_H_
diff --git a/redfish-core/include/task_messages.hpp b/redfish-core/include/task_messages.hpp
index 56ebc00..e7f3655 100644
--- a/redfish-core/include/task_messages.hpp
+++ b/redfish-core/include/task_messages.hpp
@@ -1,3 +1,6 @@
+#ifndef THIRD_PARTY_GBMCWEB_REDFISH_CORE_INCLUDE_TASK_MESSAGES_H_
+#define THIRD_PARTY_GBMCWEB_REDFISH_CORE_INCLUDE_TASK_MESSAGES_H_
+
 /*
 // Copyright (c) 2020 Intel Corporation
 //
@@ -13,81 +16,76 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 */
-#include "registries/task_event_message_registry.hpp"
+#include <array>
+#include <cstddef>
+#include <span>  // NOLINT
+#include <string>
+#include <string_view>
 
+#include "registries.hpp"
+#include "registries/task_event_message_registry.hpp"
 #include <nlohmann/json.hpp>
 
-#include <array>
-namespace redfish::messages
-{
+namespace redfish::messages {
 
-inline nlohmann::json
-    getLogTaskEvent(redfish::registries::task_event::Index name,
-                    std::span<const std::string_view> args)
-{
-    size_t index = static_cast<size_t>(name);
-    if (index >= redfish::registries::task_event::registry.size())
-    {
-        return {};
-    }
-    return getLogFromRegistry(redfish::registries::task_event::header,
-                              redfish::registries::task_event::registry, index,
-                              args);
+inline nlohmann::json getLogTaskEvent(
+    redfish::registries::task_event::Index name,
+    std::span<const std::string_view> args) {
+  size_t index = static_cast<size_t>(name);
+  if (index >= redfish::registries::task_event::registry.size()) {
+    return {};
+  }
+  return getLogFromRegistry(redfish::registries::task_event::header,
+                            redfish::registries::task_event::registry, index,
+                            args);
 }
 
-inline nlohmann::json taskAborted(std::string_view arg1)
-{
-    return getLogTaskEvent(registries::task_event::Index::taskAborted,
-                           std::to_array({arg1}));
+inline nlohmann::json taskAborted(std::string_view arg1) {
+  return getLogTaskEvent(registries::task_event::Index::taskAborted,
+                         std::to_array({arg1}));
 }
 
-inline nlohmann::json taskCancelled(std::string_view arg1)
-{
-    return getLogTaskEvent(registries::task_event::Index::taskCancelled,
-                           std::to_array({arg1}));
+inline nlohmann::json taskCancelled(std::string_view arg1) {
+  return getLogTaskEvent(registries::task_event::Index::taskCancelled,
+                         std::to_array({arg1}));
 }
 
-inline nlohmann::json taskCompletedOK(std::string_view arg1)
-{
-    return getLogTaskEvent(registries::task_event::Index::taskCompletedOK,
-                           std::to_array({arg1}));
+inline nlohmann::json taskCompletedOK(std::string_view arg1) {
+  return getLogTaskEvent(registries::task_event::Index::taskCompletedOK,
+                         std::to_array({arg1}));
 }
 
-inline nlohmann::json taskCompletedWarning(std::string_view arg1)
-{
-    return getLogTaskEvent(registries::task_event::Index::taskCompletedWarning,
-                           std::to_array({arg1}));
+inline nlohmann::json taskCompletedWarning(std::string_view arg1) {
+  return getLogTaskEvent(registries::task_event::Index::taskCompletedWarning,
+                         std::to_array({arg1}));
 }
 
-inline nlohmann::json taskPaused(std::string_view arg1)
-{
-    return getLogTaskEvent(registries::task_event::Index::taskPaused,
-                           std::to_array({arg1}));
+inline nlohmann::json taskPaused(std::string_view arg1) {
+  return getLogTaskEvent(registries::task_event::Index::taskPaused,
+                         std::to_array({arg1}));
 }
 
-inline nlohmann::json taskProgressChanged(std::string_view arg1, size_t arg2)
-{
-    std::string arg2Str = std::to_string(arg2);
-    return getLogTaskEvent(registries::task_event::Index::taskProgressChanged,
-                           std::to_array<std::string_view>({arg1, arg2Str}));
+inline nlohmann::json taskProgressChanged(std::string_view arg1, size_t arg2) {
+  std::string arg2Str = std::to_string(arg2);
+  return getLogTaskEvent(registries::task_event::Index::taskProgressChanged,
+                         std::to_array<std::string_view>({arg1, arg2Str}));
 }
 
-inline nlohmann::json taskRemoved(std::string_view arg1)
-{
-    return getLogTaskEvent(registries::task_event::Index::taskRemoved,
-                           std::to_array({arg1}));
+inline nlohmann::json taskRemoved(std::string_view arg1) {
+  return getLogTaskEvent(registries::task_event::Index::taskRemoved,
+                         std::to_array({arg1}));
 }
 
-inline nlohmann::json taskResumed(std::string_view arg1)
-{
-    return getLogTaskEvent(registries::task_event::Index::taskResumed,
-                           std::to_array({arg1}));
+inline nlohmann::json taskResumed(std::string_view arg1) {
+  return getLogTaskEvent(registries::task_event::Index::taskResumed,
+                         std::to_array({arg1}));
 }
 
-inline nlohmann::json taskStarted(std::string_view arg1)
-{
-    return getLogTaskEvent(registries::task_event::Index::taskStarted,
-                           std::to_array({arg1}));
+inline nlohmann::json taskStarted(std::string_view arg1) {
+  return getLogTaskEvent(registries::task_event::Index::taskStarted,
+                         std::to_array({arg1}));
 }
 
-} // namespace redfish::messages
+}  // namespace redfish::messages
+
+#endif  // THIRD_PARTY_GBMCWEB_REDFISH_CORE_INCLUDE_TASK_MESSAGES_H_
diff --git a/redfish-core/lib/external_storer.cpp b/redfish-core/lib/external_storer.cpp
index c2df58b..c5c131b 100644
--- a/redfish-core/lib/external_storer.cpp
+++ b/redfish-core/lib/external_storer.cpp
@@ -1,1162 +1,1038 @@
 #include "external_storer.hpp"
 
-#include "app.hpp"
-#include "error_messages.hpp"
-#include "openbmc_dbus_rest.hpp"
-#include "query.hpp"
-#include "registries/privilege_registry.hpp"
-
-#include <boost/uuid/uuid.hpp>
-#include <boost/uuid/uuid_generators.hpp>
-#include <boost/uuid/uuid_io.hpp>
-
-#include <cmath>
 #include <cstddef>
 #include <cstdint>
 #include <fstream>
 #include <sstream>
+#include <filesystem>  // NOLINT
+#include <string>
+#include <vector>
+#include <algorithm>
+#include <optional>
+#include <cstdio>
+#include <cstring>
+#include <memory>
+#include <cerrno>
+#include <system_error>  // NOLINT
+#include <utility>
+#include <functional>
+#include <ios>
 
-namespace external_storer
-{
+
+
+#include "boost/uuid/uuid.hpp"  // NOLINT
+#include "boost/uuid/uuid_generators.hpp"  // NOLINT
+#include "boost/uuid/uuid_io.hpp"  // NOLINT
+#include "app.hpp"
+#include "openbmc_dbus_rest.hpp"
+#include "http_request.hpp"
+#include "http_response.hpp"
+#include "error_messages.hpp"
+#include "async_resp.hpp"
+#include "logging.hpp"
+#include "query.hpp"
+#include "registries/privilege_registry.hpp"
+#include <nlohmann/json.hpp>
+
+namespace external_storer {
 
 std::filesystem::path safeAppend(const std::filesystem::path& a,
-                                 const std::filesystem::path& b)
-{
-    std::filesystem::path result{a};
+                                 const std::filesystem::path& b) {
+  std::filesystem::path result{a};
 
-    // Unfortunately, a / b returns surprising/wrong results if b is absolute
-    if (b.is_absolute())
-    {
-        // The absolute path already starts with necessary directory separator
-        result += b;
-        return result;
-    }
-
-    result /= b;
+  // Unfortunately, a / b returns surprising/wrong results if b is absolute
+  if (b.is_absolute()) {
+    // The absolute path already starts with necessary directory separator
+    result += b;
     return result;
+  }
+
+  result /= b;
+  return result;
 }
 
-std::filesystem::path Hook::locBase() const
-{
-    return safeAppend(redfishPrefix, pathBase);
+std::filesystem::path Hook::locBase() const {
+  return safeAppend(redfishPrefix, pathBase);
 }
 
-std::filesystem::path Hook::locInstance(const std::string& instance) const
-{
-    return safeAppend(locBase(), instance);
+std::filesystem::path Hook::locInstance(const std::string& instance) const {
+  return safeAppend(locBase(), instance);
 }
 
-std::filesystem::path Hook::locMiddle(const std::string& instance) const
-{
-    // The middle component is optional, some schemas might not need it
-    if (pathMiddle.empty())
-    {
-        return locInstance(instance);
-    }
+std::filesystem::path Hook::locMiddle(const std::string& instance) const {
+  // The middle component is optional, some schemas might not need it
+  if (pathMiddle.empty()) {
+    return locInstance(instance);
+  }
 
-    return safeAppend(locInstance(instance), pathMiddle);
+  return safeAppend(locInstance(instance), pathMiddle);
 }
 
 std::filesystem::path Hook::locEntry(const std::string& instance,
-                                     const std::string& entry) const
-{
-    return safeAppend(locMiddle(instance), entry);
+                                     const std::string& entry) const {
+  return safeAppend(locMiddle(instance), entry);
 }
 
-std::filesystem::path Hook::locToFileDir(const std::filesystem::path& loc) const
-{
-    return safeAppend(pathPrefix, loc);
+std::filesystem::path Hook::locToFileDir(
+    const std::filesystem::path& loc) const {
+  return safeAppend(pathPrefix, loc);
 }
 
-std::filesystem::path
-    Hook::locToFileJson(const std::filesystem::path& loc) const
-{
-    // Safe to use / operator here, jsonFilename constant always relative
-    return locToFileDir(loc) / jsonFilename;
+std::filesystem::path Hook::locToFileJson(
+    const std::filesystem::path& loc) const {
+  // Safe to use / operator here, jsonFilename constant always relative
+  return locToFileDir(loc) / jsonFilename;
 }
 
 // Helper function to get size of an open file, also rewinds file
 // Uses the C library (not C++) to be called from fileToString
-std::optional<size_t> fileToSize(FILE* f)
-{
-    int ret = std::fseek(f, 0L, SEEK_END);
-    if (ret != 0)
-    {
-        int err = errno;
-        BMCWEB_LOG_ERROR << "File failed to seek: " << std::strerror(err);
-        return std::nullopt;
-    }
+std::optional<size_t> fileToSize(FILE* f) {
+  int ret = std::fseek(f, 0L, SEEK_END);
+  if (ret != 0) {
+    int err = errno;
+    BMCWEB_LOG_ERROR << "File failed to seek: " << std::strerror(err);
+    return std::nullopt;
+  }
 
-    // Assumes file has been opened in binary mode
-    int64_t rawSize = ftell(f);
-    if (rawSize < 0)
-    {
-        int err = errno;
-        BMCWEB_LOG_ERROR << "File failed to tell: " << std::strerror(err);
-        return std::nullopt;
-    }
+  // Assumes file has been opened in binary mode
+  int64_t rawSize = ftell(f);
+  if (rawSize < 0) {
+    int err = errno;
+    BMCWEB_LOG_ERROR << "File failed to tell: " << std::strerror(err);
+    return std::nullopt;
+  }
 
-    ret = std::fseek(f, 0L, SEEK_SET);
-    if (ret != 0)
-    {
-        int err = errno;
-        BMCWEB_LOG_ERROR << "File failed to seek: " << std::strerror(err);
-        return std::nullopt;
-    }
+  ret = std::fseek(f, 0L, SEEK_SET);
+  if (ret != 0) {
+    int err = errno;
+    BMCWEB_LOG_ERROR << "File failed to seek: " << std::strerror(err);
+    return std::nullopt;
+  }
 
-    // Historical C library API legacy: long versus size_t
-    auto size = static_cast<size_t>(rawSize);
+  // Historical C library API legacy: long versus size_t
+  auto size = static_cast<size_t>(rawSize);
 
-    BMCWEB_LOG_DEBUG << "File open success: " << size << " bytes";
-    return {size};
+  BMCWEB_LOG_DEBUG << "File open success: " << size << " bytes";
+  return {size};
 }
 
 // Use the C library (not C++) to read entire file into a C++ string first
 // Tested earlier to be faster than nlohmann::json::parse() of std::ifstream
-std::optional<std::string> fileToString(FILE* f)
-{
-    auto sizeOpt = fileToSize(f);
-    if (!sizeOpt.has_value())
-    {
-        // Helper function has already printed an error message
-        return std::nullopt;
-    }
+std::optional<std::string> fileToString(FILE* f) {
+  auto sizeOpt = fileToSize(f);
+  if (!sizeOpt.has_value()) {
+    // Helper function has already printed an error message
+    return std::nullopt;
+  }
 
-    size_t fileSize = *sizeOpt;
+  size_t fileSize = *sizeOpt;
 
-    if (fileSize == 0)
-    {
-        BMCWEB_LOG_ERROR << "File is empty";
-        return std::nullopt;
-    }
-    if (fileSize > maxFileSize)
-    {
-        BMCWEB_LOG_ERROR << "File is too large: " << fileSize << "/"
-                         << maxFileSize;
-        return std::nullopt;
-    }
+  if (fileSize == 0) {
+    BMCWEB_LOG_ERROR << "File is empty";
+    return std::nullopt;
+  }
+  if (fileSize > maxFileSize) {
+    BMCWEB_LOG_ERROR << "File is too large: " << fileSize << "/" << maxFileSize;
+    return std::nullopt;
+  }
 
-    std::string empty;
-    std::optional<std::string> contentOpt{empty};
+  std::string empty;
+  std::optional<std::string> contentOpt{empty};
 
-    // Avoid making expensive copies of string after it gets larger
-    std::string& content = *contentOpt;
+  // Avoid making expensive copies of string after it gets larger
+  std::string& content = *contentOpt;
 
-    // Preallocate the buffer to fit the file size
-    content.resize(fileSize);
+  // Preallocate the buffer to fit the file size
+  content.resize(fileSize);
 
-    // Read the whole file in one go
-    // C++11 no longer disallows data() from being written to
-    size_t readSize = fread(content.data(), 1, fileSize, f);
+  // Read the whole file in one go
+  // C++11 no longer disallows data() from being written to
+  size_t readSize = fread(content.data(), 1, fileSize, f);
 
-    // Read of 0 must be error, because empty file already excluded earlier
-    if (readSize == 0)
-    {
-        int err = errno;
-        BMCWEB_LOG_ERROR << "File read error: " << std::strerror(err);
-        return std::nullopt;
-    }
+  // Read of 0 must be error, because empty file already excluded earlier
+  if (readSize == 0) {
+    int err = errno;
+    BMCWEB_LOG_ERROR << "File read error: " << std::strerror(err);
+    return std::nullopt;
+  }
 
-    // Consider a short read to also be an error
-    if (readSize != fileSize)
-    {
-        BMCWEB_LOG_ERROR << "File read size mismatch: " << readSize << "/"
-                         << fileSize;
-        return std::nullopt;
-    }
+  // Consider a short read to also be an error
+  if (readSize != fileSize) {
+    BMCWEB_LOG_ERROR << "File read size mismatch: " << readSize << "/"
+                     << fileSize;
+    return std::nullopt;
+  }
 
-    BMCWEB_LOG_DEBUG << "File read success: " << readSize << " bytes";
-    return contentOpt;
+  BMCWEB_LOG_DEBUG << "File read success: " << readSize << " bytes";
+  return contentOpt;
 }
 
-std::optional<nlohmann::json>
-    readJsonFile(const std::filesystem::path& filename)
-{
-    // Open in binary mode to ensure accurate size measurement
-    FILE* f = std::fopen(filename.c_str(), "rb");
-    if (f == nullptr)
-    {
-        int err = errno;
-        BMCWEB_LOG_ERROR << "File " << filename
-                         << " failed to open: " << std::strerror(err);
-        return std::nullopt;
-    }
+std::optional<nlohmann::json> readJsonFile(
+    const std::filesystem::path& filename) {
+  // Open in binary mode to ensure accurate size measurement
+  FILE* f = std::fopen(filename.c_str(), "rb");
+  if (f == nullptr) {
+    int err = errno;
+    BMCWEB_LOG_ERROR << "File " << filename
+                     << " failed to open: " << std::strerror(err);
+    return std::nullopt;
+  }
 
-    // While we have the file open, use helper function to read it
-    auto bufferOpt = fileToString(f);
+  // While we have the file open, use helper function to read it
+  auto bufferOpt = fileToString(f);
 
-    int ret = std::fclose(f);
-    if (ret != 0)
-    {
-        int err = errno;
-        BMCWEB_LOG_ERROR << "File " << filename
-                         << " failed to close: " << std::strerror(err);
-        return std::nullopt;
-    }
+  int ret = std::fclose(f);
+  if (ret != 0) {
+    int err = errno;
+    BMCWEB_LOG_ERROR << "File " << filename
+                     << " failed to close: " << std::strerror(err);
+    return std::nullopt;
+  }
 
-    // All further error checking takes place after the close
-    if (!bufferOpt.has_value())
-    {
-        // Helper function has already printed an error message
-        return std::nullopt;
-    }
+  // All further error checking takes place after the close
+  if (!bufferOpt.has_value()) {
+    // Helper function has already printed an error message
+    return std::nullopt;
+  }
 
-    const std::string& buffer = *bufferOpt;
+  const std::string& buffer = *bufferOpt;
 
-    // Must supply 3rd argument to avoid throwing exceptions
-    nlohmann::json content = nlohmann::json::parse(buffer, nullptr, false);
+  // Must supply 3rd argument to avoid throwing exceptions
+  nlohmann::json content = nlohmann::json::parse(buffer, nullptr, false);
 
-    if (content.is_discarded())
-    {
-        BMCWEB_LOG_ERROR << "File " << filename << " not valid JSON";
-        return std::nullopt;
-    }
+  if (content.is_discarded()) {
+    BMCWEB_LOG_ERROR << "File " << filename << " not valid JSON";
+    return std::nullopt;
+  }
 
-    if (!(content.is_object()))
-    {
-        BMCWEB_LOG_ERROR << "File " << filename << " not JSON dictionary";
-        return std::nullopt;
-    }
+  if (!(content.is_object())) {
+    BMCWEB_LOG_ERROR << "File " << filename << " not JSON dictionary";
+    return std::nullopt;
+  }
 
-    BMCWEB_LOG_DEBUG << "File JSON success: " << filename;
-    return {content};
+  BMCWEB_LOG_DEBUG << "File JSON success: " << filename;
+  return {content};
 }
 
 std::optional<std::size_t> writeJsonFile(const std::filesystem::path& filename,
-                                         const nlohmann::json& content)
-{
-    std::stringstream stream;
+                                         const nlohmann::json& content) {
+  std::stringstream stream;
 
-    // Must supply 4th argument to avoid throwing exceptions
-    stream << content.dump(-1, ' ', false,
-                           nlohmann::json::error_handler_t::replace);
+  // Must supply 4th argument to avoid throwing exceptions
+  stream << content.dump(-1, ' ', false,
+                         nlohmann::json::error_handler_t::replace);
 
-    std::string buffer = stream.str();
-    size_t fileSize = buffer.size();
-    if (fileSize > maxFileSize)
-    {
-        BMCWEB_LOG_ERROR << "File is too large: " << fileSize << "/"
-                         << maxFileSize;
-        return std::nullopt;
-    }
+  std::string buffer = stream.str();
+  size_t fileSize = buffer.size();
+  if (fileSize > maxFileSize) {
+    BMCWEB_LOG_ERROR << "File is too large: " << fileSize << "/" << maxFileSize;
+    return std::nullopt;
+  }
 
-    BMCWEB_LOG_DEBUG << "Output write size: " << fileSize << " bytes";
+  BMCWEB_LOG_DEBUG << "Output write size: " << fileSize << " bytes";
 
-    std::ofstream output;
-    output.open(filename, std::ofstream::trunc);
-    if (!output)
-    {
-        int err = errno;
-        BMCWEB_LOG_ERROR << "Error opening " << filename
-                         << " output: " << strerror(err);
-        return std::nullopt;
-    }
+  std::ofstream output;
+  output.open(filename, std::ofstream::trunc);
+  if (!output) {
+    int err = errno;
+    BMCWEB_LOG_ERROR << "Error opening " << filename
+                     << " output: " << strerror(err);
+    return std::nullopt;
+  }
 
-    output.write(buffer.data(), static_cast<std::streamsize>(fileSize));
+  output.write(buffer.data(), static_cast<std::streamsize>(fileSize));
 
-    bool writeGood = output.good();
+  bool writeGood = output.good();
 
-    if (!writeGood)
-    {
-        // Do not return here, need to defer until after the close
-        int err = errno;
-        BMCWEB_LOG_ERROR << "Error writing " << filename
-                         << " output: " << strerror(err);
-    }
+  if (!writeGood) {
+    // Do not return here, need to defer until after the close
+    int err = errno;
+    BMCWEB_LOG_ERROR << "Error writing " << filename
+                     << " output: " << strerror(err);
+  }
 
-    // Always do this, no matter what, even if write failed
-    output.close();
+  // Always do this, no matter what, even if write failed
+  output.close();
 
-    bool closeGood = output.good();
+  bool closeGood = output.good();
 
-    // This is the deferred error return from write() above
-    if (!writeGood)
-    {
-        // The errno from write() already printed
-        return std::nullopt;
-    }
+  // This is the deferred error return from write() above
+  if (!writeGood) {
+    // The errno from write() already printed
+    return std::nullopt;
+  }
 
-    if (!closeGood)
-    {
-        int err = errno;
-        BMCWEB_LOG_ERROR << "Error closing " << filename
-                         << " output: " << strerror(err);
-        return std::nullopt;
-    }
+  if (!closeGood) {
+    int err = errno;
+    BMCWEB_LOG_ERROR << "Error closing " << filename
+                     << " output: " << strerror(err);
+    return std::nullopt;
+  }
 
-    BMCWEB_LOG_DEBUG << "Output write success: " << filename;
-    return {fileSize};
+  BMCWEB_LOG_DEBUG << "Output write success: " << filename;
+  return {fileSize};
 }
 
 // The "proposedName" should be a basename, with no directory separators
 // Conservative filename rules to begin with, can relax later if needed
-bool validateFilename(const std::filesystem::path& proposedName)
-{
-    if (!(crow::openbmc_mapper::validateFilename(proposedName)))
-    {
-        BMCWEB_LOG_ERROR << "Filename contains invalid characters";
-        return false;
-    }
+bool validateFilename(const std::filesystem::path& proposedName) {
+  if (!(crow::openbmc_mapper::validateFilename(proposedName))) {
+    BMCWEB_LOG_ERROR << "Filename contains invalid characters";
+    return false;
+  }
 
-    return true;
+  return true;
 }
 
 bool validateFilename(const std::filesystem::path& name,
-                      const std::vector<std::string>& denyList)
-{
-    if (!(validateFilename(name)))
-    {
-        // Error message has already been printed
-        return false;
-    }
+                      const std::vector<std::string>& denyList) {
+  if (!(validateFilename(name))) {
+    // Error message has already been printed
+    return false;
+  }
 
-    // Must not be within the denylist
-    if (std::find(denyList.begin(), denyList.end(), name) != denyList.end())
-    {
-        BMCWEB_LOG_ERROR << "Filename " << name << " is reserved";
-        return false;
-    }
+  // Must not be within the denylist
+  if (std::find(denyList.begin(), denyList.end(), name) != denyList.end()) {
+    BMCWEB_LOG_ERROR << "Filename " << name << " is reserved";
+    return false;
+  }
 
-    return true;
+  return true;
 }
 
-std::string extractId(const nlohmann::json& content)
-{
-    std::string id;
+std::string extractId(const nlohmann::json& content) {
+  std::string id;
 
-    if (content.is_object())
-    {
-        auto foundId = content.find("Id");
-        if (foundId != content.end())
-        {
-            if (foundId->is_string())
-            {
-                id = foundId.value();
-                if (!(id.empty()))
-                {
-                    return id;
-                }
-            }
-        }
-    }
-
-    boost::uuids::random_generator gen;
-
-    // Roll a random UUID for server-assigned ID
-    id = boost::uuids::to_string(gen());
-    BMCWEB_LOG_INFO << "Generated UUID " << id;
-
-    return id;
-}
-
-void stripFieldsId(nlohmann::json& content)
-{
-    if (!(content.is_object()))
-    {
-        return;
-    }
-
-    // No need, this is already implied by the filename on disk
+  if (content.is_object()) {
     auto foundId = content.find("Id");
-    if (foundId != content.end())
-    {
-        content.erase(foundId);
+    if (foundId != content.end()) {
+      if (foundId->is_string()) {
+        id = foundId.value();
+        if (!(id.empty())) {
+          return id;
+        }
+      }
     }
+  }
 
-    // No need, this will be dynamically built when output to user
-    auto foundOdataId = content.find("@odata.id");
-    if (foundOdataId != content.end())
-    {
-        content.erase(foundOdataId);
-    }
+  boost::uuids::random_generator gen;
+
+  // Roll a random UUID for server-assigned ID
+  id = boost::uuids::to_string(gen());
+  BMCWEB_LOG_INFO << "Generated UUID " << id;
+
+  return id;
 }
 
-void stripFieldsMembers(nlohmann::json& content)
-{
-    if (!(content.is_object()))
-    {
-        return;
-    }
+void stripFieldsId(nlohmann::json& content) {
+  if (!(content.is_object())) {
+    return;
+  }
 
-    // Entries must be added one at a time, using separate POST commands
-    auto foundMembers = content.find("Members");
-    if (foundMembers != content.end())
-    {
-        content.erase(foundMembers);
-    }
+  // No need, this is already implied by the filename on disk
+  auto foundId = content.find("Id");
+  if (foundId != content.end()) {
+    content.erase(foundId);
+  }
 
-    // No need, this will be dynamically built when output to user
-    auto foundCount = content.find("Members@odata.count");
-    if (foundCount != content.end())
-    {
-        content.erase(foundCount);
-    }
+  // No need, this will be dynamically built when output to user
+  auto foundOdataId = content.find("@odata.id");
+  if (foundOdataId != content.end()) {
+    content.erase(foundOdataId);
+  }
+}
+
+void stripFieldsMembers(nlohmann::json& content) {
+  if (!(content.is_object())) {
+    return;
+  }
+
+  // Entries must be added one at a time, using separate POST commands
+  auto foundMembers = content.find("Members");
+  if (foundMembers != content.end()) {
+    content.erase(foundMembers);
+  }
+
+  // No need, this will be dynamically built when output to user
+  auto foundCount = content.find("Members@odata.count");
+  if (foundCount != content.end()) {
+    content.erase(foundCount);
+  }
 }
 
 void insertResponseLocation(crow::Response& response,
-                            const std::string& location)
-{
-    // Add Location to header
-    response.addHeader(boost::beast::http::field::location, location);
+                            const std::string& location) {
+  // Add Location to header
+  response.addHeader(boost::beast::http::field::location, location);
 
-    // Add Location to body, but must dig through schema first
-    if (!(response.jsonValue.is_object()))
-    {
-        BMCWEB_LOG_ERROR << "No Location because not object";
-        return;
-    }
+  // Add Location to body, but must dig through schema first
+  if (!(response.jsonValue.is_object())) {
+    BMCWEB_LOG_ERROR << "No Location because not object";
+    return;
+  }
 
-    // ExtendedInfo must already be an array of at least 1 element (object)
-    auto ei = response.jsonValue.find("@Message.ExtendedInfo");
-    if (ei == response.jsonValue.end())
-    {
-        BMCWEB_LOG_ERROR << "No Location because no ExtendedInfo";
-        return;
-    }
-    if (!(ei->is_array()))
-    {
-        BMCWEB_LOG_ERROR << "No Location because ExtendedInfo not array";
-        return;
-    }
-    if (ei->empty())
-    {
-        BMCWEB_LOG_ERROR << "No Location because ExtendedInfo empty";
-        return;
-    }
-    if (!((*ei)[0].is_object()))
-    {
-        BMCWEB_LOG_ERROR
-            << "No Location because ExtendedInfo element not object";
-        return;
-    }
+  // ExtendedInfo must already be an array of at least 1 element (object)
+  auto ei = response.jsonValue.find("@Message.ExtendedInfo");
+  if (ei == response.jsonValue.end()) {
+    BMCWEB_LOG_ERROR << "No Location because no ExtendedInfo";
+    return;
+  }
+  if (!(ei->is_array())) {
+    BMCWEB_LOG_ERROR << "No Location because ExtendedInfo not array";
+    return;
+  }
+  if (ei->empty()) {
+    BMCWEB_LOG_ERROR << "No Location because ExtendedInfo empty";
+    return;
+  }
+  if (!((*ei)[0].is_object())) {
+    BMCWEB_LOG_ERROR << "No Location because ExtendedInfo element not object";
+    return;
+  }
 
-    // MessageArgs must be an array, create if it does not already exist
-    auto ma = (*ei)[0].find("MessageArgs");
-    if (ma == (*ei)[0].end())
-    {
-        (*ei)[0]["MessageArgs"] = nlohmann::json::array();
-        ma = (*ei)[0].find("MessageArgs");
-    }
-    if (!(ma->is_array()))
-    {
-        BMCWEB_LOG_ERROR << "No Location because MessageArgs not array";
-        return;
-    }
+  // MessageArgs must be an array, create if it does not already exist
+  auto ma = (*ei)[0].find("MessageArgs");
+  if (ma == (*ei)[0].end()) {
+    (*ei)[0]["MessageArgs"] = nlohmann::json::array();
+    ma = (*ei)[0].find("MessageArgs");
+  }
+  if (!(ma->is_array())) {
+    BMCWEB_LOG_ERROR << "No Location because MessageArgs not array";
+    return;
+  }
 
-    ma->emplace_back(location);
+  ma->emplace_back(location);
 }
 
 void Hook::handleCreateInstance(
     const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    nlohmann::json content;
-    content = nlohmann::json::parse(req.body(), nullptr, false);
-    if (content.is_discarded())
-    {
-        BMCWEB_LOG_ERROR << "Uploaded content not JSON";
-        redfish::messages::malformedJSON(asyncResp->res);
-        return;
-    }
-    if (!(content.is_object()))
-    {
-        BMCWEB_LOG_ERROR << "Uploaded JSON type not a dictionary";
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  nlohmann::json content;
+  content = nlohmann::json::parse(req.body(), nullptr, false);
+  if (content.is_discarded()) {
+    BMCWEB_LOG_ERROR << "Uploaded content not JSON";
+    redfish::messages::malformedJSON(asyncResp->res);
+    return;
+  }
+  if (!(content.is_object())) {
+    BMCWEB_LOG_ERROR << "Uploaded JSON type not a dictionary";
+    redfish::messages::unrecognizedRequestBody(asyncResp->res);
+    return;
+  }
+
+  std::string idInstance = extractId(content);
+  stripFieldsId(content);
+
+  auto innerContent = nlohmann::json::object();
+
+  if (!(pathMiddle.empty())) {
+    // Promote the inner layer to its own JSON object
+    auto foundMiddle = content.find(pathMiddle);
+    if (foundMiddle != content.end()) {
+      innerContent = foundMiddle.value();
+      content.erase(foundMiddle);
+
+      if (!(innerContent.is_object())) {
+        BMCWEB_LOG_ERROR << "Interior JSON type not a dictionary";
         redfish::messages::unrecognizedRequestBody(asyncResp->res);
         return;
+      }
+
+      // Also trim "Id" and "@odata.id" from the inner layer
+      stripFieldsId(innerContent);
+
+      // Trim "Members" as well, user not allowed bulk upload yet
+      stripFieldsMembers(innerContent);
     }
+  }
 
-    std::string idInstance = extractId(content);
-    stripFieldsId(content);
+  if (!(validateFilename(idInstance, denyList))) {
+    BMCWEB_LOG_ERROR << "Uploaded instance ID not acceptable";
+    redfish::messages::actionParameterValueFormatError(
+        asyncResp->res, idInstance, "Id", "POST");
+    return;
+  }
 
-    auto innerContent = nlohmann::json::object();
+  std::filesystem::path outerUrl = locInstance(idInstance);
+  std::filesystem::path outerDir = locToFileDir(outerUrl);
 
-    if (!(pathMiddle.empty()))
-    {
-        // Promote the inner layer to its own JSON object
-        auto foundMiddle = content.find(pathMiddle);
-        if (foundMiddle != content.end())
-        {
-            innerContent = foundMiddle.value();
-            content.erase(foundMiddle);
+  std::filesystem::path outerFilename = locToFileJson(outerUrl);
 
-            if (!(innerContent.is_object()))
-            {
-                BMCWEB_LOG_ERROR << "Interior JSON type not a dictionary";
-                redfish::messages::unrecognizedRequestBody(asyncResp->res);
-                return;
-            }
+  std::filesystem::path innerUrl = locMiddle(idInstance);
+  std::filesystem::path innerDir = locToFileDir(innerUrl);
 
-            // Also trim "Id" and "@odata.id" from the inner layer
-            stripFieldsId(innerContent);
+  std::filesystem::path innerFilename = locToFileJson(innerUrl);
 
-            // Trim "Members" as well, user not allowed bulk upload yet
-            stripFieldsMembers(innerContent);
-        }
+  // If no middle keyword, then no need to create multiple layers
+  if (pathMiddle.empty()) {
+    innerDir = outerDir;
+  }
+
+  std::error_code ec;
+
+  BMCWEB_LOG_DEBUG << "Create instance " << idInstance << " checking "
+                   << outerDir;
+
+  bool outerExists = std::filesystem::exists(outerFilename, ec);
+  if (ec) {
+    BMCWEB_LOG_ERROR << "Problem checking for " << outerFilename
+                     << " duplicate: " << ec.message();
+    redfish::messages::operationFailed(asyncResp->res);
+    return;
+  }
+
+  // If no middle keyword, only outer file necessary to declare dupe
+  bool innerExists = true;
+  if (!pathMiddle.empty()) {
+    innerExists = std::filesystem::exists(innerFilename, ec);
+    if (ec) {
+      BMCWEB_LOG_ERROR << "Problem checking for " << innerFilename
+                       << " duplicate: " << ec.message();
+      redfish::messages::operationFailed(asyncResp->res);
+      return;
     }
+  }
 
-    if (!(validateFilename(idInstance, denyList)))
-    {
-        BMCWEB_LOG_ERROR << "Uploaded instance ID not acceptable";
-        redfish::messages::actionParameterValueFormatError(
-            asyncResp->res, idInstance, "Id", "POST");
-        return;
+  // It is only considered a dupe error if both files already exist
+  if (outerExists && innerExists) {
+    BMCWEB_LOG_ERROR << "Uploaded instance ID already exists on system";
+    redfish::messages::resourceAlreadyExists(asyncResp->res, "String", "Id",
+                                             idInstance);
+    return;
+  }
+
+  BMCWEB_LOG_DEBUG << "Create instance " << idInstance << " making "
+                   << innerDir;
+
+  std::filesystem::create_directories(innerDir, ec);
+  if (ec) {
+    BMCWEB_LOG_ERROR << "Problem making " << innerDir
+                     << " directories: " << ec.message();
+    redfish::messages::operationFailed(asyncResp->res);
+    return;
+  }
+
+  BMCWEB_LOG_DEBUG << "Create instance " << idInstance << " writing "
+                   << outerFilename;
+  if (!(writeJsonFile(outerFilename, content).has_value())) {
+    BMCWEB_LOG_ERROR << "Problem writing file " << outerFilename;
+    redfish::messages::operationFailed(asyncResp->res);
+    return;
+  }
+
+  if (!(pathMiddle.empty())) {
+    BMCWEB_LOG_DEBUG << "Create instance " << idInstance << "/" << pathMiddle
+                     << " writing " << innerFilename;
+    if (!(writeJsonFile(innerFilename, innerContent).has_value())) {
+      BMCWEB_LOG_ERROR << "Problem writing file " << innerFilename;
+      redfish::messages::operationFailed(asyncResp->res);
+      return;
     }
+  }
 
-    std::filesystem::path outerUrl = locInstance(idInstance);
-    std::filesystem::path outerDir = locToFileDir(outerUrl);
+  redfish::messages::created(asyncResp->res);
 
-    std::filesystem::path outerFilename = locToFileJson(outerUrl);
-
-    std::filesystem::path innerUrl = locMiddle(idInstance);
-    std::filesystem::path innerDir = locToFileDir(innerUrl);
-
-    std::filesystem::path innerFilename = locToFileJson(innerUrl);
-
-    // If no middle keyword, then no need to create multiple layers
-    if (pathMiddle.empty())
-    {
-        innerDir = outerDir;
-    }
-
-    std::error_code ec;
-
-    BMCWEB_LOG_DEBUG << "Create instance " << idInstance << " checking "
-                     << outerDir;
-
-    bool outerExists = std::filesystem::exists(outerFilename, ec);
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << "Problem checking for " << outerFilename
-                         << " duplicate: " << ec.message();
-        redfish::messages::operationFailed(asyncResp->res);
-        return;
-    }
-
-    // If no middle keyword, only outer file necessary to declare dupe
-    bool innerExists = true;
-    if (!pathMiddle.empty())
-    {
-        innerExists = std::filesystem::exists(innerFilename, ec);
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "Problem checking for " << innerFilename
-                             << " duplicate: " << ec.message();
-            redfish::messages::operationFailed(asyncResp->res);
-            return;
-        }
-    }
-
-    // It is only considered a dupe error if both files already exist
-    if (outerExists && innerExists)
-    {
-        BMCWEB_LOG_ERROR << "Uploaded instance ID already exists on system";
-        redfish::messages::resourceAlreadyExists(asyncResp->res, "String", "Id",
-                                                 idInstance);
-        return;
-    }
-
-    BMCWEB_LOG_DEBUG << "Create instance " << idInstance << " making "
-                     << innerDir;
-
-    std::filesystem::create_directories(innerDir, ec);
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << "Problem making " << innerDir
-                         << " directories: " << ec.message();
-        redfish::messages::operationFailed(asyncResp->res);
-        return;
-    }
-
-    BMCWEB_LOG_DEBUG << "Create instance " << idInstance << " writing "
-                     << outerFilename;
-    if (!(writeJsonFile(outerFilename, content).has_value()))
-    {
-        BMCWEB_LOG_ERROR << "Problem writing file " << outerFilename;
-        redfish::messages::operationFailed(asyncResp->res);
-        return;
-    }
-
-    if (!(pathMiddle.empty()))
-    {
-        BMCWEB_LOG_DEBUG << "Create instance " << idInstance << "/"
-                         << pathMiddle << " writing " << innerFilename;
-        if (!(writeJsonFile(innerFilename, innerContent).has_value()))
-        {
-            BMCWEB_LOG_ERROR << "Problem writing file " << innerFilename;
-            redfish::messages::operationFailed(asyncResp->res);
-            return;
-        }
-    }
-
-    redfish::messages::created(asyncResp->res);
-
-    insertResponseLocation(asyncResp->res, outerUrl);
+  insertResponseLocation(asyncResp->res, outerUrl);
 }
 
 void Hook::handleCreateMiddle(
     const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& idInstance)
-{
-    // Before doing anything with filesystem, validate naming restrictions
-    if (!(validateFilename(idInstance, denyList)))
-    {
-        BMCWEB_LOG_ERROR << "Instance ID within URL is not acceptable";
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+    const std::string& idInstance) {
+  // Before doing anything with filesystem, validate naming restrictions
+  if (!(validateFilename(idInstance, denyList))) {
+    BMCWEB_LOG_ERROR << "Instance ID within URL is not acceptable";
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    nlohmann::json content;
+  nlohmann::json content;
 
-    // Keep this in sync with post-I/O validation in readJsonFile()
-    content = nlohmann::json::parse(req.body(), nullptr, false);
-    if (content.is_discarded())
-    {
-        BMCWEB_LOG_ERROR << "Uploaded content not JSON";
-        redfish::messages::malformedJSON(asyncResp->res);
-        return;
-    }
-    if (!(content.is_object()))
-    {
-        BMCWEB_LOG_ERROR << "Uploaded JSON type not a dictionary";
-        redfish::messages::unrecognizedRequestBody(asyncResp->res);
-        return;
-    }
+  // Keep this in sync with post-I/O validation in readJsonFile()
+  content = nlohmann::json::parse(req.body(), nullptr, false);
+  if (content.is_discarded()) {
+    BMCWEB_LOG_ERROR << "Uploaded content not JSON";
+    redfish::messages::malformedJSON(asyncResp->res);
+    return;
+  }
+  if (!(content.is_object())) {
+    BMCWEB_LOG_ERROR << "Uploaded JSON type not a dictionary";
+    redfish::messages::unrecognizedRequestBody(asyncResp->res);
+    return;
+  }
 
-    std::string idEntry = extractId(content);
+  std::string idEntry = extractId(content);
 
-    // Unlike instance, no need to do a second layer of trimming underneath
-    stripFieldsId(content);
+  // Unlike instance, no need to do a second layer of trimming underneath
+  stripFieldsId(content);
 
-    // Unlike instance, names on denyList are perfectly OK for entry
-    if (!(validateFilename(idEntry)))
-    {
-        BMCWEB_LOG_ERROR << "Uploaded entry ID not acceptable";
-        redfish::messages::actionParameterValueFormatError(
-            asyncResp->res, idEntry, "Id", "POST");
-        return;
-    }
+  // Unlike instance, names on denyList are perfectly OK for entry
+  if (!(validateFilename(idEntry))) {
+    BMCWEB_LOG_ERROR << "Uploaded entry ID not acceptable";
+    redfish::messages::actionParameterValueFormatError(asyncResp->res, idEntry,
+                                                       "Id", "POST");
+    return;
+  }
 
-    std::filesystem::path outerUrl = locInstance(idInstance);
-    std::filesystem::path outerDir = locToFileDir(outerUrl);
+  std::filesystem::path outerUrl = locInstance(idInstance);
+  std::filesystem::path outerDir = locToFileDir(outerUrl);
 
-    std::filesystem::path entryUrl = locEntry(idInstance, idEntry);
-    std::filesystem::path entryDir = locToFileDir(entryUrl);
+  std::filesystem::path entryUrl = locEntry(idInstance, idEntry);
+  std::filesystem::path entryDir = locToFileDir(entryUrl);
 
-    std::filesystem::path entryFilename = locToFileJson(entryUrl);
+  std::filesystem::path entryFilename = locToFileJson(entryUrl);
 
-    std::error_code ec;
+  std::error_code ec;
 
-    // The instance must already have been created earlier
-    BMCWEB_LOG_DEBUG << "Create entry " << idInstance << " checking "
-                     << outerDir;
-    if (!(std::filesystem::exists(outerDir, ec)))
-    {
-        BMCWEB_LOG_ERROR << "Cannot add entry to nonexistent instance "
-                         << idInstance;
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << "Problem checking for " << outerDir
-                         << " existence: " << ec.message();
-        redfish::messages::operationFailed(asyncResp->res);
-        return;
-    }
+  // The instance must already have been created earlier
+  BMCWEB_LOG_DEBUG << "Create entry " << idInstance << " checking " << outerDir;
+  if (!(std::filesystem::exists(outerDir, ec))) {
+    BMCWEB_LOG_ERROR << "Cannot add entry to nonexistent instance "
+                     << idInstance;
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
+  if (ec) {
+    BMCWEB_LOG_ERROR << "Problem checking for " << outerDir
+                     << " existence: " << ec.message();
+    redfish::messages::operationFailed(asyncResp->res);
+    return;
+  }
 
-    BMCWEB_LOG_DEBUG << "Create entry " << idInstance << " making " << entryDir;
-    std::filesystem::create_directories(entryDir, ec);
+  BMCWEB_LOG_DEBUG << "Create entry " << idInstance << " making " << entryDir;
+  std::filesystem::create_directories(entryDir, ec);
 
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << "Problem making " << entryDir
-                         << " directories: " << ec.message();
-        redfish::messages::operationFailed(asyncResp->res);
-        return;
-    }
+  if (ec) {
+    BMCWEB_LOG_ERROR << "Problem making " << entryDir
+                     << " directories: " << ec.message();
+    redfish::messages::operationFailed(asyncResp->res);
+    return;
+  }
 
-    BMCWEB_LOG_DEBUG << "Create entry " << idInstance << " writing "
-                     << entryFilename;
-    if (std::filesystem::exists(entryFilename, ec))
-    {
-        BMCWEB_LOG_ERROR << "Uploaded entry ID already exists within instance";
-        redfish::messages::resourceAlreadyExists(asyncResp->res, "String", "Id",
-                                                 idEntry);
-        return;
-    }
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << "Problem checking for " << entryFilename
-                         << " duplicate: " << ec.message();
-        redfish::messages::operationFailed(asyncResp->res);
-        return;
-    }
+  BMCWEB_LOG_DEBUG << "Create entry " << idInstance << " writing "
+                   << entryFilename;
+  if (std::filesystem::exists(entryFilename, ec)) {
+    BMCWEB_LOG_ERROR << "Uploaded entry ID already exists within instance";
+    redfish::messages::resourceAlreadyExists(asyncResp->res, "String", "Id",
+                                             idEntry);
+    return;
+  }
+  if (ec) {
+    BMCWEB_LOG_ERROR << "Problem checking for " << entryFilename
+                     << " duplicate: " << ec.message();
+    redfish::messages::operationFailed(asyncResp->res);
+    return;
+  }
 
-    if (!(writeJsonFile(entryFilename, content).has_value()))
-    {
-        BMCWEB_LOG_ERROR << "Problem writing file " << entryFilename;
-        redfish::messages::operationFailed(asyncResp->res);
-        return;
-    }
+  if (!(writeJsonFile(entryFilename, content).has_value())) {
+    BMCWEB_LOG_ERROR << "Problem writing file " << entryFilename;
+    redfish::messages::operationFailed(asyncResp->res);
+    return;
+  }
 
-    redfish::messages::created(asyncResp->res);
+  redfish::messages::created(asyncResp->res);
 
-    insertResponseLocation(asyncResp->res, entryUrl);
+  insertResponseLocation(asyncResp->res, entryUrl);
 }
 
 void Hook::handleCreateEntry(
     const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& idInstance, const std::string& keywordMiddle)
-{
-    // Validate the middle path component in URL is the expected constant
-    if (keywordMiddle != pathMiddle)
-    {
-        BMCWEB_LOG_ERROR << "URL middle path component is not " << pathMiddle;
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+    const std::string& idInstance, const std::string& keywordMiddle) {
+  // Validate the middle path component in URL is the expected constant
+  if (keywordMiddle != pathMiddle) {
+    BMCWEB_LOG_ERROR << "URL middle path component is not " << pathMiddle;
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    // This handler has the same function as if the middle were omitted
-    handleCreateMiddle(req, asyncResp, idInstance);
+  // This handler has the same function as if the middle were omitted
+  handleCreateMiddle(req, asyncResp, idInstance);
 }
 
 // Given a dir, list its subdirs, but only those subdirs which are themselves
 // directories, and contain an "index.json" file within them.
 // Those "index.json" files are only checked for existence, nothing more.
-std::vector<std::filesystem::path>
-    listJsonDirs(const std::filesystem::path& dir)
-{
-    std::vector<std::filesystem::path> files;
-    std::error_code ec;
+std::vector<std::filesystem::path> listJsonDirs(
+    const std::filesystem::path& dir) {
+  std::vector<std::filesystem::path> files;
+  std::error_code ec;
 
-    // If containing directory not found, there can be no subdirectories
-    if (!(std::filesystem::exists(dir, ec)))
-    {
-        BMCWEB_LOG_INFO << "Location " << dir << " nonexistent";
-        return files;
-    }
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << "Problem checking for " << dir
-                         << " existence: " << ec.message();
-        return files;
-    }
-
-    // Old-style C++ iter loop, to get error checking, not using ranged for
-    for (auto entries = std::filesystem::directory_iterator{dir};
-         entries != std::filesystem::end(entries); entries.increment(ec))
-    {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "Problem with " << dir
-                             << " iterating: " << ec.message();
-            break;
-        }
-
-        const auto& entry = *entries;
-
-        // Only match directories
-        if (!(entry.is_directory()))
-        {
-            continue;
-        }
-
-        auto dirBasename = entry.path().filename();
-
-        // Validating against denyList not needed for entry, only for instance
-        if (!(validateFilename(dirBasename)))
-        {
-            continue;
-        }
-
-        // Safe to use / operator here, jsonFilename constant always relative
-        auto jsonWithin = entry.path() / jsonFilename;
-
-        // The directory must contain the special JSON filename
-        if (!(std::filesystem::exists(jsonWithin, ec)))
-        {
-            continue;
-        }
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "Problem checking for " << jsonWithin
-                             << " existence: " << ec.message();
-            continue;
-        }
-
-        files.emplace_back(dirBasename);
-    }
-
+  // If containing directory not found, there can be no subdirectories
+  if (!(std::filesystem::exists(dir, ec))) {
+    BMCWEB_LOG_INFO << "Location " << dir << " nonexistent";
     return files;
+  }
+  if (ec) {
+    BMCWEB_LOG_ERROR << "Problem checking for " << dir
+                     << " existence: " << ec.message();
+    return files;
+  }
+
+  // Old-style C++ iter loop, to get error checking, not using ranged for
+  for (auto entries = std::filesystem::directory_iterator{dir};
+       entries != std::filesystem::end(entries); entries.increment(ec)) {
+    if (ec) {
+      BMCWEB_LOG_ERROR << "Problem with " << dir
+                       << " iterating: " << ec.message();
+      break;
+    }
+
+    const auto& entry = *entries;
+
+    // Only match directories
+    if (!(entry.is_directory())) {
+      continue;
+    }
+
+    auto dirBasename = entry.path().filename();
+
+    // Validating against denyList not needed for entry, only for instance
+    if (!(validateFilename(dirBasename))) {
+      continue;
+    }
+
+    // Safe to use / operator here, jsonFilename constant always relative
+    auto jsonWithin = entry.path() / jsonFilename;
+
+    // The directory must contain the special JSON filename
+    if (!(std::filesystem::exists(jsonWithin, ec))) {
+      continue;
+    }
+    if (ec) {
+      BMCWEB_LOG_ERROR << "Problem checking for " << jsonWithin
+                       << " existence: " << ec.message();
+      continue;
+    }
+
+    files.emplace_back(dirBasename);
+  }
+
+  return files;
 }
 
 // Returns all existing instances under this hook, as a list of basenames
-std::vector<std::string> Hook::listInstances() const
-{
-    auto instanceDirs = listJsonDirs(locToFileDir(locBase()));
+std::vector<std::string> Hook::listInstances() const {
+  auto instanceDirs = listJsonDirs(locToFileDir(locBase()));
 
-    std::vector<std::string> result;
-    for (const auto& instanceDir : instanceDirs)
-    {
-        if (!(validateFilename(instanceDir, denyList)))
-        {
-            continue;
-        }
-
-        result.emplace_back(instanceDir.string());
+  std::vector<std::string> result;
+  for (const auto& instanceDir : instanceDirs) {
+    if (!(validateFilename(instanceDir, denyList))) {
+      continue;
     }
 
-    return result;
+    result.emplace_back(instanceDir.string());
+  }
+
+  return result;
 }
 
 void Hook::handleGetInstance(
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& idInstance)
-{
-    // If optional middle keyword not in use, instance same as middle
-    if (pathMiddle.empty())
-    {
-        return handleGetMiddle(asyncResp, idInstance, pathMiddle);
-    }
+    const std::string& idInstance) {
+  // If optional middle keyword not in use, instance same as middle
+  if (pathMiddle.empty()) {
+    return handleGetMiddle(asyncResp, idInstance, pathMiddle);
+  }
 
-    // Before doing anything with filesystem, validate naming restrictions
-    if (!(validateFilename(idInstance, denyList)))
-    {
-        BMCWEB_LOG_ERROR << "Instance ID within URL is not acceptable";
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+  // Before doing anything with filesystem, validate naming restrictions
+  if (!(validateFilename(idInstance, denyList))) {
+    BMCWEB_LOG_ERROR << "Instance ID within URL is not acceptable";
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    auto outerUrl = locInstance(idInstance);
-    auto outerFilename = locToFileJson(outerUrl);
+  auto outerUrl = locInstance(idInstance);
+  auto outerFilename = locToFileJson(outerUrl);
 
-    std::error_code ec;
+  std::error_code ec;
 
-    BMCWEB_LOG_DEBUG << "Get instance " << idInstance << " checking "
-                     << outerFilename;
-    if (!(std::filesystem::exists(outerFilename, ec)))
-    {
-        BMCWEB_LOG_ERROR << "Instance not found with ID " << idInstance;
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << "Problem checking for " << outerFilename
-                         << " existence: " << ec.message();
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+  BMCWEB_LOG_DEBUG << "Get instance " << idInstance << " checking "
+                   << outerFilename;
+  if (!(std::filesystem::exists(outerFilename, ec))) {
+    BMCWEB_LOG_ERROR << "Instance not found with ID " << idInstance;
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
+  if (ec) {
+    BMCWEB_LOG_ERROR << "Problem checking for " << outerFilename
+                     << " existence: " << ec.message();
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    auto contentOpt = readJsonFile(outerFilename);
-    if (!(contentOpt.has_value()))
-    {
-        BMCWEB_LOG_ERROR << "Problem reading file " << outerFilename;
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+  auto contentOpt = readJsonFile(outerFilename);
+  if (!(contentOpt.has_value())) {
+    BMCWEB_LOG_ERROR << "Problem reading file " << outerFilename;
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    auto& content = *contentOpt;
+  auto& content = *contentOpt;
 
-    // Regenerate these, as they were intentionally trimmed before storage
-    content["Id"] = idInstance;
-    content["@odata.id"] = outerUrl;
+  // Regenerate these, as they were intentionally trimmed before storage
+  content["Id"] = idInstance;
+  content["@odata.id"] = outerUrl;
 
-    auto innerUrl = locMiddle(idInstance);
+  auto innerUrl = locMiddle(idInstance);
 
-    // Synthesize a correct link to middle layer
-    auto middleObject = nlohmann::json::object();
-    middleObject["@odata.id"] = innerUrl;
-    content[pathMiddle] = middleObject;
+  // Synthesize a correct link to middle layer
+  auto middleObject = nlohmann::json::object();
+  middleObject["@odata.id"] = innerUrl;
+  content[pathMiddle] = middleObject;
 
-    redfish::messages::success(asyncResp->res);
+  redfish::messages::success(asyncResp->res);
 
-    asyncResp->res.jsonValue = std::move(content);
+  asyncResp->res.jsonValue = std::move(content);
 }
 
 void Hook::handleGetMiddle(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                            const std::string& idInstance,
-                           const std::string& keywordMiddle)
-{
-    // Before doing anything with filesystem, validate naming restrictions
-    if (!(validateFilename(idInstance, denyList)))
-    {
-        BMCWEB_LOG_ERROR << "Instance ID within URL is not acceptable";
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+                           const std::string& keywordMiddle) {
+  // Before doing anything with filesystem, validate naming restrictions
+  if (!(validateFilename(idInstance, denyList))) {
+    BMCWEB_LOG_ERROR << "Instance ID within URL is not acceptable";
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    // Validate the middle path component in URL is the expected constant
-    if (keywordMiddle != pathMiddle)
-    {
-        BMCWEB_LOG_ERROR << "URL middle path component is not " << pathMiddle;
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+  // Validate the middle path component in URL is the expected constant
+  if (keywordMiddle != pathMiddle) {
+    BMCWEB_LOG_ERROR << "URL middle path component is not " << pathMiddle;
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    auto innerUrl = locMiddle(idInstance);
-    auto innerDir = locToFileDir(innerUrl);
-    auto innerFilename = locToFileJson(innerUrl);
+  auto innerUrl = locMiddle(idInstance);
+  auto innerDir = locToFileDir(innerUrl);
+  auto innerFilename = locToFileJson(innerUrl);
 
-    std::error_code ec;
+  std::error_code ec;
 
-    BMCWEB_LOG_DEBUG << "Get middle " << idInstance
-                     << (keywordMiddle.empty() ? "" : "/") << keywordMiddle
-                     << " checking " << innerFilename;
-    if (!(std::filesystem::exists(innerFilename, ec)))
-    {
-        BMCWEB_LOG_ERROR << "Instance not found with ID " << idInstance;
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << "Problem checking for " << idInstance
-                         << " existence: " << ec.message();
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+  BMCWEB_LOG_DEBUG << "Get middle " << idInstance
+                   << (keywordMiddle.empty() ? "" : "/") << keywordMiddle
+                   << " checking " << innerFilename;
+  if (!(std::filesystem::exists(innerFilename, ec))) {
+    BMCWEB_LOG_ERROR << "Instance not found with ID " << idInstance;
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
+  if (ec) {
+    BMCWEB_LOG_ERROR << "Problem checking for " << idInstance
+                     << " existence: " << ec.message();
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    auto contentOpt = readJsonFile(innerFilename);
-    if (!(contentOpt.has_value()))
-    {
-        BMCWEB_LOG_ERROR << "Problem reading file " << innerFilename;
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+  auto contentOpt = readJsonFile(innerFilename);
+  if (!(contentOpt.has_value())) {
+    BMCWEB_LOG_ERROR << "Problem reading file " << innerFilename;
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    auto& content = *contentOpt;
+  auto& content = *contentOpt;
 
-    // Regenerate these, as they were intentionally trimmed before storage
-    content["Id"] = pathMiddle;
-    content["@odata.id"] = innerUrl;
+  // Regenerate these, as they were intentionally trimmed before storage
+  content["Id"] = pathMiddle;
+  content["@odata.id"] = innerUrl;
 
-    // Do not pass denylist in here, it is only for instance, not entry
-    auto files = listJsonDirs(innerDir);
+  // Do not pass denylist in here, it is only for instance, not entry
+  auto files = listJsonDirs(innerDir);
 
-    // Synthesize special "Members" array with links to all our entries
-    auto membersArray = nlohmann::json::array();
-    for (const auto& file : files)
-    {
-        // Safe to use / operator here, "file" already known to be relative
-        std::filesystem::path entryUrl = innerUrl / file;
+  // Synthesize special "Members" array with links to all our entries
+  auto membersArray = nlohmann::json::array();
+  for (const auto& file : files) {
+    // Safe to use / operator here, "file" already known to be relative
+    std::filesystem::path entryUrl = innerUrl / file;
 
-        auto fileObject = nlohmann::json::object();
-        fileObject["@odata.id"] = entryUrl;
-        fileObject["Id"] = file;
+    auto fileObject = nlohmann::json::object();
+    fileObject["@odata.id"] = entryUrl;
+    fileObject["Id"] = file;
 
-        // Automatically expand only the fields listed in expandList
-        if (!(expandList.empty()))
-        {
-            std::filesystem::path entryFilename = locToFileJson(entryUrl);
-            auto entryContentOpt = readJsonFile(entryFilename);
-            if (entryContentOpt.has_value())
-            {
-                auto entryContent = *entryContentOpt;
+    // Automatically expand only the fields listed in expandList
+    if (!(expandList.empty())) {
+      std::filesystem::path entryFilename = locToFileJson(entryUrl);
+      auto entryContentOpt = readJsonFile(entryFilename);
+      if (entryContentOpt.has_value()) {
+        auto entryContent = *entryContentOpt;
 
-                for (const auto& key : expandList)
-                {
-                    auto valueIter = entryContent.find(key);
-                    if (valueIter != entryContent.end())
-                    {
-                        fileObject[key] = *valueIter;
-                    }
-                }
-            }
+        for (const auto& key : expandList) {
+          auto valueIter = entryContent.find(key);
+          if (valueIter != entryContent.end()) {
+            fileObject[key] = *valueIter;
+          }
         }
-
-        membersArray += fileObject;
+      }
     }
 
-    // Finish putting the pieces together
-    content["Members"] = membersArray;
-    content["Members@odata.count"] = files.size();
+    membersArray += fileObject;
+  }
 
-    redfish::messages::success(asyncResp->res);
+  // Finish putting the pieces together
+  content["Members"] = membersArray;
+  content["Members@odata.count"] = files.size();
 
-    asyncResp->res.jsonValue = std::move(content);
+  redfish::messages::success(asyncResp->res);
+
+  asyncResp->res.jsonValue = std::move(content);
 }
 
 void Hook::handleGetEntry(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                           const nlohmann::json::json_pointer& jsonPtr,
                           const std::string& idInstance,
                           const std::string& keywordMiddle,
-                          const std::string& idEntry)
-{
-    // Before doing anything with filesystem, validate naming restrictions
-    if (!(validateFilename(idInstance, denyList)))
-    {
-        BMCWEB_LOG_ERROR << "Instance ID within URL is not acceptable";
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+                          const std::string& idEntry) {
+  // Before doing anything with filesystem, validate naming restrictions
+  if (!(validateFilename(idInstance, denyList))) {
+    BMCWEB_LOG_ERROR << "Instance ID within URL is not acceptable";
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    // Validate the middle path component in URL is the expected constant
-    if (keywordMiddle != pathMiddle)
-    {
-        BMCWEB_LOG_ERROR << "URL middle path component is not " << pathMiddle;
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+  // Validate the middle path component in URL is the expected constant
+  if (keywordMiddle != pathMiddle) {
+    BMCWEB_LOG_ERROR << "URL middle path component is not " << pathMiddle;
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    // Unlike instance, names on denyList are perfectly OK at this layer
-    if (!(validateFilename(idEntry)))
-    {
-        BMCWEB_LOG_ERROR << "Entry ID within URL not acceptable";
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+  // Unlike instance, names on denyList are perfectly OK at this layer
+  if (!(validateFilename(idEntry))) {
+    BMCWEB_LOG_ERROR << "Entry ID within URL not acceptable";
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    auto entryUrl = locEntry(idInstance, idEntry);
-    auto entryFilename = locToFileJson(entryUrl);
+  auto entryUrl = locEntry(idInstance, idEntry);
+  auto entryFilename = locToFileJson(entryUrl);
 
-    std::error_code ec;
+  std::error_code ec;
 
-    BMCWEB_LOG_DEBUG << "Get entry " << idInstance
-                     << (keywordMiddle.empty() ? "" : "/") << keywordMiddle
-                     << "/" << idEntry << " checking " << entryFilename;
-    const auto doesExist = (std::filesystem::exists(entryFilename, ec));
-    if (!doesExist)
-    {
-        BMCWEB_LOG_ERROR << "Entry not found with ID " << idEntry;
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << "Problem checking for " << idEntry
-                         << " existence: " << ec.message();
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+  BMCWEB_LOG_DEBUG << "Get entry " << idInstance
+                   << (keywordMiddle.empty() ? "" : "/") << keywordMiddle << "/"
+                   << idEntry << " checking " << entryFilename;
+  const auto doesExist = (std::filesystem::exists(entryFilename, ec));
+  if (!doesExist) {
+    BMCWEB_LOG_ERROR << "Entry not found with ID " << idEntry;
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
+  if (ec) {
+    BMCWEB_LOG_ERROR << "Problem checking for " << idEntry
+                     << " existence: " << ec.message();
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    auto contentOpt = readJsonFile(entryFilename);
-    if (!(contentOpt.has_value()))
-    {
-        BMCWEB_LOG_ERROR << "Problem reading file " << entryFilename;
-        asyncResp->res.result(boost::beast::http::status::not_found);
-        return;
-    }
+  auto contentOpt = readJsonFile(entryFilename);
+  if (!(contentOpt.has_value())) {
+    BMCWEB_LOG_ERROR << "Problem reading file " << entryFilename;
+    asyncResp->res.result(boost::beast::http::status::not_found);
+    return;
+  }
 
-    auto& content = *contentOpt;
+  auto& content = *contentOpt;
 
-    // Regenerate these, as they were intentionally trimmed before storage
-    content["Id"] = idEntry;
-    content["@odata.id"] = entryUrl;
+  // Regenerate these, as they were intentionally trimmed before storage
+  content["Id"] = idEntry;
+  content["@odata.id"] = entryUrl;
 
-    redfish::messages::success(asyncResp->res);
+  redfish::messages::success(asyncResp->res);
 
-    asyncResp->res.jsonValue[jsonPtr] = std::move(content);
+  asyncResp->res.jsonValue[jsonPtr] = std::move(content);
 }
 
-void Hook::deleteAll()
-{
-    std::error_code ec;
+void Hook::deleteAll() {
+  std::error_code ec;
 
-    auto count = std::filesystem::remove_all(pathPrefix, ec);
+  auto count = std::filesystem::remove_all(pathPrefix, ec);
 
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << "Problem with " << pathPrefix
-                         << " deleting: " << ec.message();
-    }
+  if (ec) {
+    BMCWEB_LOG_ERROR << "Problem with " << pathPrefix
+                     << " deleting: " << ec.message();
+  }
 
-    if (count > 0)
-    {
-        BMCWEB_LOG_INFO << "Deleted all " << count << " files/dirs from "
-                        << pathPrefix;
-    }
+  if (count > 0) {
+    BMCWEB_LOG_INFO << "Deleted all " << count << " files/dirs from "
+                    << pathPrefix;
+  }
 }
 
-void Hook::setPathPrefix(const std::filesystem::path& newPrefix)
-{
-    // This function is only for testing, loudly warn if used
-    BMCWEB_LOG_WARNING << "Changing path prefix to " << newPrefix;
+void Hook::setPathPrefix(const std::filesystem::path& newPrefix) {
+  // This function is only for testing, loudly warn if used
+  BMCWEB_LOG_WARNING << "Changing path prefix to " << newPrefix;
 
-    pathPrefix = newPrefix;
+  pathPrefix = newPrefix;
 }
 
 // Constructs a hook with known-good settings for usage with LogServices
-Hook makeLogServices()
-{
-    const std::string pathBase{"Systems/system/LogServices"};
-    const std::string midWord{"Entries"};
+Hook makeLogServices() {
+  const std::string pathBase{"Systems/system/LogServices"};
+  const std::string midWord{"Entries"};
 
-    // These names come from requestRoutesSystemLogServiceCollection()
-    std::vector<std::string> denyList{"EventLog", "Dump", "Crashdump",
-                                      "HostLogger"};
+  // These names come from requestRoutesSystemLogServiceCollection()
+  std::vector<std::string> denyList{"EventLog", "Dump", "Crashdump",
+                                    "HostLogger"};
 
-    // These names come from the "required" field of LogEntry JSON schema
-    std::vector<std::string> expandList{"EntryType", "@odata.id", "@odata.type",
-                                        "Id", "Name"};
+  // These names come from the "required" field of LogEntry JSON schema
+  std::vector<std::string> expandList{"EntryType", "@odata.id", "@odata.type",
+                                      "Id", "Name"};
 
-    // Additional useful names to pre-expand
-    expandList.emplace_back("Created");
+  // Additional useful names to pre-expand
+  expandList.emplace_back("Created");
 
-    return {pathBase, midWord, denyList, expandList};
+  return {pathBase, midWord, denyList, expandList};
 }
 
-std::shared_ptr<Hook>
-    rememberLogServices(const std::shared_ptr<Hook>& hookIncoming)
-{
-    static std::shared_ptr<Hook> hookLogServices = nullptr;
+std::shared_ptr<Hook> rememberLogServices(
+    const std::shared_ptr<Hook>& hookIncoming) {
+  static std::shared_ptr<Hook> hookLogServices = nullptr;
 
-    // If incoming pointer is valid, remember it for next time
-    if (hookIncoming)
-    {
-        hookLogServices = hookIncoming;
-    }
+  // If incoming pointer is valid, remember it for next time
+  if (hookIncoming) {
+    hookLogServices = hookIncoming;
+  }
 
-    return hookLogServices;
+  return hookLogServices;
 }
 
-} // namespace external_storer
+}  // namespace external_storer
 
-namespace redfish
-{
+namespace redfish {
 
 inline void handleLogServiceInstancePost(
     App& app, const std::shared_ptr<external_storer::Hook>& hook,
     const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    hook->handleCreateInstance(req, asyncResp);
+  hook->handleCreateInstance(req, asyncResp);
 }
 
 inline void handleLogServiceMiddlePost(
     App& app, const std::shared_ptr<external_storer::Hook>& hook,
     const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName, const std::string& instance)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+    const std::string& systemName, const std::string& instance) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    hook->handleCreateMiddle(req, asyncResp, instance);
+  hook->handleCreateMiddle(req, asyncResp, instance);
 }
 
 inline void handleLogServiceEntryPost(
@@ -1164,42 +1040,34 @@
     const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
     const std::string& systemName, const std::string& instance,
-    const std::string& middle)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+    const std::string& middle) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    hook->handleCreateEntry(req, asyncResp, instance, middle);
+  hook->handleCreateEntry(req, asyncResp, instance, middle);
 }
 
 inline void handleLogServiceInstanceGet(
     App& app, const std::shared_ptr<external_storer::Hook>& hook,
     const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName, const std::string& instance)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+    const std::string& systemName, const std::string& instance) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    hook->handleGetInstance(asyncResp, instance);
+  hook->handleGetInstance(asyncResp, instance);
 }
 
 inline void handleLogServiceMiddleGet(
@@ -1207,21 +1075,17 @@
     const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
     const std::string& systemName, const std::string& instance,
-    const std::string& middle)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+    const std::string& middle) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    hook->handleGetMiddle(asyncResp, instance, middle);
+  hook->handleGetMiddle(asyncResp, instance, middle);
 }
 
 inline void handleLogServiceEntryGet(
@@ -1229,73 +1093,66 @@
     const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
     const std::string& systemName, const std::string& instance,
-    const std::string& middle, const std::string& entry)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+    const std::string& middle, const std::string& entry) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    hook->handleGetEntry(asyncResp, ""_json_pointer, instance, middle, entry);
+  hook->handleGetEntry(asyncResp, ""_json_pointer, instance, middle, entry);
 }
 
 void requestRoutesExternalStorerLogServices(
-    App& app, const std::shared_ptr<external_storer::Hook>& hook)
-{
-    // Only 0-argument, 1-argument, and 2-argument POST routes exist
-    // There intentionally is no 3-argument POST handler
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/")
-        .privileges(redfish::privileges::postLogService)
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handleLogServiceInstancePost, std::ref(app), hook));
+    App& app, const std::shared_ptr<external_storer::Hook>& hook) {
+  // Only 0-argument, 1-argument, and 2-argument POST routes exist
+  // There intentionally is no 3-argument POST handler
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/")
+      .privileges(redfish::privileges::postLogService)
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handleLogServiceInstancePost, std::ref(app), hook));
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/<str>/")
-        .privileges(redfish::privileges::postLogService)
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handleLogServiceMiddlePost, std::ref(app), hook));
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/<str>/")
+      .privileges(redfish::privileges::postLogService)
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handleLogServiceMiddlePost, std::ref(app), hook));
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/<str>/<str>/")
-        .privileges(redfish::privileges::postLogService)
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handleLogServiceEntryPost, std::ref(app), hook));
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/<str>/<str>/")
+      .privileges(redfish::privileges::postLogService)
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handleLogServiceEntryPost, std::ref(app), hook));
 
-    // Only 1-argument, 2-argument, and 3-argument GET routes are here
-    // The 0-argument GET route is already handled by the integration point
-    // It is at log_services.hpp requestRoutesSystemLogServiceCollection()
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/<str>/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleLogServiceInstanceGet, std::ref(app), hook));
+  // Only 1-argument, 2-argument, and 3-argument GET routes are here
+  // The 0-argument GET route is already handled by the integration point
+  // It is at log_services.hpp requestRoutesSystemLogServiceCollection()
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/<str>/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleLogServiceInstanceGet, std::ref(app), hook));
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/<str>/<str>/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleLogServiceMiddleGet, std::ref(app), hook));
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/<str>/<str>/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleLogServiceMiddleGet, std::ref(app), hook));
 
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Systems/<str>/LogServices/<str>/<str>/<str>/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleLogServiceEntryGet, std::ref(app), hook));
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/<str>/<str>/<str>/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleLogServiceEntryGet, std::ref(app), hook));
 
-    // The integration point also needs to access the correct hook
-    external_storer::rememberLogServices(hook);
+  // The integration point also needs to access the correct hook
+  external_storer::rememberLogServices(hook);
 }
 
-void requestRoutesExternalStorer(App& app)
-{
-    auto hookLogServices = std::make_shared<external_storer::Hook>(
-        external_storer::makeLogServices());
+void requestRoutesExternalStorer(App& app) {
+  auto hookLogServices = std::make_shared<external_storer::Hook>(
+      external_storer::makeLogServices());
 
-    // The shared_ptr will be copied, stretching out its lifetime
-    requestRoutesExternalStorerLogServices(app, hookLogServices);
+  // The shared_ptr will be copied, stretching out its lifetime
+  requestRoutesExternalStorerLogServices(app, hookLogServices);
 }
 
-} // namespace redfish
+}  // namespace redfish
diff --git a/redfish-core/lib/external_storer.hpp b/redfish-core/lib/external_storer.hpp
index f6c0f41..d16d0bf 100644
--- a/redfish-core/lib/external_storer.hpp
+++ b/redfish-core/lib/external_storer.hpp
@@ -1,4 +1,5 @@
-#pragma once
+#ifndef THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_EXTERNAL_STORER_H_
+#define THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_EXTERNAL_STORER_H_
 
 // ExternalStorer allows external users (HTTP clients) to temporarily store
 // their data on this Redfish server, hence its name.
@@ -65,19 +66,21 @@
 // a denial of service attack by consuming all storage. This will be
 // addressed by future work.
 
-#include "app.hpp"
-
-#include <boost/uuid/uuid.hpp>
-#include <boost/uuid/uuid_generators.hpp>
-#include <boost/uuid/uuid_io.hpp>
-
-#include <cmath>
 #include <cstddef>
-#include <fstream>
-#include <sstream>
+#include <filesystem>  // NOLINT
+#include <memory>
+#include <string>
+#include <vector>
 
-namespace external_storer
-{
+#include "boost/uuid/uuid.hpp"  // NOLINT
+#include "boost/uuid/uuid_generators.hpp"  // NOLINT
+#include "boost/uuid/uuid_io.hpp"  // NOLINT
+#include "app.hpp"
+#include "http_request.hpp"
+#include "async_resp.hpp"
+#include <nlohmann/json.hpp>
+
+namespace external_storer {
 
 // These should become constexpr in a future compiler
 inline const std::filesystem::path defPathPrefix{"/run/bmcweb"};
@@ -90,78 +93,77 @@
 // This class only holds configuration and accounting data for the hook.
 // As for user-provided data, it is intentionally not here, as it is always
 // fetched from the filesystem backing store when needed.
-class Hook
-{
-  private:
-    // Relative location of hook, after redfishPrefix, before instance
-    std::filesystem::path pathBase;
+class Hook {
+ private:
+  // Relative location of hook, after redfishPrefix, before instance
+  std::filesystem::path pathBase;
 
-    // Optional middle keyword, required by some schemas, example "Entries"
-    std::filesystem::path pathMiddle;
+  // Optional middle keyword, required by some schemas, example "Entries"
+  std::filesystem::path pathMiddle;
 
-    // Disallow these user instances, avoid already-existing path components
-    std::vector<std::string> denyList;
+  // Disallow these user instances, avoid already-existing path components
+  std::vector<std::string> denyList;
 
-    // Automatically expand these fields when listing the array of entries
-    std::vector<std::string> expandList;
+  // Automatically expand these fields when listing the array of entries
+  std::vector<std::string> expandList;
 
-    // The root directory for local storage, changeable only for testing
-    std::filesystem::path pathPrefix;
+  // The root directory for local storage, changeable only for testing
+  std::filesystem::path pathPrefix;
 
-  public:
-    Hook(const std::string& b, const std::string& m,
-         const std::vector<std::string>& d, const std::vector<std::string>& e) :
-        pathBase(b),
-        pathMiddle(m), denyList(d), expandList(e), pathPrefix(defPathPrefix)
-    {}
+ public:
+  Hook(const std::string& b, const std::string& m,
+       const std::vector<std::string>& d, const std::vector<std::string>& e)
+      : pathBase(b),
+        pathMiddle(m),
+        denyList(d),
+        expandList(e),
+        pathPrefix(defPathPrefix) {}
 
-    void handleCreateInstance(
-        const crow::Request& req,
-        const std::shared_ptr<bmcweb::AsyncResp>& asyncResp);
-    void handleCreateMiddle(const crow::Request& req,
-                            const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                            const std::string& instance);
-    void handleCreateEntry(const crow::Request& req,
-                           const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                           const std::string& instance,
-                           const std::string& middle);
-
-    // The 0-argument Get handled by just-in-time insert at integration point
-    void handleGetInstance(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                           const std::string& instance);
-    void handleGetMiddle(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+  void handleCreateInstance(
+      const crow::Request& req,
+      const std::shared_ptr<bmcweb::AsyncResp>& asyncResp);
+  void handleCreateMiddle(const crow::Request& req,
+                          const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                          const std::string& instance);
+  void handleCreateEntry(const crow::Request& req,
+                         const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                          const std::string& instance,
                          const std::string& middle);
-    void handleGetEntry(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                        const nlohmann::json::json_pointer& jsonPtr,
-                        const std::string& instance, const std::string& middle,
-                        const std::string& entry);
 
-    // For use by the integration point
-    std::vector<std::string> listInstances() const;
+  // The 0-argument Get handled by just-in-time insert at integration point
+  void handleGetInstance(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                         const std::string& instance);
+  void handleGetMiddle(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                       const std::string& instance, const std::string& middle);
+  void handleGetEntry(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                      const nlohmann::json::json_pointer& jsonPtr,
+                      const std::string& instance, const std::string& middle,
+                      const std::string& entry);
 
-    // Utility functions for building up locations
-    std::filesystem::path locBase() const;
-    std::filesystem::path locInstance(const std::string& instance) const;
-    std::filesystem::path locMiddle(const std::string& instance) const;
-    std::filesystem::path locEntry(const std::string& instance,
-                                   const std::string& entry) const;
-    std::filesystem::path locToFileDir(const std::filesystem::path& loc) const;
-    std::filesystem::path locToFileJson(const std::filesystem::path& loc) const;
+  // For use by the integration point
+  std::vector<std::string> listInstances() const;
 
-    // For use only during testing
-    void deleteAll();
-    void setPathPrefix(const std::filesystem::path& newPrefix);
+  // Utility functions for building up locations
+  std::filesystem::path locBase() const;
+  std::filesystem::path locInstance(const std::string& instance) const;
+  std::filesystem::path locMiddle(const std::string& instance) const;
+  std::filesystem::path locEntry(const std::string& instance,
+                                 const std::string& entry) const;
+  std::filesystem::path locToFileDir(const std::filesystem::path& loc) const;
+  std::filesystem::path locToFileJson(const std::filesystem::path& loc) const;
+
+  // For use only during testing
+  void deleteAll();
+  void setPathPrefix(const std::filesystem::path& newPrefix);
 };
 
 Hook makeLogServices();
-std::shared_ptr<Hook>
-    rememberLogServices(const std::shared_ptr<Hook>& hookIncoming = nullptr);
+std::shared_ptr<Hook> rememberLogServices(
+    const std::shared_ptr<Hook>& hookIncoming = nullptr);
 
-} // namespace external_storer
+}  // namespace external_storer
 
-namespace redfish
-{
+namespace redfish {
 
 // The URL layout under LogServices requires "Entries" path component,
 // which seems unnecessary, but is required by the schema.
@@ -185,4 +187,6 @@
 // https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/43502
 void requestRoutesExternalStorer(App& app);
 
-} // namespace redfish
+}  // namespace redfish
+
+#endif  // THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_EXTERNAL_STORER_H_
diff --git a/redfish-core/lib/fabric_adapters.hpp b/redfish-core/lib/fabric_adapters.hpp
index 330ddfa..f3b6da7 100644
--- a/redfish-core/lib/fabric_adapters.hpp
+++ b/redfish-core/lib/fabric_adapters.hpp
@@ -1,17 +1,5 @@
-#pragma once
-
-#include "app.hpp"
-#include "dbus_utility.hpp"
-#include "managed_store_types.hpp"
-#include "query.hpp"
-#include "registries/privilege_registry.hpp"
-#include "collection.hpp"
-#include "dbus_utils.hpp"
-#include "json_utils.hpp"
-
-#include <boost/system/error_code.hpp>
-#include <sdbusplus/asio/property.hpp>
-#include <sdbusplus/unpack_properties.hpp>
+#ifndef THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_FABRIC_ADAPTERS_H_
+#define THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_FABRIC_ADAPTERS_H_
 
 #include <array>
 #include <functional>
@@ -19,78 +7,82 @@
 #include <string>
 #include <string_view>
 
+#include "boost/system/error_code.hpp"  // NOLINT
+#include "app.hpp"
+#include "http_request.hpp"
+#include "http_response.hpp"
+#include "logging.hpp"
+#include "utility.hpp"
+#include "async_resp.hpp"
+#include "dbus_utility.hpp"
+#include "error_messages.hpp"
+#include "query.hpp"
+#include "registries/privilege_registry.hpp"
+#include "collection.hpp"
+#include "dbus_utils.hpp"
 #include "managed_store.hpp"
+#include "managed_store_types.hpp"
+#include "sdbusplus/message/native_types.hpp"
+#include "sdbusplus/unpack_properties.hpp"
 
 #ifdef UNIT_TEST_BUILD
-#include "test/g3/mock_managed_store.hpp" // NOLINT
+#include "test/g3/mock_managed_store.hpp"  // NOLINT
 #endif
 
-namespace redfish
-{
+namespace redfish {
 
 inline void handleAdapterError(const boost::system::error_code& ec,
                                crow::Response& res,
-                               const std::string& adapterId)
-{
+                               const std::string& adapterId) {
+  if (ec.value() == boost::system::errc::io_error) {
+    messages::resourceNotFound(res, "#FabricAdapter.v1_4_0.FabricAdapter",
+                               adapterId);
+    return;
+  }
 
-    if (ec.value() == boost::system::errc::io_error)
-    {
-        messages::resourceNotFound(res, "#FabricAdapter.v1_4_0.FabricAdapter",
-                                   adapterId);
-        return;
-    }
-
-    BMCWEB_LOG_ERROR << "DBus method call failed with error " << ec.value();
-    messages::internalError(res);
+  BMCWEB_LOG_ERROR << "DBus method call failed with error " << ec.value();
+  messages::internalError(res);
 }
 
-inline void
-    getFabricAdapterLocation(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                             const std::string& serviceName,
-                             const std::string& fabricAdapterPath)
-{
-    managedStore::ManagedObjectStoreContext requestContext(aResp);
-    dbus_utils::getProperty<std::string>(
-        serviceName, fabricAdapterPath,
-        "xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode",
-        requestContext,
-        [aResp](const boost::system::error_code& ec,
-                const std::string& property) {
-        if (ec)
-        {
-            if (ec.value() != EBADR)
-            {
-                BMCWEB_LOG_ERROR << "DBUS response error for Location";
-                messages::internalError(aResp->res);
-            }
-            return;
+inline void getFabricAdapterLocation(
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+    const std::string& serviceName, const std::string& fabricAdapterPath) {
+  managedStore::ManagedObjectStoreContext requestContext(aResp);
+  dbus_utils::getProperty<std::string>(
+      serviceName, fabricAdapterPath,
+      "xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode",
+      requestContext,
+      [aResp](const boost::system::error_code& ec,
+              const std::string& property) {
+        if (ec) {
+          if (ec.value() != EBADR) {
+            BMCWEB_LOG_ERROR << "DBUS response error for Location";
+            messages::internalError(aResp->res);
+          }
+          return;
         }
 
         aResp->res.jsonValue["Location"]["PartLocation"]["ServiceLabel"] =
             property;
-        });
+      });
 }
 
-inline void
-    getFabricAdapterAsset(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                          const std::string& serviceName,
-                          const std::string& fabricAdapterPath)
-{
-    managedStore::ManagedObjectStoreContext context(aResp);
-    managedStore::GetManagedObjectStore()->getAllProperties(
-        serviceName, fabricAdapterPath,
-        "xyz.openbmc_project.Inventory.Decorator.Asset", context,
-        [fabricAdapterPath,
-         aResp{aResp}](const boost::system::error_code& ec,
-                       const dbus::utility::DBusPropertiesMap& propertiesList) {
-        if (ec)
-        {
-            if (ec.value() != EBADR)
-            {
-                BMCWEB_LOG_ERROR << "DBUS response error for Properties";
-                messages::internalError(aResp->res);
-            }
-            return;
+inline void getFabricAdapterAsset(
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+    const std::string& serviceName, const std::string& fabricAdapterPath) {
+  managedStore::ManagedObjectStoreContext context(aResp);
+  managedStore::GetManagedObjectStore()->getAllProperties(
+      serviceName, fabricAdapterPath,
+      "xyz.openbmc_project.Inventory.Decorator.Asset", context,
+      [fabricAdapterPath, aResp{aResp}](
+          const boost::system::error_code& ec,
+          const dbus::utility::DBusPropertiesMap& propertiesList) {
+        if (ec) {
+          if (ec.value() != EBADR) {
+            BMCWEB_LOG_ERROR << "DBUS response error for Properties";
+            messages::internalError(aResp->res);
+          }
+          return;
         }
 
         const std::string* serialNumber = nullptr;
@@ -103,273 +95,239 @@
             serialNumber, "Model", model, "PartNumber", partNumber,
             "SparePartNumber", sparePartNumber);
 
-        if (!success)
-        {
+        if (!success) {
+          messages::internalError(aResp->res);
+          return;
+        }
+
+        if (serialNumber != nullptr) {
+          aResp->res.jsonValue["SerialNumber"] = *serialNumber;
+        }
+
+        if (model != nullptr) {
+          aResp->res.jsonValue["Model"] = *model;
+        }
+
+        if (partNumber != nullptr) {
+          aResp->res.jsonValue["PartNumber"] = *partNumber;
+        }
+
+        if (sparePartNumber != nullptr && !sparePartNumber->empty()) {
+          aResp->res.jsonValue["SparePartNumber"] = *sparePartNumber;
+        }
+      });
+}
+
+inline void getFabricAdapterState(
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+    const std::string& serviceName, const std::string& fabricAdapterPath) {
+  managedStore::ManagedObjectStoreContext requestContext(aResp);
+  dbus_utils::getProperty<bool>(
+      serviceName, fabricAdapterPath, "xyz.openbmc_project.Inventory.Item",
+      "Present", requestContext,
+      [aResp](const boost::system::error_code& ec, const bool present) {
+        if (ec) {
+          if (ec.value() != EBADR) {
+            BMCWEB_LOG_ERROR << "DBUS response error for State";
             messages::internalError(aResp->res);
-            return;
+          }
+          return;
         }
 
-        if (serialNumber != nullptr)
-        {
-            aResp->res.jsonValue["SerialNumber"] = *serialNumber;
+        if (!present) {
+          aResp->res.jsonValue["Status"]["State"] = "Absent";
         }
-
-        if (model != nullptr)
-        {
-            aResp->res.jsonValue["Model"] = *model;
-        }
-
-        if (partNumber != nullptr)
-        {
-            aResp->res.jsonValue["PartNumber"] = *partNumber;
-        }
-
-        if (sparePartNumber != nullptr && !sparePartNumber->empty())
-        {
-            aResp->res.jsonValue["SparePartNumber"] = *sparePartNumber;
-        }
-        });
+      });
 }
 
-inline void
-    getFabricAdapterState(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                          const std::string& serviceName,
-                          const std::string& fabricAdapterPath)
-{
-    managedStore::ManagedObjectStoreContext requestContext(aResp);
-    dbus_utils::getProperty<bool>(
-        serviceName, fabricAdapterPath, "xyz.openbmc_project.Inventory.Item",
-        "Present", requestContext,
-        [aResp](const boost::system::error_code& ec, const bool present) {
-        if (ec)
-        {
-            if (ec.value() != EBADR)
-            {
-                BMCWEB_LOG_ERROR << "DBUS response error for State";
-                messages::internalError(aResp->res);
-            }
-            return;
+inline void getFabricAdapterHealth(
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+    const std::string& serviceName, const std::string& fabricAdapterPath) {
+  managedStore::ManagedObjectStoreContext requestContext(aResp);
+  dbus_utils::getProperty<bool>(
+      serviceName, fabricAdapterPath,
+      "xyz.openbmc_project.State.Decorator.OperationalStatus", "Functional",
+      requestContext,
+      [aResp](const boost::system::error_code& ec, const bool functional) {
+        if (ec) {
+          if (ec.value() != EBADR) {
+            BMCWEB_LOG_ERROR << "DBUS response error for Health";
+            messages::internalError(aResp->res);
+          }
+          return;
         }
 
-        if (!present)
-        {
-            aResp->res.jsonValue["Status"]["State"] = "Absent";
+        if (!functional) {
+          aResp->res.jsonValue["Status"]["Health"] = "Critical";
         }
-        });
-}
-
-inline void
-    getFabricAdapterHealth(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                           const std::string& serviceName,
-                           const std::string& fabricAdapterPath)
-{
-    managedStore::ManagedObjectStoreContext requestContext(aResp);
-    dbus_utils::getProperty<bool>(
-        serviceName, fabricAdapterPath,
-        "xyz.openbmc_project.State.Decorator.OperationalStatus", "Functional",
-        requestContext,
-        [aResp](const boost::system::error_code& ec, const bool functional) {
-        if (ec)
-        {
-            if (ec.value() != EBADR)
-            {
-                BMCWEB_LOG_ERROR << "DBUS response error for Health";
-                messages::internalError(aResp->res);
-            }
-            return;
-        }
-
-        if (!functional)
-        {
-            aResp->res.jsonValue["Status"]["Health"] = "Critical";
-        }
-        });
+      });
 }
 
 inline void doAdapterGet(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
                          const std::string& systemName,
                          const std::string& adapterId,
                          const std::string& fabricAdapterPath,
-                         const std::string& serviceName)
-{
-    aResp->res.addHeader(
-        boost::beast::http::field::link,
-        "</redfish/v1/JsonSchemas/FabricAdapter/FabricAdapter.json>; rel=describedby");
-    aResp->res.jsonValue["@odata.type"] = "#FabricAdapter.v1_4_0.FabricAdapter";
-    aResp->res.jsonValue["Name"] = "Fabric Adapter";
-    aResp->res.jsonValue["Id"] = adapterId;
-    aResp->res.jsonValue["@odata.id"] = crow::utility::urlFromPieces(
-        "redfish", "v1", "Systems", systemName, "FabricAdapters", adapterId);
+                         const std::string& serviceName) {
+  aResp->res.addHeader(boost::beast::http::field::link,
+                       "</redfish/v1/JsonSchemas/FabricAdapter/"
+                       "FabricAdapter.json>; rel=describedby");
+  aResp->res.jsonValue["@odata.type"] = "#FabricAdapter.v1_4_0.FabricAdapter";
+  aResp->res.jsonValue["Name"] = "Fabric Adapter";
+  aResp->res.jsonValue["Id"] = adapterId;
+  aResp->res.jsonValue["@odata.id"] = crow::utility::urlFromPieces(
+      "redfish", "v1", "Systems", systemName, "FabricAdapters", adapterId);
 
-    aResp->res.jsonValue["Status"]["State"] = "Enabled";
-    aResp->res.jsonValue["Status"]["Health"] = "OK";
+  aResp->res.jsonValue["Status"]["State"] = "Enabled";
+  aResp->res.jsonValue["Status"]["Health"] = "OK";
 
-    getFabricAdapterLocation(aResp, serviceName, fabricAdapterPath);
-    getFabricAdapterAsset(aResp, serviceName, fabricAdapterPath);
-    getFabricAdapterState(aResp, serviceName, fabricAdapterPath);
-    getFabricAdapterHealth(aResp, serviceName, fabricAdapterPath);
+  getFabricAdapterLocation(aResp, serviceName, fabricAdapterPath);
+  getFabricAdapterAsset(aResp, serviceName, fabricAdapterPath);
+  getFabricAdapterState(aResp, serviceName, fabricAdapterPath);
+  getFabricAdapterHealth(aResp, serviceName, fabricAdapterPath);
 }
 
 inline bool checkFabricAdapterId(const std::string& adapterPath,
-                                 const std::string& adapterId)
-{
-    std::string fabricAdapterName =
-        sdbusplus::message::object_path(adapterPath).filename();
+                                 const std::string& adapterId) {
+  std::string fabricAdapterName =
+      sdbusplus::message::object_path(adapterPath).filename();
 
-    return !(fabricAdapterName.empty() || fabricAdapterName != adapterId);
+  return !(fabricAdapterName.empty() || fabricAdapterName != adapterId);
 }
 
 inline void getValidFabricAdapterPath(
     const std::string& adapterId, const std::string& systemName,
     const std::shared_ptr<bmcweb::AsyncResp>& aResp,
     std::function<void(const std::string& fabricAdapterPath,
-                       const std::string& serviceName)>&& callback)
-{
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(aResp->res, "ComputerSystem", systemName);
-        return;
-    }
-    constexpr std::array<std::string_view, 1> interfaces{
-        "xyz.openbmc_project.Inventory.Item.FabricAdapter"};
+                       const std::string& serviceName)>&& callback) {
+  if (systemName != "system") {
+    messages::resourceNotFound(aResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  constexpr std::array<std::string_view, 1> interfaces{
+      "xyz.openbmc_project.Inventory.Item.FabricAdapter"};
 
-    managedStore::ManagedObjectStoreContext requestContext(aResp);
-    managedStore::GetManagedObjectStore()->getSubTree(
-        "/xyz/openbmc_project/inventory", 0, interfaces, requestContext,
-        [adapterId, aResp, requestContext,
-         callback](const boost::system::error_code& ec,
-                   const dbus::utility::MapperGetSubTreeResponse& subtree) {
-        if (ec)
-        {
-            handleAdapterError(ec, aResp->res, adapterId);
-            return;
+  managedStore::ManagedObjectStoreContext requestContext(aResp);
+  managedStore::GetManagedObjectStore()->getSubTree(
+      "/xyz/openbmc_project/inventory", 0, interfaces, requestContext,
+      [adapterId, aResp, requestContext, callback](
+          const boost::system::error_code& ec,
+          const dbus::utility::MapperGetSubTreeResponse& subtree) {
+        if (ec) {
+          handleAdapterError(ec, aResp->res, adapterId);
+          return;
         }
-        for (const auto& [adapterPath, serviceMap] : subtree)
-        {
-            if (checkFabricAdapterId(adapterPath, adapterId))
-            {
-                callback(adapterPath, serviceMap.begin()->first);
-                return;
-            }
+        for (const auto& [adapterPath, serviceMap] : subtree) {
+          if (checkFabricAdapterId(adapterPath, adapterId)) {
+            callback(adapterPath, serviceMap.begin()->first);
+            return;
+          }
         }
         BMCWEB_LOG_WARNING << "Adapter not found";
         messages::resourceNotFound(aResp->res, "FabricAdapter", adapterId);
-    });
+      });
 }
 
-inline void
-    handleFabricAdapterGet(App& app, const crow::Request& req,
-                           const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                           const std::string& systemName,
-                           const std::string& adapterId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, aResp))
-    {
-        return;
-    }
+inline void handleFabricAdapterGet(
+    App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+    const std::string& systemName, const std::string& adapterId) {
+  if (!redfish::setUpRedfishRoute(app, req, aResp)) {
+    return;
+  }
 
-    getValidFabricAdapterPath(
-        adapterId, systemName, aResp,
-        [aResp, systemName, adapterId](const std::string& fabricAdapterPath,
-                                       const std::string& serviceName) {
+  getValidFabricAdapterPath(
+      adapterId, systemName, aResp,
+      [aResp, systemName, adapterId](const std::string& fabricAdapterPath,
+                                     const std::string& serviceName) {
         doAdapterGet(aResp, systemName, adapterId, fabricAdapterPath,
                      serviceName);
-        });
+      });
 }
 
 inline void handleFabricAdapterCollectionGet(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, aResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(aResp->res, "ComputerSystem", systemName);
-        return;
-    }
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, aResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(aResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    aResp->res.addHeader(
-        boost::beast::http::field::link,
-        "</redfish/v1/JsonSchemas/FabricAdapterCollection/FabricAdapterCollection.json>; rel=describedby");
-    aResp->res.jsonValue["@odata.type"] =
-        "#FabricAdapterCollection.FabricAdapterCollection";
-    aResp->res.jsonValue["Name"] = "Fabric Adapter Collection";
-    aResp->res.jsonValue["@odata.id"] = crow::utility::urlFromPieces(
-        "redfish", "v1", "Systems", systemName, "FabricAdapters");
+  aResp->res.addHeader(boost::beast::http::field::link,
+                       "</redfish/v1/JsonSchemas/FabricAdapterCollection/"
+                       "FabricAdapterCollection.json>; rel=describedby");
+  aResp->res.jsonValue["@odata.type"] =
+      "#FabricAdapterCollection.FabricAdapterCollection";
+  aResp->res.jsonValue["Name"] = "Fabric Adapter Collection";
+  aResp->res.jsonValue["@odata.id"] = crow::utility::urlFromPieces(
+      "redfish", "v1", "Systems", systemName, "FabricAdapters");
 
-    constexpr std::array<std::string_view, 1> interfaces{
-        "xyz.openbmc_project.Inventory.Item.FabricAdapter"};
-    collection_util::getCollectionMembers(
-        aResp, boost::urls::url("/redfish/v1/Systems/system/FabricAdapters"),
-        interfaces);
+  constexpr std::array<std::string_view, 1> interfaces{
+      "xyz.openbmc_project.Inventory.Item.FabricAdapter"};
+  collection_util::getCollectionMembers(
+      aResp, boost::urls::url("/redfish/v1/Systems/system/FabricAdapters"),
+      interfaces);
 }
 
 inline void handleFabricAdapterCollectionHead(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, aResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(aResp->res, "ComputerSystem", systemName);
-        return;
-    }
-    aResp->res.addHeader(
-        boost::beast::http::field::link,
-        "</redfish/v1/JsonSchemas/FabricAdapterCollection/FabricAdapterCollection.json>; rel=describedby");
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, aResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(aResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  aResp->res.addHeader(boost::beast::http::field::link,
+                       "</redfish/v1/JsonSchemas/FabricAdapterCollection/"
+                       "FabricAdapterCollection.json>; rel=describedby");
 }
 
-inline void
-    handleFabricAdapterHead(crow::App& app, const crow::Request& req,
-                            const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                            const std::string& systemName,
-                            const std::string& adapterId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, aResp))
-    {
-        return;
-    }
+inline void handleFabricAdapterHead(
+    crow::App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+    const std::string& systemName, const std::string& adapterId) {
+  if (!redfish::setUpRedfishRoute(app, req, aResp)) {
+    return;
+  }
 
-    getValidFabricAdapterPath(
-        adapterId, systemName, aResp,
-        [aResp, systemName, adapterId](const std::string&, const std::string&) {
-        aResp->res.addHeader(
-            boost::beast::http::field::link,
-            "</redfish/v1/JsonSchemas/FabricAdapter/FabricAdapter.json>; rel=describedby");
-        });
+  getValidFabricAdapterPath(
+      adapterId, systemName, aResp,
+      [aResp, systemName, adapterId](const std::string&, const std::string&) {
+        aResp->res.addHeader(boost::beast::http::field::link,
+                             "</redfish/v1/JsonSchemas/FabricAdapter/"
+                             "FabricAdapter.json>; rel=describedby");
+      });
 }
 
-inline void requestRoutesFabricAdapterCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/")
-        .privileges(redfish::privileges::getFabricAdapterCollection)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleFabricAdapterCollectionGet, std::ref(app)));
+inline void requestRoutesFabricAdapterCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/")
+      .privileges(redfish::privileges::getFabricAdapterCollection)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleFabricAdapterCollectionGet, std::ref(app)));
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/")
-        .privileges(redfish::privileges::headFabricAdapterCollection)
-        .methods(boost::beast::http::verb::head)(
-            std::bind_front(handleFabricAdapterCollectionHead, std::ref(app)));
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/")
+      .privileges(redfish::privileges::headFabricAdapterCollection)
+      .methods(boost::beast::http::verb::head)(
+          std::bind_front(handleFabricAdapterCollectionHead, std::ref(app)));
 }
 
-inline void requestRoutesFabricAdapters(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/<str>/")
-        .privileges(redfish::privileges::getFabricAdapter)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleFabricAdapterGet, std::ref(app)));
+inline void requestRoutesFabricAdapters(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/<str>/")
+      .privileges(redfish::privileges::getFabricAdapter)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleFabricAdapterGet, std::ref(app)));
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/<str>/")
-        .privileges(redfish::privileges::headFabricAdapter)
-        .methods(boost::beast::http::verb::head)(
-            std::bind_front(handleFabricAdapterHead, std::ref(app)));
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/FabricAdapters/<str>/")
+      .privileges(redfish::privileges::headFabricAdapter)
+      .methods(boost::beast::http::verb::head)(
+          std::bind_front(handleFabricAdapterHead, std::ref(app)));
 }
-} // namespace redfish
+}  // namespace redfish
+
+#endif  // THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_FABRIC_ADAPTERS_H_
diff --git a/redfish-core/lib/fan.hpp b/redfish-core/lib/fan.hpp
index 68d4f03..a73a620 100644
--- a/redfish-core/lib/fan.hpp
+++ b/redfish-core/lib/fan.hpp
@@ -1,20 +1,5 @@
-#pragma once
-
-#include "app.hpp"
-#include "dbus_utility.hpp"
-#include "error_messages.hpp"
-#include "managed_store.hpp"
-#include "managed_store_types.hpp"
-#include "query.hpp"
-#include "registries/privilege_registry.hpp"
-#include "chassis_utils.hpp"
-#include "json_utils.hpp"
-#include "location_utils.hpp"
-
-#include <boost/system/error_code.hpp>
-#include <boost/url/format.hpp>
-#include <sdbusplus/asio/property.hpp>
-#include <sdbusplus/message/types.hpp>
+#ifndef THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_FAN_H_
+#define THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_FAN_H_
 
 #include <functional>
 #include <memory>
@@ -22,261 +7,250 @@
 #include <string>
 #include <string_view>
 
+#include "boost/system/error_code.hpp"  // NOLINT
+#include "boost/url/format.hpp"  // NOLINT
+#include "app.hpp"
+#include "dbus_utility.hpp"
+#include "error_messages.hpp"
+#include "query.hpp"
+#include "registries/privilege_registry.hpp"
+#include "chassis_utils.hpp"
+#include "json_utils.hpp"
+#include "location_utils.hpp"
+#include "managed_store.hpp"
+#include "managed_store_types.hpp"
+#include "sdbusplus/asio/property.hpp"
+#include "sdbusplus/message/types.hpp"
+
 #ifdef UNIT_TEST_BUILD
-#include "test/g3/mock_managed_store.hpp" // NOLINT
+#include "test/g3/mock_managed_store.hpp"  // NOLINT
 #endif
 
-namespace redfish
-{
+namespace redfish {
 
 constexpr std::array<std::string_view, 1> fanInterfaces = {
     "xyz.openbmc_project.Configuration.Fan"};
 constexpr std::array<std::string_view, 1> sensorInterfaces = {
     "xyz.openbmc_project.Sensor.Value"};
 
-inline void
-    updateFanList(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                  const std::string& chassisId,
-                  const dbus::utility::MapperGetSubTreePathsResponse& fanPaths)
-{
-    nlohmann::json& fanList = asyncResp->res.jsonValue["Members"];
-    for (const std::string& fanPath : fanPaths)
-    {
-        if (fanPath.empty())
-        {
-            BMCWEB_LOG_DEBUG << "Error getting D-Bus object!";
-            messages::internalError(asyncResp->res);
-            return;
-        }
-
-        std::string fanName =
-            sdbusplus::message::object_path(fanPath).filename();
-
-        std::string chassisName;
-
-        // 5 below comes from
-        // /xyz/openbmc_project/inventory/system/chassis/chassisName/fanName
-        //   0      1             2         3         4         5      6
-        if (!dbus::utility::getNthStringFromPath(fanPath, 5, chassisName) ||
-            fanName.empty())
-        {
-            BMCWEB_LOG_ERROR << "Got invalid path " << fanPath;
-            messages::invalidObject(
-                asyncResp->res,
-                crow::utility::urlFromPieces("xyz", "openbmc_project",
-                                             "inventory", "system", fanPath));
-            continue;
-        }
-
-        if (chassisName != chassisId)
-        {
-            BMCWEB_LOG_ERROR << "The fan obtained at this time "
-                                "does not belong to this chassis ";
-            continue;
-        }
-
-        nlohmann::json item = nlohmann::json::object();
-        item["@odata.id"] = boost::urls::format(
-            "/redfish/v1/Chassis/{}/ThermalSubsystem/Fans/{}", chassisId,
-            fanName);
-
-        fanList.emplace_back(std::move(item));
+inline void updateFanList(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& chassisId,
+    const dbus::utility::MapperGetSubTreePathsResponse& fanPaths) {
+  nlohmann::json& fanList = asyncResp->res.jsonValue["Members"];
+  for (const std::string& fanPath : fanPaths) {
+    if (fanPath.empty()) {
+      BMCWEB_LOG_DEBUG << "Error getting D-Bus object!";
+      messages::internalError(asyncResp->res);
+      return;
     }
-    asyncResp->res.jsonValue["Members@odata.count"] = fanList.size();
+
+    std::string fanName = sdbusplus::message::object_path(fanPath).filename();
+
+    std::string chassisName;
+
+    // 5 below comes from
+    // /xyz/openbmc_project/inventory/system/chassis/chassisName/fanName
+    //   0      1             2         3         4         5      6
+    if (!dbus::utility::getNthStringFromPath(fanPath, 5, chassisName) ||
+        fanName.empty()) {
+      BMCWEB_LOG_ERROR << "Got invalid path " << fanPath;
+      messages::invalidObject(
+          asyncResp->res,
+          crow::utility::urlFromPieces("xyz", "openbmc_project", "inventory",
+                                       "system", fanPath));
+      continue;
+    }
+
+    if (chassisName != chassisId) {
+      BMCWEB_LOG_ERROR << "The fan obtained at this time "
+                          "does not belong to this chassis ";
+      continue;
+    }
+
+    nlohmann::json item = nlohmann::json::object();
+    item["@odata.id"] = boost::urls::format(
+        "/redfish/v1/Chassis/{}/ThermalSubsystem/Fans/{}", chassisId, fanName);
+
+    fanList.emplace_back(std::move(item));
+  }
+  asyncResp->res.jsonValue["Members@odata.count"] = fanList.size();
 }
 
 inline void getFanPaths(
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
     const std::optional<std::string>& validChassisPath,
     const std::function<void(const dbus::utility::MapperGetSubTreePathsResponse&
-                                 fanPaths)>& callback)
-{
-    sdbusplus::message::object_path endpointPath{*validChassisPath};
-    endpointPath /= "cooled_by";
+                                 fanPaths)>& callback) {
+  sdbusplus::message::object_path endpointPath{*validChassisPath};
+  endpointPath /= "cooled_by";
 
-    // TODO(tomtung): enable this after setting up associations.
-    //  dbus::utility::getAssociatedSubTreePaths(
-    //    endpointPath,
-    //    sdbusplus::message::object_path("/xyz/openbmc_project/inventory"), 0,
-    //    fanInterfaces,
-    //    [asyncResp, callback](
-    //        const boost::system::error_code& ec,
-    //        const dbus::utility::MapperGetSubTreePathsResponse& subtreePaths)
-    //        {
-    //    if (ec)
-    //    {
-    //        if (ec.value() != EBADR)
-    //        {
-    //            BMCWEB_LOG_ERROR
-    //                << "DBUS response error for getAssociatedSubTreePaths "
-    //                << ec.value();
-    //            messages::internalError(asyncResp->res);
-    //        }
-    //        return;
-    //    }
-    //    callback(subtreePaths);
-    //    });
+  // TODO(tomtung): enable this after setting up associations.
+  //  dbus::utility::getAssociatedSubTreePaths(
+  //    endpointPath,
+  //    sdbusplus::message::object_path("/xyz/openbmc_project/inventory"), 0,
+  //    fanInterfaces,
+  //    [asyncResp, callback](
+  //        const boost::system::error_code& ec,
+  //        const dbus::utility::MapperGetSubTreePathsResponse& subtreePaths)
+  //        {
+  //    if (ec)
+  //    {
+  //        if (ec.value() != EBADR)
+  //        {
+  //            BMCWEB_LOG_ERROR
+  //                << "DBUS response error for getAssociatedSubTreePaths "
+  //                << ec.value();
+  //            messages::internalError(asyncResp->res);
+  //        }
+  //        return;
+  //    }
+  //    callback(subtreePaths);
+  //    });
 
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    dbus_utils::getSubTreePaths(
-        "/xyz/openbmc_project/inventory", 0, fanInterfaces, context,
-        [asyncResp, callback](
-            const boost::system::error_code& ec,
-            const dbus::utility::MapperGetSubTreePathsResponse& subtreePaths) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS response error";
-            messages::internalError(asyncResp->res);
-            return;
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  dbus_utils::getSubTreePaths(
+      "/xyz/openbmc_project/inventory", 0, fanInterfaces, context,
+      [asyncResp, callback](
+          const boost::system::error_code& ec,
+          const dbus::utility::MapperGetSubTreePathsResponse& subtreePaths) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS response error";
+          messages::internalError(asyncResp->res);
+          return;
         }
         callback(subtreePaths);
-    });
+      });
 }
 
-inline void doFanCollection(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                            const std::string& chassisId,
-                            const std::optional<std::string>& validChassisPath)
-{
-    if (!validChassisPath)
-    {
-        BMCWEB_LOG_ERROR << "Not a valid chassis ID" << chassisId;
-        messages::resourceNotFound(asyncResp->res, "Chassis", chassisId);
-        return;
-    }
+inline void doFanCollection(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& chassisId,
+    const std::optional<std::string>& validChassisPath) {
+  if (!validChassisPath) {
+    BMCWEB_LOG_ERROR << "Not a valid chassis ID" << chassisId;
+    messages::resourceNotFound(asyncResp->res, "Chassis", chassisId);
+    return;
+  }
 
-    BMCWEB_LOG_DEBUG << "Get fan list associated to chassis = " << chassisId;
-    asyncResp->res.addHeader(
-        boost::beast::http::field::link,
-        "</redfish/v1/JsonSchemas/FanCollection/FanCollection.json>; rel=describedby");
-    asyncResp->res.jsonValue["@odata.type"] = "#FanCollection.FanCollection";
-    asyncResp->res.jsonValue["@odata.id"] = boost::urls::format(
-        "/redfish/v1/Chassis/{}/ThermalSubsystem/Fans", chassisId);
-    asyncResp->res.jsonValue["Name"] = "Fan Collection";
-    asyncResp->res.jsonValue["Description"] =
-        "The collection of Fan resource instances " + chassisId;
-    asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
-    asyncResp->res.jsonValue["Members@odata.count"] = 0;
+  BMCWEB_LOG_DEBUG << "Get fan list associated to chassis = " << chassisId;
+  asyncResp->res.addHeader(boost::beast::http::field::link,
+                           "</redfish/v1/JsonSchemas/FanCollection/"
+                           "FanCollection.json>; rel=describedby");
+  asyncResp->res.jsonValue["@odata.type"] = "#FanCollection.FanCollection";
+  asyncResp->res.jsonValue["@odata.id"] = boost::urls::format(
+      "/redfish/v1/Chassis/{}/ThermalSubsystem/Fans", chassisId);
+  asyncResp->res.jsonValue["Name"] = "Fan Collection";
+  asyncResp->res.jsonValue["Description"] =
+      "The collection of Fan resource instances " + chassisId;
+  asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
+  asyncResp->res.jsonValue["Members@odata.count"] = 0;
 
-    getFanPaths(asyncResp, validChassisPath,
-                std::bind_front(updateFanList, asyncResp, chassisId));
+  getFanPaths(asyncResp, validChassisPath,
+              std::bind_front(updateFanList, asyncResp, chassisId));
 }
 
-inline void
-    getFanSensorValue(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                      const std::string& chassisId,
-                      const std::string& sensorName,
-                      const std::string& sensorType)
-{
-    constexpr std::array<std::string_view, 4> supportedSensorTypes = {
-        "fan_tach", "fan_pwm", "secondary_fan_tach", "secondary_fan_pwm"};
-    if (std::find(supportedSensorTypes.begin(), supportedSensorTypes.end(),
-                  sensorType) == supportedSensorTypes.end())
-    {
-        BMCWEB_LOG_DEBUG << "Unsupported sensor type";
-        messages::internalError(asyncResp->res);
-        return;
-    }
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    auto getFanSensorsHandler =
-        [asyncResp, chassisId, sensorName, sensorType, requestContext](
-            const boost::system::error_code ec,
-            const std::vector<std::pair<
-                std::string,
-                std::vector<std::pair<std::string, std::vector<std::string>>>>>&
-                sensorsubtree) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "D-Bus response error on GetSubTree " << ec;
-            messages::internalError(asyncResp->res);
-            return;
+inline void getFanSensorValue(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& chassisId, const std::string& sensorName,
+    const std::string& sensorType) {
+  constexpr std::array<std::string_view, 4> supportedSensorTypes = {
+      "fan_tach", "fan_pwm", "secondary_fan_tach", "secondary_fan_pwm"};
+  if (std::find(supportedSensorTypes.begin(), supportedSensorTypes.end(),
+                sensorType) == supportedSensorTypes.end()) {
+    BMCWEB_LOG_DEBUG << "Unsupported sensor type";
+    messages::internalError(asyncResp->res);
+    return;
+  }
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  auto getFanSensorsHandler =
+      [asyncResp, chassisId, sensorName, sensorType, requestContext](
+          const boost::system::error_code ec,
+          const std::vector<std::pair<
+              std::string,
+              std::vector<std::pair<std::string, std::vector<std::string>>>>>&
+              sensorsubtree) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "D-Bus response error on GetSubTree " << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
 
-        for (const auto& [objectPath, serviceNames] : sensorsubtree)
-        {
-            if (serviceNames.size() > 1)
-            {
-                BMCWEB_LOG_DEBUG
-                    << "Skipping over ambiguous sensor served by multiple services: "
-                    << objectPath;
-                continue;
-            }
-            if (objectPath.empty() || serviceNames.size() != 1)
-            {
-                BMCWEB_LOG_DEBUG << "Error getting Fan D-Bus object!";
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            sdbusplus::message::object_path path(objectPath);
-            const std::string& leaf = path.filename();
-            if (leaf.empty())
-            {
-                continue;
-            }
-            if (leaf != sensorName)
-            {
-                continue;
-            }
+        for (const auto& [objectPath, serviceNames] : sensorsubtree) {
+          if (serviceNames.size() > 1) {
+            BMCWEB_LOG_DEBUG << "Skipping over ambiguous sensor served by "
+                                "multiple services: "
+                             << objectPath;
+            continue;
+          }
+          if (objectPath.empty() || serviceNames.size() != 1) {
+            BMCWEB_LOG_DEBUG << "Error getting Fan D-Bus object!";
+            messages::internalError(asyncResp->res);
+            return;
+          }
+          sdbusplus::message::object_path path(objectPath);
+          const std::string& leaf = path.filename();
+          if (leaf.empty()) {
+            continue;
+          }
+          if (leaf != sensorName) {
+            continue;
+          }
 
-            // There is no reason to populate PartLocationContext only for
-            // fan_pwm but it happens so that both fan_pwm and fan_tach
-            // sensors are associated with the same chassis through entity
-            // manager config today so we arbitraty picked fan_pwm to find
-            // the associated chassis.
-            if (sensorType == "fan_pwm")
-            {
-                // Get PartLocationContext
-                location_util::getPartLocationContext(
-                    asyncResp, "/Location"_json_pointer, path.str + "/chassis");
-            }
+          // There is no reason to populate PartLocationContext only for
+          // fan_pwm but it happens so that both fan_pwm and fan_tach
+          // sensors are associated with the same chassis through entity
+          // manager config today so we arbitraty picked fan_pwm to find
+          // the associated chassis.
+          if (sensorType == "fan_pwm") {
+            // Get PartLocationContext
+            location_util::getPartLocationContext(
+                asyncResp, "/Location"_json_pointer, path.str + "/chassis");
+          }
 
-            const std::string& connectionName = serviceNames[0].first;
-            const std::string& tempPath = objectPath;
-            auto getAssociationHandler =
-                [asyncResp, tempPath, connectionName, chassisId, sensorName,
-                 sensorType,
-                 requestContext](const boost::system::error_code ec2,
-                                 const std::vector<std::string>& resp) {
+          const std::string& connectionName = serviceNames[0].first;
+          const std::string& tempPath = objectPath;
+          auto getAssociationHandler =
+              [asyncResp, tempPath, connectionName, chassisId, sensorName,
+               sensorType,
+               requestContext](const boost::system::error_code ec2,
+                               const std::vector<std::string>& resp) {
                 BMCWEB_LOG_DEBUG << "Getting chassis association for sensor "
                                  << sensorName;
-                if (ec2)
-                {
-                    BMCWEB_LOG_DEBUG
-                        << "Error getting chassis association for the sensor!";
-                    messages::internalError(asyncResp->res);
-                    return;
+                if (ec2) {
+                  BMCWEB_LOG_DEBUG
+                      << "Error getting chassis association for the sensor!";
+                  messages::internalError(asyncResp->res);
+                  return;
                 }
-                if (resp.size() != 1)
-                {
-                    BMCWEB_LOG_DEBUG
-                        << "The number of associated chassis should be 1";
-                    messages::internalError(asyncResp->res);
-                    return;
+                if (resp.size() != 1) {
+                  BMCWEB_LOG_DEBUG
+                      << "The number of associated chassis should be 1";
+                  messages::internalError(asyncResp->res);
+                  return;
                 }
                 sdbusplus::message::object_path path2(resp[0]);
                 std::string leaf2 = path2.filename();
-                if (leaf2 != chassisId)
-                {
-                    BMCWEB_LOG_DEBUG
-                        << "The sensor doesn't belong to the chassis "
-                        << chassisId;
-                    messages::internalError(asyncResp->res);
-                    return;
+                if (leaf2 != chassisId) {
+                  BMCWEB_LOG_DEBUG
+                      << "The sensor doesn't belong to the chassis "
+                      << chassisId;
+                  messages::internalError(asyncResp->res);
+                  return;
                 }
                 auto getFanPropertyHandler =
-                    [asyncResp, chassisId, sensorName,
-                     sensorType](const boost::system::error_code ec3,
-                                 const double& resp2) {
-                    if (ec3)
-                    {
+                    [asyncResp, chassisId, sensorName, sensorType](
+                        const boost::system::error_code ec3,
+                        const double& resp2) {
+                      if (ec3) {
                         BMCWEB_LOG_DEBUG
                             << "Error getting sensor value for sensor:"
                             << sensorName;
                         messages::internalError(asyncResp->res);
                         return;
-                    }
-                    if (sensorType == "fan_pwm" ||
-                        sensorType == "secondary_fan_pwm")
-                    {
+                      }
+                      if (sensorType == "fan_pwm" ||
+                          sensorType == "secondary_fan_pwm") {
                         const std::string jsonKey =
                             (sensorType == "fan_pwm") ? "SpeedPercent"
                                                       : "SecondarySpeedPercent";
@@ -287,215 +261,169 @@
                                 .append("fanpwm_" + sensorName)
                                 .append("/");
                         asyncResp->res.jsonValue[jsonKey]["Reading"] = resp2;
-                    }
-                    else if (sensorType == "fan_tach")
-                    {
+                      } else if (sensorType == "fan_tach") {
                         asyncResp->res.jsonValue["SpeedPercent"]["SpeedRPM"] =
                             resp2;
-                    }
-                    else if (sensorType == "secondary_fan_tach")
-                    {
+                      } else if (sensorType == "secondary_fan_tach") {
                         asyncResp->res
                             .jsonValue["SecondarySpeedPercent"]["SpeedRPM"] =
                             resp2;
-                    }
-                };
+                      }
+                    };
                 dbus_utils::getProperty<double>(
                     connectionName, tempPath,
                     "xyz.openbmc_project.Sensor.Value", "Value", requestContext,
                     getFanPropertyHandler);
-            };
-            dbus_utils::getProperty<std::vector<std::string>>(
-                "xyz.openbmc_project.ObjectMapper", tempPath + "/chassis",
-                "xyz.openbmc_project.Association", "endpoints", requestContext,
-                getAssociationHandler);
+              };
+          dbus_utils::getProperty<std::vector<std::string>>(
+              "xyz.openbmc_project.ObjectMapper", tempPath + "/chassis",
+              "xyz.openbmc_project.Association", "endpoints", requestContext,
+              getAssociationHandler);
         }
-    };
-    managedStore::GetManagedObjectStore()->getSubTree(
-        "/xyz/openbmc_project/sensors", 0, sensorInterfaces, requestContext,
-        getFanSensorsHandler);
+      };
+  managedStore::GetManagedObjectStore()->getSubTree(
+      "/xyz/openbmc_project/sensors", 0, sensorInterfaces, requestContext,
+      getFanSensorsHandler);
 }
 
-inline void
-    fillFanProperties(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                      const boost::system::error_code ec,
-                      const dbus::utility::DBusPropertiesMap& properties,
-                      const std::string& chassisId)
-{
-    if (ec)
-    {
-        BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+inline void fillFanProperties(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const boost::system::error_code ec,
+    const dbus::utility::DBusPropertiesMap& properties,
+    const std::string& chassisId) {
+  if (ec) {
+    BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+    messages::internalError(asyncResp->res);
+    return;
+  }
+  for (const auto& [propKey, propVariant] : properties) {
+    if (propKey == "HotPluggable") {
+      const bool* hotPluggable = std::get_if<bool>(&propVariant);
+      if (hotPluggable == nullptr) {
         messages::internalError(asyncResp->res);
         return;
+      }
+      asyncResp->res.jsonValue["HotPluggable"] = *hotPluggable;
+    } else if (propKey == "LocationType") {
+      const std::string* locationType = std::get_if<std::string>(&propVariant);
+      if (locationType == nullptr) {
+        messages::internalError(asyncResp->res);
+        return;
+      }
+      asyncResp->res.jsonValue["Location"]["PartLocation"]["LocationType"] =
+          *locationType;
+    } else if (propKey == "ServiceLabel") {
+      const std::string* serviceLabel = std::get_if<std::string>(&propVariant);
+      if (serviceLabel == nullptr) {
+        messages::internalError(asyncResp->res);
+        return;
+      }
+      asyncResp->res.jsonValue["Location"]["PartLocation"]["ServiceLabel"] =
+          *serviceLabel;
+    } else if (propKey == "TachSensor") {
+      const std::string* tachSensor = std::get_if<std::string>(&propVariant);
+      if (tachSensor == nullptr) {
+        messages::internalError(asyncResp->res);
+        return;
+      }
+      getFanSensorValue(asyncResp, chassisId, *tachSensor, "fan_tach");
+    } else if (propKey == "PWMSensor") {
+      const std::string* pwmSensor = std::get_if<std::string>(&propVariant);
+      if (pwmSensor == nullptr) {
+        messages::internalError(asyncResp->res);
+        return;
+      }
+      getFanSensorValue(asyncResp, chassisId, *pwmSensor, "fan_pwm");
+    } else if (propKey == "SecondaryTachSensor") {
+      const std::string* tachSensor = std::get_if<std::string>(&propVariant);
+      if (tachSensor == nullptr) {
+        messages::internalError(asyncResp->res);
+        return;
+      }
+      getFanSensorValue(asyncResp, chassisId, *tachSensor,
+                        "secondary_fan_tach");
+    } else if (propKey == "SecondaryPWMSensor") {
+      const std::string* pwmSensor = std::get_if<std::string>(&propVariant);
+      if (pwmSensor == nullptr) {
+        messages::internalError(asyncResp->res);
+        return;
+      }
+      getFanSensorValue(asyncResp, chassisId, *pwmSensor, "secondary_fan_pwm");
     }
-    for (const auto& [propKey, propVariant] : properties)
-    {
-        if (propKey == "HotPluggable")
-        {
-            const bool* hotPluggable = std::get_if<bool>(&propVariant);
-            if (hotPluggable == nullptr)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            asyncResp->res.jsonValue["HotPluggable"] = *hotPluggable;
-        }
-        else if (propKey == "LocationType")
-        {
-            const std::string* locationType =
-                std::get_if<std::string>(&propVariant);
-            if (locationType == nullptr)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            asyncResp->res
-                .jsonValue["Location"]["PartLocation"]["LocationType"] =
-                *locationType;
-        }
-        else if (propKey == "ServiceLabel")
-        {
-            const std::string* serviceLabel =
-                std::get_if<std::string>(&propVariant);
-            if (serviceLabel == nullptr)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            asyncResp->res
-                .jsonValue["Location"]["PartLocation"]["ServiceLabel"] =
-                *serviceLabel;
-        }
-        else if (propKey == "TachSensor")
-        {
-            const std::string* tachSensor =
-                std::get_if<std::string>(&propVariant);
-            if (tachSensor == nullptr)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            getFanSensorValue(asyncResp, chassisId, *tachSensor, "fan_tach");
-        }
-        else if (propKey == "PWMSensor")
-        {
-            const std::string* pwmSensor =
-                std::get_if<std::string>(&propVariant);
-            if (pwmSensor == nullptr)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            getFanSensorValue(asyncResp, chassisId, *pwmSensor, "fan_pwm");
-        }
-        else if (propKey == "SecondaryTachSensor")
-        {
-            const std::string* tachSensor =
-                std::get_if<std::string>(&propVariant);
-            if (tachSensor == nullptr)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            getFanSensorValue(asyncResp, chassisId, *tachSensor,
-                              "secondary_fan_tach");
-        }
-        else if (propKey == "SecondaryPWMSensor")
-        {
-            const std::string* pwmSensor =
-                std::get_if<std::string>(&propVariant);
-            if (pwmSensor == nullptr)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            getFanSensorValue(asyncResp, chassisId, *pwmSensor,
-                              "secondary_fan_pwm");
-        }
-    }
+  }
 }
 
-inline void
-    addFanProperties(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                     const std::string& fanObjectPath,
-                     const std::string& service, const std::string& chassisId)
-{
-    BMCWEB_LOG_DEBUG << "Get Properties for Fan " << fanObjectPath;
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    managedStore::GetManagedObjectStore()->getAllProperties(
-        service, fanObjectPath, "xyz.openbmc_project.Configuration.Fan",
-        context,
-        [asyncResp,
-         chassisId](const boost::system::error_code ec,
-                    const dbus::utility::DBusPropertiesMap& properties) {
+inline void addFanProperties(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& fanObjectPath, const std::string& service,
+    const std::string& chassisId) {
+  BMCWEB_LOG_DEBUG << "Get Properties for Fan " << fanObjectPath;
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  managedStore::GetManagedObjectStore()->getAllProperties(
+      service, fanObjectPath, "xyz.openbmc_project.Configuration.Fan", context,
+      [asyncResp, chassisId](
+          const boost::system::error_code ec,
+          const dbus::utility::DBusPropertiesMap& properties) {
         fillFanProperties(asyncResp, ec, properties, chassisId);
-    });
+      });
 }
 
-inline void
-    handleFanCollectionHead(App& app, const crow::Request& req,
-                            const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                            const std::string& chassisId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+inline void handleFanCollectionHead(
+    App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& chassisId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    redfish::chassis_utils::getValidChassisPath(
-        asyncResp, chassisId,
-        [asyncResp,
-         chassisId](const std::optional<std::string>& validChassisPath) {
-        if (!validChassisPath)
-        {
-            messages::resourceNotFound(asyncResp->res, "Chassis", chassisId);
-            return;
+  redfish::chassis_utils::getValidChassisPath(
+      asyncResp, chassisId,
+      [asyncResp,
+       chassisId](const std::optional<std::string>& validChassisPath) {
+        if (!validChassisPath) {
+          messages::resourceNotFound(asyncResp->res, "Chassis", chassisId);
+          return;
         }
-        asyncResp->res.addHeader(
-            boost::beast::http::field::link,
-            "</redfish/v1/JsonSchemas/FanCollection/FanCollection.json>; rel=describedby");
-    });
+        asyncResp->res.addHeader(boost::beast::http::field::link,
+                                 "</redfish/v1/JsonSchemas/FanCollection/"
+                                 "FanCollection.json>; rel=describedby");
+      });
 }
 
-inline void
-    handleFanCollectionGet(App& app, const crow::Request& req,
-                           const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                           const std::string& chassisId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+inline void handleFanCollectionGet(
+    App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& chassisId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    redfish::chassis_utils::getValidChassisPath(
-        asyncResp, chassisId,
-        std::bind_front(doFanCollection, asyncResp, chassisId));
+  redfish::chassis_utils::getValidChassisPath(
+      asyncResp, chassisId,
+      std::bind_front(doFanCollection, asyncResp, chassisId));
 }
 
-inline void requestRoutesFanCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Chassis/<str>/ThermalSubsystem/Fans/")
-        .privileges(redfish::privileges::headFanCollection)
-        .methods(boost::beast::http::verb::head)(
-            std::bind_front(handleFanCollectionHead, std::ref(app)));
+inline void requestRoutesFanCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Chassis/<str>/ThermalSubsystem/Fans/")
+      .privileges(redfish::privileges::headFanCollection)
+      .methods(boost::beast::http::verb::head)(
+          std::bind_front(handleFanCollectionHead, std::ref(app)));
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Chassis/<str>/ThermalSubsystem/Fans/")
-        .privileges(redfish::privileges::getFanCollection)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleFanCollectionGet, std::ref(app)));
+  BMCWEB_ROUTE(app, "/redfish/v1/Chassis/<str>/ThermalSubsystem/Fans/")
+      .privileges(redfish::privileges::getFanCollection)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleFanCollectionGet, std::ref(app)));
 }
 
 inline bool checkChassisId(const std::string& fanPath,
-                           const std::string& chassisId)
-{
-    return fanPath.find("/" + chassisId + "/") != std::string::npos;
+                           const std::string& chassisId) {
+  return fanPath.find("/" + chassisId + "/") != std::string::npos;
 }
 
-inline bool checkFanId(const std::string& fanPath, const std::string& fanId)
-{
-    std::string fanName = sdbusplus::message::object_path(fanPath).filename();
+inline bool checkFanId(const std::string& fanPath, const std::string& fanId) {
+  std::string fanName = sdbusplus::message::object_path(fanPath).filename();
 
-    return !(fanName.empty() || fanName != fanId);
+  return !(fanName.empty() || fanName != fanId);
 }
 
 static inline void handleFanPath(
@@ -503,35 +431,31 @@
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
     const dbus::utility::MapperGetSubTreePathsResponse& fanPaths,
     const std::function<void(const std::string& fanPath,
-                             const std::string& service)>& callback)
-{
-    for (const auto& fanPath : fanPaths)
-    {
-        if (!checkChassisId(fanPath, chassisId) || !checkFanId(fanPath, fanId))
-        {
-            continue;
-        }
+                             const std::string& service)>& callback) {
+  for (const auto& fanPath : fanPaths) {
+    if (!checkChassisId(fanPath, chassisId) || !checkFanId(fanPath, fanId)) {
+      continue;
+    }
 
-        managedStore::ManagedObjectStoreContext context(asyncResp);
-        dbus_utils::getDbusObject(
-            fanPath, fanInterfaces, context,
-            [fanPath, asyncResp,
-             callback](const boost::system::error_code& ec,
-                       const dbus::utility::MapperGetObject& object) {
-            if (ec || object.empty())
-            {
-                BMCWEB_LOG_ERROR << "DBUS response error on getDbusObject "
-                                 << ec.value();
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            callback(fanPath, object.begin()->first);
+    managedStore::ManagedObjectStoreContext context(asyncResp);
+    dbus_utils::getDbusObject(
+        fanPath, fanInterfaces, context,
+        [fanPath, asyncResp, callback](
+            const boost::system::error_code& ec,
+            const dbus::utility::MapperGetObject& object) {
+          if (ec || object.empty()) {
+            BMCWEB_LOG_ERROR << "DBUS response error on getDbusObject "
+                             << ec.value();
+            messages::internalError(asyncResp->res);
+            return;
+          }
+          callback(fanPath, object.begin()->first);
         });
 
-        return;
-    }
-    BMCWEB_LOG_WARNING << "Fan not found " << fanId;
-    messages::resourceNotFound(asyncResp->res, "Fan", fanId);
+    return;
+  }
+  BMCWEB_LOG_WARNING << "Fan not found " << fanId;
+  messages::resourceNotFound(asyncResp->res, "Fan", fanId);
 }
 
 inline void getValidFanPath(
@@ -539,103 +463,90 @@
     const std::string& validChassisPath, const std::string& chassisId,
     const std::string& fanId,
     const std::function<void(const std::string& fanPath,
-                             const std::string& service)>& callback)
-{
-    getFanPaths(
-        asyncResp, validChassisPath,
-        [chassisId, fanId, asyncResp, callback](
-            const dbus::utility::MapperGetSubTreePathsResponse& fanPaths) {
+                             const std::string& service)>& callback) {
+  getFanPaths(
+      asyncResp, validChassisPath,
+      [chassisId, fanId, asyncResp,
+       callback](const dbus::utility::MapperGetSubTreePathsResponse& fanPaths) {
         handleFanPath(chassisId, fanId, asyncResp, fanPaths, callback);
-    });
+      });
 }
 
 inline void addFanCommonProperties(crow::Response& resp,
                                    const std::string& chassisId,
-                                   const std::string& fanId)
-{
-    resp.addHeader(boost::beast::http::field::link,
-                   "</redfish/v1/JsonSchemas/Fan/Fan.json>; rel=describedby");
-    resp.jsonValue["@odata.type"] = "#Fan.v1_3_0.Fan";
-    resp.jsonValue["Name"] = fanId;
-    resp.jsonValue["Id"] = fanId;
-    resp.jsonValue["@odata.id"] = boost::urls::format(
-        "/redfish/v1/Chassis/{}/ThermalSubsystem/Fans/{}", chassisId, fanId);
-    resp.jsonValue["Status"]["State"] = "Enabled";
-    resp.jsonValue["Status"]["Health"] = "OK";
+                                   const std::string& fanId) {
+  resp.addHeader(boost::beast::http::field::link,
+                 "</redfish/v1/JsonSchemas/Fan/Fan.json>; rel=describedby");
+  resp.jsonValue["@odata.type"] = "#Fan.v1_3_0.Fan";
+  resp.jsonValue["Name"] = fanId;
+  resp.jsonValue["Id"] = fanId;
+  resp.jsonValue["@odata.id"] = boost::urls::format(
+      "/redfish/v1/Chassis/{}/ThermalSubsystem/Fans/{}", chassisId, fanId);
+  resp.jsonValue["Status"]["State"] = "Enabled";
+  resp.jsonValue["Status"]["Health"] = "OK";
 }
 
 inline void getFanHealth(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                         const std::string& fanPath, const std::string& service)
-{
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    dbus_utils::getProperty<bool>(
-        service, fanPath,
-        "xyz.openbmc_project.State.Decorator.OperationalStatus", "Functional",
-        context,
-        [asyncResp](const boost::system::error_code& ec, const bool value) {
-        if (ec)
-        {
-            if (ec.value() != EBADR)
-            {
-                BMCWEB_LOG_ERROR << "DBUS response error for Health "
-                                 << ec.value();
-                messages::internalError(asyncResp->res);
-            }
-            return;
+                         const std::string& fanPath,
+                         const std::string& service) {
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  dbus_utils::getProperty<bool>(
+      service, fanPath, "xyz.openbmc_project.State.Decorator.OperationalStatus",
+      "Functional", context,
+      [asyncResp](const boost::system::error_code& ec, const bool value) {
+        if (ec) {
+          if (ec.value() != EBADR) {
+            BMCWEB_LOG_ERROR << "DBUS response error for Health " << ec.value();
+            messages::internalError(asyncResp->res);
+          }
+          return;
         }
 
-        if (!value)
-        {
-            asyncResp->res.jsonValue["Status"]["Health"] = "Critical";
+        if (!value) {
+          asyncResp->res.jsonValue["Status"]["Health"] = "Critical";
         }
-    });
+      });
 }
 
 inline void getFanState(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                        const std::string& fanPath, const std::string& service)
-{
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    dbus_utils::getProperty<bool>(
-        service, fanPath, "xyz.openbmc_project.Inventory.Item", "Present",
-        context,
-        [asyncResp](const boost::system::error_code& ec, const bool value) {
-        if (ec)
-        {
-            if (ec.value() != EBADR)
-            {
-                BMCWEB_LOG_ERROR << "DBUS response error for State "
-                                 << ec.value();
-                messages::internalError(asyncResp->res);
-            }
-            return;
+                        const std::string& fanPath,
+                        const std::string& service) {
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  dbus_utils::getProperty<bool>(
+      service, fanPath, "xyz.openbmc_project.Inventory.Item", "Present",
+      context,
+      [asyncResp](const boost::system::error_code& ec, const bool value) {
+        if (ec) {
+          if (ec.value() != EBADR) {
+            BMCWEB_LOG_ERROR << "DBUS response error for State " << ec.value();
+            messages::internalError(asyncResp->res);
+          }
+          return;
         }
 
-        if (!value)
-        {
-            asyncResp->res.jsonValue["Status"]["State"] = "Absent";
+        if (!value) {
+          asyncResp->res.jsonValue["Status"]["State"] = "Absent";
         }
-    });
+      });
 }
 
 inline void getFanAsset(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                        const std::string& fanPath, const std::string& service)
-{
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    managedStore::GetManagedObjectStore()->getAllProperties(
-        service, fanPath, "xyz.openbmc_project.Inventory.Decorator.Asset",
-        context,
-        [fanPath, asyncResp{asyncResp}](
-            const boost::system::error_code& ec,
-            const dbus::utility::DBusPropertiesMap& assetList) {
-        if (ec)
-        {
-            if (ec.value() != EBADR)
-            {
-                BMCWEB_LOG_ERROR << "DBUS response error for Properties"
-                                 << ec.value();
-                messages::internalError(asyncResp->res);
-            }
-            return;
+                        const std::string& fanPath,
+                        const std::string& service) {
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  managedStore::GetManagedObjectStore()->getAllProperties(
+      service, fanPath, "xyz.openbmc_project.Inventory.Decorator.Asset",
+      context,
+      [fanPath, asyncResp{asyncResp}](
+          const boost::system::error_code& ec,
+          const dbus::utility::DBusPropertiesMap& assetList) {
+        if (ec) {
+          if (ec.value() != EBADR) {
+            BMCWEB_LOG_ERROR << "DBUS response error for Properties"
+                             << ec.value();
+            messages::internalError(asyncResp->res);
+          }
+          return;
         }
         const std::string* manufacturer = nullptr;
         const std::string* model = nullptr;
@@ -647,142 +558,127 @@
             dbus_utils::UnpackErrorPrinter(), assetList, "Manufacturer",
             manufacturer, "Model", model, "PartNumber", partNumber,
             "SerialNumber", serialNumber, "SparePartNumber", sparePartNumber);
-        if (!success)
-        {
-            messages::internalError(asyncResp->res);
-            return;
+        if (!success) {
+          messages::internalError(asyncResp->res);
+          return;
         }
-        if (manufacturer != nullptr)
-        {
-            asyncResp->res.jsonValue["Manufacturer"] = *manufacturer;
+        if (manufacturer != nullptr) {
+          asyncResp->res.jsonValue["Manufacturer"] = *manufacturer;
         }
-        if (model != nullptr)
-        {
-            asyncResp->res.jsonValue["Model"] = *model;
+        if (model != nullptr) {
+          asyncResp->res.jsonValue["Model"] = *model;
         }
-        if (partNumber != nullptr)
-        {
-            asyncResp->res.jsonValue["PartNumber"] = *partNumber;
+        if (partNumber != nullptr) {
+          asyncResp->res.jsonValue["PartNumber"] = *partNumber;
         }
-        if (serialNumber != nullptr)
-        {
-            asyncResp->res.jsonValue["SerialNumber"] = *serialNumber;
+        if (serialNumber != nullptr) {
+          asyncResp->res.jsonValue["SerialNumber"] = *serialNumber;
         }
-        if (sparePartNumber != nullptr && !sparePartNumber->empty())
-        {
-            asyncResp->res.jsonValue["SparePartNumber"] = *sparePartNumber;
+        if (sparePartNumber != nullptr && !sparePartNumber->empty()) {
+          asyncResp->res.jsonValue["SparePartNumber"] = *sparePartNumber;
         }
-    });
+      });
 }
 
 inline void getFanLocation(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
                            const std::string& fanPath,
-                           const std::string& service)
-{
-    managedStore::ManagedObjectStoreContext context(aResp);
-    dbus_utils::getProperty<std::string>(
-        service, fanPath,
-        "xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode",
-        context,
-        [aResp](const boost::system::error_code& ec,
-                const std::string& property) {
-        if (ec)
-        {
-            if (ec.value() != EBADR)
-            {
-                BMCWEB_LOG_ERROR << "DBUS response error for Location"
-                                 << ec.value();
-                messages::internalError(aResp->res);
-            }
-            return;
+                           const std::string& service) {
+  managedStore::ManagedObjectStoreContext context(aResp);
+  dbus_utils::getProperty<std::string>(
+      service, fanPath, "xyz.openbmc_project.Inventory.Decorator.LocationCode",
+      "LocationCode", context,
+      [aResp](const boost::system::error_code& ec,
+              const std::string& property) {
+        if (ec) {
+          if (ec.value() != EBADR) {
+            BMCWEB_LOG_ERROR << "DBUS response error for Location"
+                             << ec.value();
+            messages::internalError(aResp->res);
+          }
+          return;
         }
         aResp->res.jsonValue["Location"]["PartLocation"]["ServiceLabel"] =
             property;
-    });
+      });
 }
 
-inline void
-    afterGetValidFanPath(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                         const std::string& chassisId, const std::string& fanId,
-                         const std::string& fanPath, const std::string& service)
-{
-    addFanCommonProperties(asyncResp->res, chassisId, fanId);
-    getFanState(asyncResp, fanPath, service);
-    getFanHealth(asyncResp, fanPath, service);
-    getFanAsset(asyncResp, fanPath, service);
-    getFanLocation(asyncResp, fanPath, service);
-    addFanProperties(asyncResp, fanPath, service, chassisId);
+inline void afterGetValidFanPath(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& chassisId, const std::string& fanId,
+    const std::string& fanPath, const std::string& service) {
+  addFanCommonProperties(asyncResp->res, chassisId, fanId);
+  getFanState(asyncResp, fanPath, service);
+  getFanHealth(asyncResp, fanPath, service);
+  getFanAsset(asyncResp, fanPath, service);
+  getFanLocation(asyncResp, fanPath, service);
+  addFanProperties(asyncResp, fanPath, service, chassisId);
 }
 
 inline void doFanGet(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                      const std::string& chassisId, const std::string& fanId,
-                     const std::optional<std::string>& validChassisPath)
-{
-    if (!validChassisPath)
-    {
-        BMCWEB_LOG_ERROR << "Not a valid chassis ID" << chassisId;
-        messages::resourceNotFound(asyncResp->res, "Chassis", chassisId);
-        return;
-    }
+                     const std::optional<std::string>& validChassisPath) {
+  if (!validChassisPath) {
+    BMCWEB_LOG_ERROR << "Not a valid chassis ID" << chassisId;
+    messages::resourceNotFound(asyncResp->res, "Chassis", chassisId);
+    return;
+  }
 
-    getValidFanPath(
-        asyncResp, *validChassisPath, chassisId, fanId,
-        std::bind_front(afterGetValidFanPath, asyncResp, chassisId, fanId));
+  getValidFanPath(
+      asyncResp, *validChassisPath, chassisId, fanId,
+      std::bind_front(afterGetValidFanPath, asyncResp, chassisId, fanId));
 }
 
 inline void handleFanHead(App& app, const crow::Request& req,
                           const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                           const std::string& chassisId,
-                          const std::string& fanId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+                          const std::string& fanId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    redfish::chassis_utils::getValidChassisPath(
-        asyncResp, chassisId,
-        [asyncResp, chassisId,
-         fanId](const std::optional<std::string>& validChassisPath) {
-        if (!validChassisPath)
-        {
-            messages::resourceNotFound(asyncResp->res, "Chassis", chassisId);
-            return;
+  redfish::chassis_utils::getValidChassisPath(
+      asyncResp, chassisId,
+      [asyncResp, chassisId,
+       fanId](const std::optional<std::string>& validChassisPath) {
+        if (!validChassisPath) {
+          messages::resourceNotFound(asyncResp->res, "Chassis", chassisId);
+          return;
         }
-        getValidFanPath(asyncResp, *validChassisPath, chassisId, fanId,
-                        [asyncResp](const std::string&, const std::string&) {
-            asyncResp->res.addHeader(
-                boost::beast::http::field::link,
-                "</redfish/v1/JsonSchemas/Fan/Fan.json>; rel=describedby");
-        });
-    });
+        getValidFanPath(
+            asyncResp, *validChassisPath, chassisId, fanId,
+            [asyncResp](const std::string&, const std::string&) {
+              asyncResp->res.addHeader(
+                  boost::beast::http::field::link,
+                  "</redfish/v1/JsonSchemas/Fan/Fan.json>; rel=describedby");
+            });
+      });
 }
 
 inline void handleFanGet(App& app, const crow::Request& req,
                          const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                         const std::string& chassisId, const std::string& fanId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+                         const std::string& chassisId,
+                         const std::string& fanId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    redfish::chassis_utils::getValidChassisPath(
-        asyncResp, chassisId,
-        std::bind_front(doFanGet, asyncResp, chassisId, fanId));
+  redfish::chassis_utils::getValidChassisPath(
+      asyncResp, chassisId,
+      std::bind_front(doFanGet, asyncResp, chassisId, fanId));
 }
 
-inline void requestRoutesFan(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Chassis/<str>/ThermalSubsystem/Fans/<str>/")
-        .privileges(redfish::privileges::headFan)
-        .methods(boost::beast::http::verb::head)(
-            std::bind_front(handleFanHead, std::ref(app)));
+inline void requestRoutesFan(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Chassis/<str>/ThermalSubsystem/Fans/<str>/")
+      .privileges(redfish::privileges::headFan)
+      .methods(boost::beast::http::verb::head)(
+          std::bind_front(handleFanHead, std::ref(app)));
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Chassis/<str>/ThermalSubsystem/Fans/<str>/")
-        .privileges(redfish::privileges::getFan)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleFanGet, std::ref(app)));
+  BMCWEB_ROUTE(app, "/redfish/v1/Chassis/<str>/ThermalSubsystem/Fans/<str>/")
+      .privileges(redfish::privileges::getFan)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleFanGet, std::ref(app)));
 }
 
-} // namespace redfish
+}  // namespace redfish
+
+#endif  // THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_FAN_H_
diff --git a/redfish-core/lib/hypervisor_system.hpp b/redfish-core/lib/hypervisor_system.hpp
index 050c6a1..abdfadb 100644
--- a/redfish-core/lib/hypervisor_system.hpp
+++ b/redfish-core/lib/hypervisor_system.hpp
@@ -1,31 +1,41 @@
-#pragma once
+#ifndef THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_HYPERVISOR_SYSTEM_H_
+#define THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_HYPERVISOR_SYSTEM_H_
 
+#include <array>
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <optional>
+#include <string>
+#include <string_view>
+#include <utility>
+#include <variant>
+#include <vector>
+
+#include "boost/container/flat_set.hpp"  // NOLINT
 #include "app.hpp"
+#include "http_request.hpp"
+#include "logging.hpp"
+#include "utility.hpp"
+#include "async_resp.hpp"
 #include "dbus_utility.hpp"
 #include "error_messages.hpp"
-#include "ethernet.hpp"
-#include "managed_store.hpp"
-#include "managed_store_types.hpp"
 #include "query.hpp"
 #include "registries/privilege_registry.hpp"
 #include "dbus_utils.hpp"
 #include "ip_utils.hpp"
 #include "json_utils.hpp"
-
-#include <boost/container/flat_set.hpp>
-#include <sdbusplus/asio/property.hpp>
-
-#include <array>
-#include <optional>
-#include <string_view>
-#include <utility>
+#include "ethernet.hpp"
+#include <nlohmann/json.hpp>
+#include "managed_store.hpp"
+#include "managed_store_types.hpp"
+#include "sdbusplus/message/native_types.hpp"
 
 #ifdef UNIT_TEST_BUILD
-#include "test/g3/mock_managed_store.hpp" // NOLINT
+#include "test/g3/mock_managed_store.hpp"  // NOLINT
 #endif
 
-namespace redfish
-{
+namespace redfish {
 
 /**
  * @brief Retrieves hypervisor state properties over dbus
@@ -37,66 +47,57 @@
  *
  * @return None.
  */
-inline void getHypervisorState(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
-{
-    BMCWEB_LOG_DEBUG << "Get hypervisor state information.";
-    managedStore::ManagedObjectStoreContext requestContext(aResp);
-    dbus_utils::getProperty<std::string>(
-        "xyz.openbmc_project.State.Hypervisor",
-        "/xyz/openbmc_project/state/hypervisor0",
-        "xyz.openbmc_project.State.Host", "CurrentHostState", requestContext,
-        [aResp](const boost::system::error_code& ec,
-                const std::string& hostState) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
-            // This is an optional D-Bus object so just return if
-            // error occurs
-            return;
+inline void getHypervisorState(
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp) {
+  BMCWEB_LOG_DEBUG << "Get hypervisor state information.";
+  managedStore::ManagedObjectStoreContext requestContext(aResp);
+  dbus_utils::getProperty<std::string>(
+      "xyz.openbmc_project.State.Hypervisor",
+      "/xyz/openbmc_project/state/hypervisor0",
+      "xyz.openbmc_project.State.Host", "CurrentHostState", requestContext,
+      [aResp](const boost::system::error_code& ec,
+              const std::string& hostState) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+          // This is an optional D-Bus object so just return if
+          // error occurs
+          return;
         }
 
         BMCWEB_LOG_DEBUG << "Hypervisor state: " << hostState;
         // Verify Host State
-        if (hostState == "xyz.openbmc_project.State.Host.HostState.Running")
-        {
-            aResp->res.jsonValue["PowerState"] = "On";
-            aResp->res.jsonValue["Status"]["State"] = "Enabled";
+        if (hostState == "xyz.openbmc_project.State.Host.HostState.Running") {
+          aResp->res.jsonValue["PowerState"] = "On";
+          aResp->res.jsonValue["Status"]["State"] = "Enabled";
+        } else if (hostState ==
+                   "xyz.openbmc_project.State.Host.HostState."
+                   "Quiesced") {
+          aResp->res.jsonValue["PowerState"] = "On";
+          aResp->res.jsonValue["Status"]["State"] = "Quiesced";
+        } else if (hostState ==
+                   "xyz.openbmc_project.State.Host.HostState."
+                   "Standby") {
+          aResp->res.jsonValue["PowerState"] = "On";
+          aResp->res.jsonValue["Status"]["State"] = "StandbyOffline";
+        } else if (hostState ==
+                   "xyz.openbmc_project.State.Host.HostState."
+                   "TransitioningToRunning") {
+          aResp->res.jsonValue["PowerState"] = "PoweringOn";
+          aResp->res.jsonValue["Status"]["State"] = "Starting";
+        } else if (hostState ==
+                   "xyz.openbmc_project.State.Host.HostState."
+                   "TransitioningToOff") {
+          aResp->res.jsonValue["PowerState"] = "PoweringOff";
+          aResp->res.jsonValue["Status"]["State"] = "Enabled";
+        } else if (hostState ==
+                   "xyz.openbmc_project.State.Host.HostState.Off") {
+          aResp->res.jsonValue["PowerState"] = "Off";
+          aResp->res.jsonValue["Status"]["State"] = "Disabled";
+        } else {
+          messages::internalError(aResp->res);
+          return;
         }
-        else if (hostState == "xyz.openbmc_project.State.Host.HostState."
-                              "Quiesced")
-        {
-            aResp->res.jsonValue["PowerState"] = "On";
-            aResp->res.jsonValue["Status"]["State"] = "Quiesced";
-        }
-        else if (hostState == "xyz.openbmc_project.State.Host.HostState."
-                              "Standby")
-        {
-            aResp->res.jsonValue["PowerState"] = "On";
-            aResp->res.jsonValue["Status"]["State"] = "StandbyOffline";
-        }
-        else if (hostState == "xyz.openbmc_project.State.Host.HostState."
-                              "TransitioningToRunning")
-        {
-            aResp->res.jsonValue["PowerState"] = "PoweringOn";
-            aResp->res.jsonValue["Status"]["State"] = "Starting";
-        }
-        else if (hostState == "xyz.openbmc_project.State.Host.HostState."
-                              "TransitioningToOff")
-        {
-            aResp->res.jsonValue["PowerState"] = "PoweringOff";
-            aResp->res.jsonValue["Status"]["State"] = "Enabled";
-        }
-        else if (hostState == "xyz.openbmc_project.State.Host.HostState.Off")
-        {
-            aResp->res.jsonValue["PowerState"] = "Off";
-            aResp->res.jsonValue["Status"]["State"] = "Disabled";
-        }
-        else
-        {
-            messages::internalError(aResp->res);
-            return;
-        }
-        });
+      });
 }
 
 /**
@@ -109,40 +110,36 @@
  *
  * @return None.
  */
-inline void
-    getHypervisorActions(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
-{
-    BMCWEB_LOG_DEBUG << "Get hypervisor actions.";
-    constexpr std::array<std::string_view, 1> interfaces = {
-        "xyz.openbmc_project.State.Host"};
-    managedStore::ManagedObjectStoreContext requestContext(aResp);
-    managedStore::GetManagedObjectStore()->getDbusObject(
-        "/xyz/openbmc_project/state/hypervisor0", interfaces, requestContext,
-        [aResp](
-            const boost::system::error_code& ec,
-            const std::vector<std::pair<std::string, std::vector<std::string>>>&
-                objInfo) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
-            // This is an optional D-Bus object so just return if
-            // error occurs
-            return;
+inline void getHypervisorActions(
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp) {
+  BMCWEB_LOG_DEBUG << "Get hypervisor actions.";
+  constexpr std::array<std::string_view, 1> interfaces = {
+      "xyz.openbmc_project.State.Host"};
+  managedStore::ManagedObjectStoreContext requestContext(aResp);
+  managedStore::GetManagedObjectStore()->getDbusObject(
+      "/xyz/openbmc_project/state/hypervisor0", interfaces, requestContext,
+      [aResp](
+          const boost::system::error_code& ec,
+          const std::vector<std::pair<std::string, std::vector<std::string>>>&
+              objInfo) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+          // This is an optional D-Bus object so just return if
+          // error occurs
+          return;
         }
 
-        if (objInfo.empty())
-        {
-            // As noted above, this is an optional interface so just return
-            // if there is no instance found
-            return;
+        if (objInfo.empty()) {
+          // As noted above, this is an optional interface so just return
+          // if there is no instance found
+          return;
         }
 
-        if (objInfo.size() > 1)
-        {
-            // More then one hypervisor object is not supported and is an
-            // error
-            messages::internalError(aResp->res);
-            return;
+        if (objInfo.size() > 1) {
+          // More then one hypervisor object is not supported and is an
+          // error
+          messages::internalError(aResp->res);
+          return;
         }
 
         // Object present so system support limited ComputerSystem Action
@@ -152,164 +149,119 @@
             "/redfish/v1/Systems/hypervisor/Actions/ComputerSystem.Reset";
         reset["@Redfish.ActionInfo"] =
             "/redfish/v1/Systems/hypervisor/ResetActionInfo";
-    });
+      });
 }
 
 inline bool extractHypervisorInterfaceData(
     const std::string& ethIfaceId,
     const dbus::utility::ManagedObjectType& dbusData,
     EthernetInterfaceData& ethData,
-    boost::container::flat_set<IPv4AddressData>& ipv4Config)
-{
-    bool idFound = false;
-    for (const auto& objpath : dbusData)
-    {
-        for (const auto& ifacePair : objpath.second)
-        {
-            if (objpath.first ==
-                "/xyz/openbmc_project/network/hypervisor/" + ethIfaceId)
-            {
-                idFound = true;
-                if (ifacePair.first == "xyz.openbmc_project.Network.MACAddress")
-                {
-                    for (const auto& propertyPair : ifacePair.second)
-                    {
-                        if (propertyPair.first == "MACAddress")
-                        {
-                            const std::string* mac =
-                                std::get_if<std::string>(&propertyPair.second);
-                            if (mac != nullptr)
-                            {
-                                ethData.macAddress = *mac;
-                            }
-                        }
-                    }
-                }
-                else if (ifacePair.first ==
-                         "xyz.openbmc_project.Network.EthernetInterface")
-                {
-                    for (const auto& propertyPair : ifacePair.second)
-                    {
-                        if (propertyPair.first == "DHCPEnabled")
-                        {
-                            const std::string* dhcp =
-                                std::get_if<std::string>(&propertyPair.second);
-                            if (dhcp != nullptr)
-                            {
-                                ethData.dhcpEnabled = *dhcp;
-                                break; // Interested on only "DHCPEnabled".
-                                       // Stop parsing since we got the
-                                       // "DHCPEnabled" value.
-                            }
-                        }
-                    }
-                }
+    boost::container::flat_set<IPv4AddressData>& ipv4Config) {
+  bool idFound = false;
+  for (const auto& objpath : dbusData) {
+    for (const auto& ifacePair : objpath.second) {
+      if (objpath.first ==
+          "/xyz/openbmc_project/network/hypervisor/" + ethIfaceId) {
+        idFound = true;
+        if (ifacePair.first == "xyz.openbmc_project.Network.MACAddress") {
+          for (const auto& propertyPair : ifacePair.second) {
+            if (propertyPair.first == "MACAddress") {
+              const std::string* mac =
+                  std::get_if<std::string>(&propertyPair.second);
+              if (mac != nullptr) {
+                ethData.macAddress = *mac;
+              }
             }
-            if (objpath.first == "/xyz/openbmc_project/network/hypervisor/" +
-                                     ethIfaceId + "/ipv4/addr0")
-            {
-                std::pair<boost::container::flat_set<IPv4AddressData>::iterator,
-                          bool>
-                    it = ipv4Config.insert(IPv4AddressData{});
-                IPv4AddressData& ipv4Address = *it.first;
-                if (ifacePair.first == "xyz.openbmc_project.Object.Enable")
-                {
-                    for (const auto& property : ifacePair.second)
-                    {
-                        if (property.first == "Enabled")
-                        {
-                            const bool* intfEnable =
-                                std::get_if<bool>(&property.second);
-                            if (intfEnable != nullptr)
-                            {
-                                ipv4Address.isActive = *intfEnable;
-                                break;
-                            }
-                        }
-                    }
-                }
-                if (ifacePair.first == "xyz.openbmc_project.Network.IP")
-                {
-                    for (const auto& property : ifacePair.second)
-                    {
-                        if (property.first == "Address")
-                        {
-                            const std::string* address =
-                                std::get_if<std::string>(&property.second);
-                            if (address != nullptr)
-                            {
-                                ipv4Address.address = *address;
-                            }
-                        }
-                        else if (property.first == "Origin")
-                        {
-                            const std::string* origin =
-                                std::get_if<std::string>(&property.second);
-                            if (origin != nullptr)
-                            {
-                                ipv4Address.origin =
-                                    translateAddressOriginDbusToRedfish(*origin,
-                                                                        true);
-                            }
-                        }
-                        else if (property.first == "PrefixLength")
-                        {
-                            const uint8_t* mask =
-                                std::get_if<uint8_t>(&property.second);
-                            if (mask != nullptr)
-                            {
-                                // convert it to the string
-                                ipv4Address.netmask = getNetmask(*mask);
-                            }
-                        }
-                        else if (property.first == "Type" ||
-                                 property.first == "Gateway")
-                        {
-                            // Type & Gateway is not used
-                            continue;
-                        }
-                        else
-                        {
-                            BMCWEB_LOG_ERROR
-                                << "Got extra property: " << property.first
-                                << " on the " << objpath.first.str << " object";
-                        }
-                    }
-                }
+          }
+        } else if (ifacePair.first ==
+                   "xyz.openbmc_project.Network.EthernetInterface") {
+          for (const auto& propertyPair : ifacePair.second) {
+            if (propertyPair.first == "DHCPEnabled") {
+              const std::string* dhcp =
+                  std::get_if<std::string>(&propertyPair.second);
+              if (dhcp != nullptr) {
+                ethData.dhcpEnabled = *dhcp;
+                break;  // Interested on only "DHCPEnabled".
+                        // Stop parsing since we got the
+                        // "DHCPEnabled" value.
+              }
             }
-            if (objpath.first == "/xyz/openbmc_project/network/hypervisor")
-            {
-                // System configuration shows up in the global namespace, so no
-                // need to check eth number
-                if (ifacePair.first ==
-                    "xyz.openbmc_project.Network.SystemConfiguration")
-                {
-                    for (const auto& propertyPair : ifacePair.second)
-                    {
-                        if (propertyPair.first == "HostName")
-                        {
-                            const std::string* hostName =
-                                std::get_if<std::string>(&propertyPair.second);
-                            if (hostName != nullptr)
-                            {
-                                ethData.hostName = *hostName;
-                            }
-                        }
-                        else if (propertyPair.first == "DefaultGateway")
-                        {
-                            const std::string* defaultGateway =
-                                std::get_if<std::string>(&propertyPair.second);
-                            if (defaultGateway != nullptr)
-                            {
-                                ethData.defaultGateway = *defaultGateway;
-                            }
-                        }
-                    }
-                }
-            }
+          }
         }
+      }
+      if (objpath.first == "/xyz/openbmc_project/network/hypervisor/" +
+                               ethIfaceId + "/ipv4/addr0") {
+        std::pair<boost::container::flat_set<IPv4AddressData>::iterator, bool>
+            it = ipv4Config.insert(IPv4AddressData{});
+        IPv4AddressData& ipv4Address = *it.first;
+        if (ifacePair.first == "xyz.openbmc_project.Object.Enable") {
+          for (const auto& property : ifacePair.second) {
+            if (property.first == "Enabled") {
+              const bool* intfEnable = std::get_if<bool>(&property.second);
+              if (intfEnable != nullptr) {
+                ipv4Address.isActive = *intfEnable;
+                break;
+              }
+            }
+          }
+        }
+        if (ifacePair.first == "xyz.openbmc_project.Network.IP") {
+          for (const auto& property : ifacePair.second) {
+            if (property.first == "Address") {
+              const std::string* address =
+                  std::get_if<std::string>(&property.second);
+              if (address != nullptr) {
+                ipv4Address.address = *address;
+              }
+            } else if (property.first == "Origin") {
+              const std::string* origin =
+                  std::get_if<std::string>(&property.second);
+              if (origin != nullptr) {
+                ipv4Address.origin =
+                    translateAddressOriginDbusToRedfish(*origin, true);
+              }
+            } else if (property.first == "PrefixLength") {
+              const uint8_t* mask = std::get_if<uint8_t>(&property.second);
+              if (mask != nullptr) {
+                // convert it to the string
+                ipv4Address.netmask = getNetmask(*mask);
+              }
+            } else if (property.first == "Type" ||
+                       property.first == "Gateway") {
+              // Type & Gateway is not used
+              continue;
+            } else {
+              BMCWEB_LOG_ERROR << "Got extra property: " << property.first
+                               << " on the " << objpath.first.str << " object";
+            }
+          }
+        }
+      }
+      if (objpath.first == "/xyz/openbmc_project/network/hypervisor") {
+        // System configuration shows up in the global namespace, so no
+        // need to check eth number
+        if (ifacePair.first ==
+            "xyz.openbmc_project.Network.SystemConfiguration") {
+          for (const auto& propertyPair : ifacePair.second) {
+            if (propertyPair.first == "HostName") {
+              const std::string* hostName =
+                  std::get_if<std::string>(&propertyPair.second);
+              if (hostName != nullptr) {
+                ethData.hostName = *hostName;
+              }
+            } else if (propertyPair.first == "DefaultGateway") {
+              const std::string* defaultGateway =
+                  std::get_if<std::string>(&propertyPair.second);
+              if (defaultGateway != nullptr) {
+                ethData.defaultGateway = *defaultGateway;
+              }
+            }
+          }
+        }
+      }
     }
-    return idFound;
+  }
+  return idFound;
 }
 /**
  * Function that retrieves all properties for given Hypervisor Ethernet
@@ -322,30 +274,27 @@
 void getHypervisorIfaceData(
     const std::string& ethIfaceId,
     const managedStore::ManagedObjectStoreContext& context,
-    CallbackFunc&& callback)
-{
-    managedStore::GetManagedObjectStore()->getManagedObjectsWithContext(
-        "xyz.openbmc_project.Settings", {"/"}, context,
-        [ethIfaceId{std::string{ethIfaceId}},
-         callback{std::forward<CallbackFunc>(callback)}](
-            const boost::system::error_code& error,
-            const dbus::utility::ManagedObjectType& resp) {
+    CallbackFunc&& callback) {
+  managedStore::GetManagedObjectStore()->getManagedObjectsWithContext(
+      "xyz.openbmc_project.Settings", {"/"}, context,
+      [ethIfaceId{std::string{ethIfaceId}},
+       callback{std::forward<CallbackFunc>(callback)}](
+          const boost::system::error_code& error,
+          const dbus::utility::ManagedObjectType& resp) {
         EthernetInterfaceData ethData{};
         boost::container::flat_set<IPv4AddressData> ipv4Data;
-        if (error)
-        {
-            callback(false, ethData, ipv4Data);
-            return;
+        if (error) {
+          callback(false, ethData, ipv4Data);
+          return;
         }
 
         bool found =
             extractHypervisorInterfaceData(ethIfaceId, resp, ethData, ipv4Data);
-        if (!found)
-        {
-            BMCWEB_LOG_INFO << "Hypervisor Interface not found";
+        if (!found) {
+          BMCWEB_LOG_INFO << "Hypervisor Interface not found";
         }
         callback(found, ethData, ipv4Data);
-        });
+      });
 }
 
 /**
@@ -357,28 +306,25 @@
  *
  * @return None.
  */
-inline void
-    setHypervisorIPv4Address(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                             const std::string& ethIfaceId,
-                             const std::string& ipv4Address)
-{
-    BMCWEB_LOG_DEBUG << "Setting the Hypervisor IPaddress : " << ipv4Address
-                     << " on Iface: " << ethIfaceId;
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        aResp->strand_,
-        [aResp](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "DBUS response error " << ec;
-            return;
+inline void setHypervisorIPv4Address(
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+    const std::string& ethIfaceId, const std::string& ipv4Address) {
+  BMCWEB_LOG_DEBUG << "Setting the Hypervisor IPaddress : " << ipv4Address
+                   << " on Iface: " << ethIfaceId;
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      aResp->strand_,
+      [aResp](const boost::system::error_code& ec) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "DBUS response error " << ec;
+          return;
         }
         BMCWEB_LOG_DEBUG << "Hypervisor IPaddress is Set";
-        },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/network/hypervisor/" + ethIfaceId + "/ipv4/addr0",
-        "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Network.IP", "Address",
-        dbus::utility::DbusVariantType(ipv4Address));
+      },
+      "xyz.openbmc_project.Settings",
+      "/xyz/openbmc_project/network/hypervisor/" + ethIfaceId + "/ipv4/addr0",
+      "org.freedesktop.DBus.Properties", "Set",
+      "xyz.openbmc_project.Network.IP", "Address",
+      dbus::utility::DbusVariantType(ipv4Address));
 }
 
 /**
@@ -390,28 +336,26 @@
  *
  * @return None.
  */
-inline void
-    setHypervisorIPv4Subnet(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                            const std::string& ethIfaceId, const uint8_t subnet)
-{
-    BMCWEB_LOG_DEBUG << "Setting the Hypervisor subnet : " << subnet
-                     << " on Iface: " << ethIfaceId;
+inline void setHypervisorIPv4Subnet(
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+    const std::string& ethIfaceId, const uint8_t subnet) {
+  BMCWEB_LOG_DEBUG << "Setting the Hypervisor subnet : " << subnet
+                   << " on Iface: " << ethIfaceId;
 
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        aResp->strand_,
-        [aResp](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "DBUS response error " << ec;
-            return;
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      aResp->strand_,
+      [aResp](const boost::system::error_code& ec) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "DBUS response error " << ec;
+          return;
         }
         BMCWEB_LOG_DEBUG << "SubnetMask is Set";
-        },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/network/hypervisor/" + ethIfaceId + "/ipv4/addr0",
-        "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Network.IP", "PrefixLength",
-        dbus::utility::DbusVariantType(subnet));
+      },
+      "xyz.openbmc_project.Settings",
+      "/xyz/openbmc_project/network/hypervisor/" + ethIfaceId + "/ipv4/addr0",
+      "org.freedesktop.DBus.Properties", "Set",
+      "xyz.openbmc_project.Network.IP", "PrefixLength",
+      dbus::utility::DbusVariantType(subnet));
 }
 
 /**
@@ -423,28 +367,25 @@
  *
  * @return None.
  */
-inline void
-    setHypervisorIPv4Gateway(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                             const std::string& gateway)
-{
-    BMCWEB_LOG_DEBUG
-        << "Setting the DefaultGateway to the last configured gateway";
+inline void setHypervisorIPv4Gateway(
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+    const std::string& gateway) {
+  BMCWEB_LOG_DEBUG
+      << "Setting the DefaultGateway to the last configured gateway";
 
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        aResp->strand_,
-        [aResp](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "DBUS response error " << ec;
-            return;
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      aResp->strand_,
+      [aResp](const boost::system::error_code& ec) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "DBUS response error " << ec;
+          return;
         }
         BMCWEB_LOG_DEBUG << "Default Gateway is Set";
-        },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/network/hypervisor",
-        "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Network.SystemConfiguration", "DefaultGateway",
-        dbus::utility::DbusVariantType(gateway));
+      },
+      "xyz.openbmc_project.Settings", "/xyz/openbmc_project/network/hypervisor",
+      "org.freedesktop.DBus.Properties", "Set",
+      "xyz.openbmc_project.Network.SystemConfiguration", "DefaultGateway",
+      dbus::utility::DbusVariantType(gateway));
 }
 
 /**
@@ -458,14 +399,13 @@
  *
  * @return None
  */
-inline void
-    createHypervisorIPv4(const std::string& ifaceId, uint8_t prefixLength,
-                         const std::string& gateway, const std::string& address,
-                         const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    setHypervisorIPv4Address(asyncResp, ifaceId, address);
-    setHypervisorIPv4Gateway(asyncResp, gateway);
-    setHypervisorIPv4Subnet(asyncResp, ifaceId, prefixLength);
+inline void createHypervisorIPv4(
+    const std::string& ifaceId, uint8_t prefixLength,
+    const std::string& gateway, const std::string& address,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  setHypervisorIPv4Address(asyncResp, ifaceId, address);
+  setHypervisorIPv4Gateway(asyncResp, gateway);
+  setHypervisorIPv4Subnet(asyncResp, ifaceId, prefixLength);
 }
 
 /**
@@ -476,337 +416,286 @@
  *
  * @return None
  */
-inline void
-    deleteHypervisorIPv4(const std::string& ifaceId,
-                         const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    std::string address = "0.0.0.0";
-    std::string gateway = "0.0.0.0";
-    const uint8_t prefixLength = 0;
-    setHypervisorIPv4Address(asyncResp, ifaceId, address);
-    setHypervisorIPv4Gateway(asyncResp, gateway);
-    setHypervisorIPv4Subnet(asyncResp, ifaceId, prefixLength);
+inline void deleteHypervisorIPv4(
+    const std::string& ifaceId,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  std::string address = "0.0.0.0";
+  std::string gateway = "0.0.0.0";
+  const uint8_t prefixLength = 0;
+  setHypervisorIPv4Address(asyncResp, ifaceId, address);
+  setHypervisorIPv4Gateway(asyncResp, gateway);
+  setHypervisorIPv4Subnet(asyncResp, ifaceId, prefixLength);
 }
 
 inline void parseInterfaceData(
     nlohmann::json& jsonResponse, const std::string& ifaceId,
     const EthernetInterfaceData& ethData,
-    const boost::container::flat_set<IPv4AddressData>& ipv4Data)
-{
-    jsonResponse["Id"] = ifaceId;
-    jsonResponse["@odata.id"] =
-        crow::utility::urlFromPieces("redfish", "v1", "Systems", "hypervisor",
-                                     "EthernetInterfaces", ifaceId);
-    jsonResponse["InterfaceEnabled"] = true;
-    jsonResponse["MACAddress"] = ethData.macAddress;
+    const boost::container::flat_set<IPv4AddressData>& ipv4Data) {
+  jsonResponse["Id"] = ifaceId;
+  jsonResponse["@odata.id"] = crow::utility::urlFromPieces(
+      "redfish", "v1", "Systems", "hypervisor", "EthernetInterfaces", ifaceId);
+  jsonResponse["InterfaceEnabled"] = true;
+  jsonResponse["MACAddress"] = ethData.macAddress;
 
-    jsonResponse["HostName"] = ethData.hostName;
-    jsonResponse["DHCPv4"]["DHCPEnabled"] =
-        translateDhcpEnabledToBool(ethData.dhcpEnabled, true);
+  jsonResponse["HostName"] = ethData.hostName;
+  jsonResponse["DHCPv4"]["DHCPEnabled"] =
+      translateDhcpEnabledToBool(ethData.dhcpEnabled, true);
 
-    nlohmann::json& ipv4Array = jsonResponse["IPv4Addresses"];
-    nlohmann::json& ipv4StaticArray = jsonResponse["IPv4StaticAddresses"];
-    ipv4Array = nlohmann::json::array();
-    ipv4StaticArray = nlohmann::json::array();
-    for (const auto& ipv4Config : ipv4Data)
-    {
-        if (ipv4Config.isActive)
-        {
-            nlohmann::json::object_t ipv4;
-            ipv4["AddressOrigin"] = ipv4Config.origin;
-            ipv4["SubnetMask"] = ipv4Config.netmask;
-            ipv4["Address"] = ipv4Config.address;
-            ipv4["Gateway"] = ethData.defaultGateway;
+  nlohmann::json& ipv4Array = jsonResponse["IPv4Addresses"];
+  nlohmann::json& ipv4StaticArray = jsonResponse["IPv4StaticAddresses"];
+  ipv4Array = nlohmann::json::array();
+  ipv4StaticArray = nlohmann::json::array();
+  for (const auto& ipv4Config : ipv4Data) {
+    if (ipv4Config.isActive) {
+      nlohmann::json::object_t ipv4;
+      ipv4["AddressOrigin"] = ipv4Config.origin;
+      ipv4["SubnetMask"] = ipv4Config.netmask;
+      ipv4["Address"] = ipv4Config.address;
+      ipv4["Gateway"] = ethData.defaultGateway;
 
-            if (ipv4Config.origin == "Static")
-            {
-                ipv4StaticArray.emplace_back(ipv4);
-            }
-            ipv4Array.emplace_back(std::move(ipv4));
-        }
+      if (ipv4Config.origin == "Static") {
+        ipv4StaticArray.emplace_back(ipv4);
+      }
+      ipv4Array.emplace_back(std::move(ipv4));
     }
+  }
 }
 
-inline void setDHCPEnabled(const std::string& ifaceId,
-                           const bool& ipv4DHCPEnabled,
-                           const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    const std::string dhcp = getDhcpEnabledEnumeration(ipv4DHCPEnabled, false);
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec;
-            messages::internalError(asyncResp->res);
-            return;
+inline void setDHCPEnabled(
+    const std::string& ifaceId, const bool& ipv4DHCPEnabled,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  const std::string dhcp = getDhcpEnabledEnumeration(ipv4DHCPEnabled, false);
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp](const boost::system::error_code& ec) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
-        },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/network/hypervisor/" + ifaceId,
-        "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Network.EthernetInterface", "DHCPEnabled",
-        dbus::utility::DbusVariantType{dhcp});
+      },
+      "xyz.openbmc_project.Settings",
+      "/xyz/openbmc_project/network/hypervisor/" + ifaceId,
+      "org.freedesktop.DBus.Properties", "Set",
+      "xyz.openbmc_project.Network.EthernetInterface", "DHCPEnabled",
+      dbus::utility::DbusVariantType{dhcp});
 
-    // Set the IPv4 address origin to the DHCP / Static as per the new value
-    // of the DHCPEnabled property
-    std::string origin;
-    if (!ipv4DHCPEnabled)
-    {
-        origin = "xyz.openbmc_project.Network.IP.AddressOrigin.Static";
-    }
-    else
-    {
-        // DHCPEnabled is set to true. Delete the current IPv4 settings
-        // to receive the new values from DHCP server.
-        deleteHypervisorIPv4(ifaceId, asyncResp);
-        origin = "xyz.openbmc_project.Network.IP.AddressOrigin.DHCP";
-    }
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "DBUS response error " << ec;
-            messages::internalError(asyncResp->res);
-            return;
+  // Set the IPv4 address origin to the DHCP / Static as per the new value
+  // of the DHCPEnabled property
+  std::string origin;
+  if (!ipv4DHCPEnabled) {
+    origin = "xyz.openbmc_project.Network.IP.AddressOrigin.Static";
+  } else {
+    // DHCPEnabled is set to true. Delete the current IPv4 settings
+    // to receive the new values from DHCP server.
+    deleteHypervisorIPv4(ifaceId, asyncResp);
+    origin = "xyz.openbmc_project.Network.IP.AddressOrigin.DHCP";
+  }
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp](const boost::system::error_code& ec) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "DBUS response error " << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
         BMCWEB_LOG_DEBUG << "Hypervisor IPaddress Origin is Set";
-        },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/network/hypervisor/" + ifaceId + "/ipv4/addr0",
-        "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Network.IP", "Origin",
-        dbus::utility::DbusVariantType(origin));
+      },
+      "xyz.openbmc_project.Settings",
+      "/xyz/openbmc_project/network/hypervisor/" + ifaceId + "/ipv4/addr0",
+      "org.freedesktop.DBus.Properties", "Set",
+      "xyz.openbmc_project.Network.IP", "Origin",
+      dbus::utility::DbusVariantType(origin));
 }
 
 inline void handleHypervisorIPv4StaticPatch(
     const std::string& ifaceId, const nlohmann::json& input,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if ((!input.is_array()) || input.empty())
-    {
-        messages::propertyValueTypeError(asyncResp->res, input.dump(),
-                                         "IPv4StaticAddresses");
-        return;
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if ((!input.is_array()) || input.empty()) {
+    messages::propertyValueTypeError(asyncResp->res, input.dump(),
+                                     "IPv4StaticAddresses");
+    return;
+  }
+
+  // Hypervisor considers the first IP address in the array list
+  // as the Hypervisor's virtual management interface supports single IPv4
+  // address
+  const nlohmann::json& thisJson = input[0];
+
+  if (!thisJson.is_null() && !thisJson.empty()) {
+    // For the error string
+    std::string pathString = "IPv4StaticAddresses/1";
+    std::optional<std::string> address;
+    std::optional<std::string> subnetMask;
+    std::optional<std::string> gateway;
+    nlohmann::json thisJsonCopy = thisJson;
+    if (!json_util::readJson(thisJsonCopy, asyncResp->res, "Address", address,
+                             "SubnetMask", subnetMask, "Gateway", gateway)) {
+      messages::propertyValueFormatError(
+          asyncResp->res,
+          thisJson.dump(2, ' ', true, nlohmann::json::error_handler_t::replace),
+          pathString);
+      return;
     }
 
-    // Hypervisor considers the first IP address in the array list
-    // as the Hypervisor's virtual management interface supports single IPv4
-    // address
-    const nlohmann::json& thisJson = input[0];
-
-    if (!thisJson.is_null() && !thisJson.empty())
-    {
-        // For the error string
-        std::string pathString = "IPv4StaticAddresses/1";
-        std::optional<std::string> address;
-        std::optional<std::string> subnetMask;
-        std::optional<std::string> gateway;
-        nlohmann::json thisJsonCopy = thisJson;
-        if (!json_util::readJson(thisJsonCopy, asyncResp->res, "Address",
-                                 address, "SubnetMask", subnetMask, "Gateway",
-                                 gateway))
-        {
-            messages::propertyValueFormatError(
-                asyncResp->res,
-                thisJson.dump(2, ' ', true,
-                              nlohmann::json::error_handler_t::replace),
-                pathString);
-            return;
-        }
-
-        uint8_t prefixLength = 0;
-        bool errorInEntry = false;
-        if (address)
-        {
-            if (!ip_util::ipv4VerifyIpAndGetBitcount(*address))
-            {
-                messages::propertyValueFormatError(asyncResp->res, *address,
-                                                   pathString + "/Address");
-                errorInEntry = true;
-            }
-        }
-        else
-        {
-            messages::propertyMissing(asyncResp->res, pathString + "/Address");
-            errorInEntry = true;
-        }
-
-        if (subnetMask)
-        {
-            if (!ip_util::ipv4VerifyIpAndGetBitcount(*subnetMask,
-                                                     &prefixLength))
-            {
-                messages::propertyValueFormatError(asyncResp->res, *subnetMask,
-                                                   pathString + "/SubnetMask");
-                errorInEntry = true;
-            }
-        }
-        else
-        {
-            messages::propertyMissing(asyncResp->res,
-                                      pathString + "/SubnetMask");
-            errorInEntry = true;
-        }
-
-        if (gateway)
-        {
-            if (!ip_util::ipv4VerifyIpAndGetBitcount(*gateway))
-            {
-                messages::propertyValueFormatError(asyncResp->res, *gateway,
-                                                   pathString + "/Gateway");
-                errorInEntry = true;
-            }
-        }
-        else
-        {
-            messages::propertyMissing(asyncResp->res, pathString + "/Gateway");
-            errorInEntry = true;
-        }
-
-        if (errorInEntry)
-        {
-            return;
-        }
-
-        BMCWEB_LOG_DEBUG << "Calling createHypervisorIPv4 on : " << ifaceId
-                         << "," << *address;
-        createHypervisorIPv4(ifaceId, prefixLength, *gateway, *address,
-                             asyncResp);
-        // Set the DHCPEnabled to false since the Static IPv4 is set
-        setDHCPEnabled(ifaceId, false, asyncResp);
+    uint8_t prefixLength = 0;
+    bool errorInEntry = false;
+    if (address) {
+      if (!ip_util::ipv4VerifyIpAndGetBitcount(*address)) {
+        messages::propertyValueFormatError(asyncResp->res, *address,
+                                           pathString + "/Address");
+        errorInEntry = true;
+      }
+    } else {
+      messages::propertyMissing(asyncResp->res, pathString + "/Address");
+      errorInEntry = true;
     }
-    else
-    {
-        if (thisJson.is_null())
-        {
-            deleteHypervisorIPv4(ifaceId, asyncResp);
-        }
+
+    if (subnetMask) {
+      if (!ip_util::ipv4VerifyIpAndGetBitcount(*subnetMask, &prefixLength)) {
+        messages::propertyValueFormatError(asyncResp->res, *subnetMask,
+                                           pathString + "/SubnetMask");
+        errorInEntry = true;
+      }
+    } else {
+      messages::propertyMissing(asyncResp->res, pathString + "/SubnetMask");
+      errorInEntry = true;
     }
+
+    if (gateway) {
+      if (!ip_util::ipv4VerifyIpAndGetBitcount(*gateway)) {
+        messages::propertyValueFormatError(asyncResp->res, *gateway,
+                                           pathString + "/Gateway");
+        errorInEntry = true;
+      }
+    } else {
+      messages::propertyMissing(asyncResp->res, pathString + "/Gateway");
+      errorInEntry = true;
+    }
+
+    if (errorInEntry) {
+      return;
+    }
+
+    BMCWEB_LOG_DEBUG << "Calling createHypervisorIPv4 on : " << ifaceId << ","
+                     << *address;
+    createHypervisorIPv4(ifaceId, prefixLength, *gateway, *address, asyncResp);
+    // Set the DHCPEnabled to false since the Static IPv4 is set
+    setDHCPEnabled(ifaceId, false, asyncResp);
+  } else {
+    if (thisJson.is_null()) {
+      deleteHypervisorIPv4(ifaceId, asyncResp);
+    }
+  }
 }
 
 inline void handleHypervisorHostnamePatch(
     const std::string& hostName,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!isHostnameValid(hostName))
-    {
-        messages::propertyValueFormatError(asyncResp->res, hostName,
-                                           "HostName");
-        return;
-    }
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!isHostnameValid(hostName)) {
+    messages::propertyValueFormatError(asyncResp->res, hostName, "HostName");
+    return;
+  }
 
-    asyncResp->res.jsonValue["HostName"] = hostName;
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            messages::internalError(asyncResp->res);
+  asyncResp->res.jsonValue["HostName"] = hostName;
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp](const boost::system::error_code& ec) {
+        if (ec) {
+          messages::internalError(asyncResp->res);
         }
-        },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/network/hypervisor",
-        "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Network.SystemConfiguration", "HostName",
-        dbus::utility::DbusVariantType(hostName));
+      },
+      "xyz.openbmc_project.Settings", "/xyz/openbmc_project/network/hypervisor",
+      "org.freedesktop.DBus.Properties", "Set",
+      "xyz.openbmc_project.Network.SystemConfiguration", "HostName",
+      dbus::utility::DbusVariantType(hostName));
 }
 
-inline void
-    setIPv4InterfaceEnabled(const std::string& ifaceId, const bool& isActive,
-                            const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec;
-            messages::internalError(asyncResp->res);
-            return;
+inline void setIPv4InterfaceEnabled(
+    const std::string& ifaceId, const bool& isActive,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp](const boost::system::error_code& ec) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
-        },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/network/hypervisor/" + ifaceId + "/ipv4/addr0",
-        "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Object.Enable", "Enabled",
-        dbus::utility::DbusVariantType(isActive));
+      },
+      "xyz.openbmc_project.Settings",
+      "/xyz/openbmc_project/network/hypervisor/" + ifaceId + "/ipv4/addr0",
+      "org.freedesktop.DBus.Properties", "Set",
+      "xyz.openbmc_project.Object.Enable", "Enabled",
+      dbus::utility::DbusVariantType(isActive));
 }
 
 inline void handleHypervisorEthernetInterfaceCollectionGet(
     App& app, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    constexpr std::array<std::string_view, 1> interfaces = {
-        "xyz.openbmc_project.Network.EthernetInterface"};
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  constexpr std::array<std::string_view, 1> interfaces = {
+      "xyz.openbmc_project.Network.EthernetInterface"};
 
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    managedStore::GetManagedObjectStore()->getSubTreePaths(
-        "/xyz/openbmc_project/network/hypervisor", 0, interfaces,
-        requestContext,
-        [asyncResp](
-            const boost::system::error_code& error,
-            const dbus::utility::MapperGetSubTreePathsResponse& ifaceList) {
-        if (error)
-        {
-            messages::resourceNotFound(asyncResp->res, "System", "hypervisor");
-            return;
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  managedStore::GetManagedObjectStore()->getSubTreePaths(
+      "/xyz/openbmc_project/network/hypervisor", 0, interfaces, requestContext,
+      [asyncResp](
+          const boost::system::error_code& error,
+          const dbus::utility::MapperGetSubTreePathsResponse& ifaceList) {
+        if (error) {
+          messages::resourceNotFound(asyncResp->res, "System", "hypervisor");
+          return;
         }
         asyncResp->res.jsonValue["@odata.type"] =
             "#EthernetInterfaceCollection."
             "EthernetInterfaceCollection";
         asyncResp->res.jsonValue["@odata.id"] =
             "/redfish/v1/Systems/hypervisor/EthernetInterfaces";
-        asyncResp->res.jsonValue["Name"] = "Hypervisor Ethernet "
-                                           "Interface Collection";
+        asyncResp->res.jsonValue["Name"] =
+            "Hypervisor Ethernet "
+            "Interface Collection";
         asyncResp->res.jsonValue["Description"] =
             "Collection of Virtual Management "
             "Interfaces for the hypervisor";
 
         nlohmann::json& ifaceArray = asyncResp->res.jsonValue["Members"];
         ifaceArray = nlohmann::json::array();
-        for (const std::string& iface : ifaceList)
-        {
-            sdbusplus::message::object_path path(iface);
-            std::string name = path.filename();
-            if (name.empty())
-            {
-                continue;
-            }
-            nlohmann::json::object_t ethIface;
-            ethIface["@odata.id"] = crow::utility::urlFromPieces(
-                "redfish", "v1", "Systems", "hypervisor", "EthernetInterfaces",
-                name);
-            ifaceArray.emplace_back(std::move(ethIface));
+        for (const std::string& iface : ifaceList) {
+          sdbusplus::message::object_path path(iface);
+          std::string name = path.filename();
+          if (name.empty()) {
+            continue;
+          }
+          nlohmann::json::object_t ethIface;
+          ethIface["@odata.id"] = crow::utility::urlFromPieces(
+              "redfish", "v1", "Systems", "hypervisor", "EthernetInterfaces",
+              name);
+          ifaceArray.emplace_back(std::move(ethIface));
         }
         asyncResp->res.jsonValue["Members@odata.count"] = ifaceArray.size();
-    });
+      });
 }
 
 inline void handleHypervisorEthernetInterfaceGet(
     App& app, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, const std::string& id)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    getHypervisorIfaceData(
-        id, context,
-        [asyncResp, ifaceId{std::string(id)}](
-            const bool& success, const EthernetInterfaceData& ethData,
-            const boost::container::flat_set<IPv4AddressData>& ipv4Data) {
-        if (!success)
-        {
-            messages::resourceNotFound(asyncResp->res, "EthernetInterface",
-                                       ifaceId);
-            return;
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& id) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  getHypervisorIfaceData(
+      id, context,
+      [asyncResp, ifaceId{std::string(id)}](
+          const bool& success, const EthernetInterfaceData& ethData,
+          const boost::container::flat_set<IPv4AddressData>& ipv4Data) {
+        if (!success) {
+          messages::resourceNotFound(asyncResp->res, "EthernetInterface",
+                                     ifaceId);
+          return;
         }
         asyncResp->res.jsonValue["@odata.type"] =
             "#EthernetInterface.v1_6_0.EthernetInterface";
@@ -815,24 +704,21 @@
             "Hypervisor's Virtual Management Ethernet Interface";
         parseInterfaceData(asyncResp->res.jsonValue, ifaceId, ethData,
                            ipv4Data);
-        });
+      });
 }
 
 inline void handleHypervisorSystemGet(
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    dbus_utils::getProperty<std::string>(
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/network/hypervisor",
-        "xyz.openbmc_project.Network.SystemConfiguration", "HostName",
-        requestContext,
-        [asyncResp](const boost::system::error_code& ec,
-                    const std::string& /*hostName*/) {
-        if (ec)
-        {
-            messages::resourceNotFound(asyncResp->res, "System", "hypervisor");
-            return;
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  dbus_utils::getProperty<std::string>(
+      "xyz.openbmc_project.Settings", "/xyz/openbmc_project/network/hypervisor",
+      "xyz.openbmc_project.Network.SystemConfiguration", "HostName",
+      requestContext,
+      [asyncResp](const boost::system::error_code& ec,
+                  const std::string& /*hostName*/) {
+        if (ec) {
+          messages::resourceNotFound(asyncResp->res, "System", "hypervisor");
+          return;
         }
         BMCWEB_LOG_DEBUG << "Hypervisor is available";
 
@@ -854,155 +740,136 @@
         getHypervisorState(asyncResp);
         getHypervisorActions(asyncResp);
         // TODO: Add "SystemType" : "hypervisor"
-        });
+      });
 }
 
 inline void handleHypervisorEthernetInterfacePatch(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& ifaceId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    std::optional<std::string> hostName;
-    std::optional<std::vector<nlohmann::json>> ipv4StaticAddresses;
-    std::optional<nlohmann::json> ipv4Addresses;
-    std::optional<nlohmann::json> dhcpv4;
-    std::optional<bool> ipv4DHCPEnabled;
+    const std::string& ifaceId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  std::optional<std::string> hostName;
+  std::optional<std::vector<nlohmann::json>> ipv4StaticAddresses;
+  std::optional<nlohmann::json> ipv4Addresses;
+  std::optional<nlohmann::json> dhcpv4;
+  std::optional<bool> ipv4DHCPEnabled;
 
-    if (!json_util::readJsonPatch(req, asyncResp->res, "HostName", hostName,
-                                  "IPv4StaticAddresses", ipv4StaticAddresses,
-                                  "IPv4Addresses", ipv4Addresses, "DHCPv4",
-                                  dhcpv4))
-    {
-        return;
-    }
+  if (!json_util::readJsonPatch(req, asyncResp->res, "HostName", hostName,
+                                "IPv4StaticAddresses", ipv4StaticAddresses,
+                                "IPv4Addresses", ipv4Addresses, "DHCPv4",
+                                dhcpv4)) {
+    return;
+  }
 
-    if (ipv4Addresses)
-    {
-        messages::propertyNotWritable(asyncResp->res, "IPv4Addresses");
-        return;
-    }
+  if (ipv4Addresses) {
+    messages::propertyNotWritable(asyncResp->res, "IPv4Addresses");
+    return;
+  }
 
-    if (dhcpv4)
-    {
-        if (!json_util::readJson(*dhcpv4, asyncResp->res, "DHCPEnabled",
-                                 ipv4DHCPEnabled))
-        {
+  if (dhcpv4) {
+    if (!json_util::readJson(*dhcpv4, asyncResp->res, "DHCPEnabled",
+                             ipv4DHCPEnabled)) {
+      return;
+    }
+  }
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  getHypervisorIfaceData(
+      ifaceId, context,
+      [asyncResp, ifaceId, hostName = std::move(hostName),
+       ipv4StaticAddresses = std::move(ipv4StaticAddresses), ipv4DHCPEnabled,
+       dhcpv4 = std::move(dhcpv4)](
+          const bool& success, const EthernetInterfaceData& ethData,
+          const boost::container::flat_set<IPv4AddressData>&) {
+        if (!success) {
+          messages::resourceNotFound(asyncResp->res, "EthernetInterface",
+                                     ifaceId);
+          return;
+        }
+
+        if (ipv4StaticAddresses) {
+          const nlohmann::json& ipv4Static = *ipv4StaticAddresses;
+          if (ipv4Static.begin() == ipv4Static.end()) {
+            messages::propertyValueTypeError(
+                asyncResp->res,
+                ipv4Static.dump(2, ' ', true,
+                                nlohmann::json::error_handler_t::replace),
+                "IPv4StaticAddresses");
             return;
-        }
-    }
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    getHypervisorIfaceData(
-        ifaceId, context,
-        [asyncResp, ifaceId, hostName = std::move(hostName),
-         ipv4StaticAddresses = std::move(ipv4StaticAddresses), ipv4DHCPEnabled,
-         dhcpv4 = std::move(dhcpv4)](
-            const bool& success, const EthernetInterfaceData& ethData,
-            const boost::container::flat_set<IPv4AddressData>&) {
-        if (!success)
-        {
-            messages::resourceNotFound(asyncResp->res, "EthernetInterface",
-                                       ifaceId);
+          }
+
+          // One and only one hypervisor instance supported
+          if (ipv4Static.size() != 1) {
+            messages::propertyValueFormatError(
+                asyncResp->res,
+                ipv4Static.dump(2, ' ', true,
+                                nlohmann::json::error_handler_t::replace),
+                "IPv4StaticAddresses");
             return;
+          }
+
+          const nlohmann::json& ipv4Json = ipv4Static[0];
+          // Check if the param is 'null'. If its null, it means
+          // that user wants to delete the IP address. Deleting
+          // the IP address is allowed only if its statically
+          // configured. Deleting the address originated from DHCP
+          // is not allowed.
+          if ((ipv4Json.is_null()) &&
+              (translateDhcpEnabledToBool(ethData.dhcpEnabled, true))) {
+            BMCWEB_LOG_INFO << "Ignoring the delete on ipv4StaticAddresses "
+                               "as the interface is DHCP enabled";
+          } else {
+            handleHypervisorIPv4StaticPatch(ifaceId, ipv4Static, asyncResp);
+          }
         }
 
-        if (ipv4StaticAddresses)
-        {
-            const nlohmann::json& ipv4Static = *ipv4StaticAddresses;
-            if (ipv4Static.begin() == ipv4Static.end())
-            {
-                messages::propertyValueTypeError(
-                    asyncResp->res,
-                    ipv4Static.dump(2, ' ', true,
-                                    nlohmann::json::error_handler_t::replace),
-                    "IPv4StaticAddresses");
-                return;
-            }
-
-            // One and only one hypervisor instance supported
-            if (ipv4Static.size() != 1)
-            {
-                messages::propertyValueFormatError(
-                    asyncResp->res,
-                    ipv4Static.dump(2, ' ', true,
-                                    nlohmann::json::error_handler_t::replace),
-                    "IPv4StaticAddresses");
-                return;
-            }
-
-            const nlohmann::json& ipv4Json = ipv4Static[0];
-            // Check if the param is 'null'. If its null, it means
-            // that user wants to delete the IP address. Deleting
-            // the IP address is allowed only if its statically
-            // configured. Deleting the address originated from DHCP
-            // is not allowed.
-            if ((ipv4Json.is_null()) &&
-                (translateDhcpEnabledToBool(ethData.dhcpEnabled, true)))
-            {
-                BMCWEB_LOG_INFO << "Ignoring the delete on ipv4StaticAddresses "
-                                   "as the interface is DHCP enabled";
-            }
-            else
-            {
-                handleHypervisorIPv4StaticPatch(ifaceId, ipv4Static, asyncResp);
-            }
+        if (hostName) {
+          handleHypervisorHostnamePatch(*hostName, asyncResp);
         }
 
-        if (hostName)
-        {
-            handleHypervisorHostnamePatch(*hostName, asyncResp);
-        }
-
-        if (dhcpv4)
-        {
-            setDHCPEnabled(ifaceId, *ipv4DHCPEnabled, asyncResp);
+        if (dhcpv4) {
+          setDHCPEnabled(ifaceId, *ipv4DHCPEnabled, asyncResp);
         }
 
         // Set this interface to disabled/inactive. This will be set
         // to enabled/active by the pldm once the hypervisor
         // consumes the updated settings from the user.
         setIPv4InterfaceEnabled(ifaceId, false, asyncResp);
-        });
-    asyncResp->res.result(boost::beast::http::status::accepted);
+      });
+  asyncResp->res.result(boost::beast::http::status::accepted);
 }
 
 inline void handleHypervisorResetActionGet(
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    // Only return action info if hypervisor D-Bus object present
-    constexpr std::array<std::string_view, 1> interfaces = {
-        "xyz.openbmc_project.State.Host"};
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    managedStore::GetManagedObjectStore()->getDbusObject(
-        "/xyz/openbmc_project/state/hypervisor0", interfaces, requestContext,
-        [asyncResp](
-            const boost::system::error_code& ec,
-            const std::vector<std::pair<std::string, std::vector<std::string>>>&
-                objInfo) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  // Only return action info if hypervisor D-Bus object present
+  constexpr std::array<std::string_view, 1> interfaces = {
+      "xyz.openbmc_project.State.Host"};
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  managedStore::GetManagedObjectStore()->getDbusObject(
+      "/xyz/openbmc_project/state/hypervisor0", interfaces, requestContext,
+      [asyncResp](
+          const boost::system::error_code& ec,
+          const std::vector<std::pair<std::string, std::vector<std::string>>>&
+              objInfo) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
 
-            // No hypervisor objects found by mapper
-            if (ec.value() == boost::system::errc::io_error)
-            {
-                messages::resourceNotFound(asyncResp->res, "hypervisor",
-                                           "ResetActionInfo");
-                return;
-            }
-
-            messages::internalError(asyncResp->res);
+          // No hypervisor objects found by mapper
+          if (ec.value() == boost::system::errc::io_error) {
+            messages::resourceNotFound(asyncResp->res, "hypervisor",
+                                       "ResetActionInfo");
             return;
+          }
+
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         // One and only one hypervisor instance supported
-        if (objInfo.size() != 1)
-        {
-            messages::internalError(asyncResp->res);
-            return;
+        if (objInfo.size() != 1) {
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         // The hypervisor object only support the ability to
@@ -1025,100 +892,90 @@
         parameter["AllowableValues"] = std::move(allowed);
         parameters.emplace_back(std::move(parameter));
         asyncResp->res.jsonValue["Parameters"] = std::move(parameters);
-    });
+      });
 }
 
 inline void handleHypervisorSystemResetPost(
     App& app, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    std::optional<std::string> resetType;
-    if (!json_util::readJsonAction(req, asyncResp->res, "ResetType", resetType))
-    {
-        // readJson adds appropriate error to response
-        return;
-    }
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  std::optional<std::string> resetType;
+  if (!json_util::readJsonAction(req, asyncResp->res, "ResetType", resetType)) {
+    // readJson adds appropriate error to response
+    return;
+  }
 
-    if (!resetType)
-    {
-        messages::actionParameterMissing(asyncResp->res, "ComputerSystem.Reset",
-                                         "ResetType");
-        return;
-    }
+  if (!resetType) {
+    messages::actionParameterMissing(asyncResp->res, "ComputerSystem.Reset",
+                                     "ResetType");
+    return;
+  }
 
-    // Hypervisor object only support On operation
-    if (resetType != "On")
-    {
-        messages::propertyValueNotInList(asyncResp->res, *resetType,
-                                         "ResetType");
-        return;
-    }
+  // Hypervisor object only support On operation
+  if (resetType != "On") {
+    messages::propertyValueNotInList(asyncResp->res, *resetType, "ResetType");
+    return;
+  }
 
-    std::string command = "xyz.openbmc_project.State.Host.Transition.On";
+  std::string command = "xyz.openbmc_project.State.Host.Transition.On";
 
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp, resetType](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec;
-            if (ec.value() == boost::asio::error::invalid_argument)
-            {
-                messages::actionParameterNotSupported(asyncResp->res,
-                                                      *resetType, "Reset");
-                return;
-            }
-
-            if (ec.value() == boost::asio::error::host_unreachable)
-            {
-                messages::resourceNotFound(asyncResp->res, "Actions", "Reset");
-                return;
-            }
-
-            messages::internalError(asyncResp->res);
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp, resetType](const boost::system::error_code& ec) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec;
+          if (ec.value() == boost::asio::error::invalid_argument) {
+            messages::actionParameterNotSupported(asyncResp->res, *resetType,
+                                                  "Reset");
             return;
+          }
+
+          if (ec.value() == boost::asio::error::host_unreachable) {
+            messages::resourceNotFound(asyncResp->res, "Actions", "Reset");
+            return;
+          }
+
+          messages::internalError(asyncResp->res);
+          return;
         }
         messages::success(asyncResp->res);
-        },
-        "xyz.openbmc_project.State.Hypervisor",
-        "/xyz/openbmc_project/state/hypervisor0",
-        "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.State.Host", "RequestedHostTransition",
-        dbus::utility::DbusVariantType{std::move(command)});
+      },
+      "xyz.openbmc_project.State.Hypervisor",
+      "/xyz/openbmc_project/state/hypervisor0",
+      "org.freedesktop.DBus.Properties", "Set",
+      "xyz.openbmc_project.State.Host", "RequestedHostTransition",
+      dbus::utility::DbusVariantType{std::move(command)});
 }
 
-inline void requestRoutesHypervisorSystems(App& app)
-{
-    /**
-     * HypervisorInterfaceCollection class to handle the GET and PATCH on
-     * Hypervisor Interface
-     */
+inline void requestRoutesHypervisorSystems(App& app) {
+  /**
+   * HypervisorInterfaceCollection class to handle the GET and PATCH on
+   * Hypervisor Interface
+   */
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/hypervisor/EthernetInterfaces/")
-        .privileges(redfish::privileges::getEthernetInterfaceCollection)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleHypervisorEthernetInterfaceCollectionGet, std::ref(app)));
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/hypervisor/EthernetInterfaces/")
+      .privileges(redfish::privileges::getEthernetInterfaceCollection)
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleHypervisorEthernetInterfaceCollectionGet, std::ref(app)));
 
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Systems/hypervisor/EthernetInterfaces/<str>/")
-        .privileges(redfish::privileges::getEthernetInterface)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleHypervisorEthernetInterfaceGet, std::ref(app)));
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/hypervisor/EthernetInterfaces/<str>/")
+      .privileges(redfish::privileges::getEthernetInterface)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleHypervisorEthernetInterfaceGet, std::ref(app)));
 
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Systems/hypervisor/EthernetInterfaces/<str>/")
-        .privileges(redfish::privileges::patchEthernetInterface)
-        .methods(boost::beast::http::verb::patch)(std::bind_front(
-            handleHypervisorEthernetInterfacePatch, std::ref(app)));
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/hypervisor/EthernetInterfaces/<str>/")
+      .privileges(redfish::privileges::patchEthernetInterface)
+      .methods(boost::beast::http::verb::patch)(std::bind_front(
+          handleHypervisorEthernetInterfacePatch, std::ref(app)));
 
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Systems/hypervisor/Actions/ComputerSystem.Reset/")
-        .privileges(redfish::privileges::postComputerSystem)
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handleHypervisorSystemResetPost, std::ref(app)));
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/hypervisor/Actions/ComputerSystem.Reset/")
+      .privileges(redfish::privileges::postComputerSystem)
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handleHypervisorSystemResetPost, std::ref(app)));
 }
-} // namespace redfish
+}  // namespace redfish
+
+#endif  // THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_HYPERVISOR_SYSTEM_H_
diff --git a/redfish-core/lib/log_services.cpp b/redfish-core/lib/log_services.cpp
index 45ed23d..a8a08d1 100644
--- a/redfish-core/lib/log_services.cpp
+++ b/redfish-core/lib/log_services.cpp
@@ -1,62 +1,85 @@
 #include "log_services.hpp"
 
-#include "bmcweb_config.h"
-
-#include "app.hpp"
-#include "dbus_utility.hpp"
-#include "error_messages.hpp"
-#include "external_storer.hpp"
-#include "generated/enums/log_entry.hpp"
-#include "gzfile.hpp"
-#include "http_utility.hpp"
-#include "human_sort.hpp"
-#include "managed_store.hpp"
-#include "managed_store_types.hpp"
-#include "query.hpp"
-#include "redfish_util.hpp"
-#include "registries.hpp"
-#include "registries/base_message_registry.hpp"
-#include "registries/openbmc_message_registry.hpp"
-#include "registries/privilege_registry.hpp"
-#include "task.hpp"
-#include "dbus_utils.hpp"
-#include "system_utils.hpp"
-#include "time_utils.hpp"
-
+#include <systemd/sd-bus.h>
 #include <systemd/sd-journal.h>
 #include <tinyxml2.h>
 #include <unistd.h>
 
-#include <boost/algorithm/string/case_conv.hpp>
-#include <boost/algorithm/string/classification.hpp>
-#include <boost/algorithm/string/replace.hpp>
-#include <boost/algorithm/string/split.hpp>
-#include <boost/beast/core/detail/base64.hpp>
-#include <boost/beast/http/verb.hpp>
-#include <boost/container/flat_map.hpp>
-#include <boost/system/linux_error.hpp>
-#include <sdbusplus/asio/property.hpp>
-#include <sdbusplus/message/types.hpp>
-#include <sdbusplus/unpack_properties.hpp>
-
+#include <algorithm>
 #include <array>
+#include <cerrno>
 #include <charconv>
+#include <chrono>  // NOLINT
+#include <cstddef>
 #include <cstdint>
-#include <filesystem>
+#include <cstdio>
+#include <cstring>
+#include <filesystem>  // NOLINT
+#include <fstream>
 #include <functional>
+#include <iomanip>
+#include <ios>
+#include <iostream>
+#include <iterator>
+#include <memory>
 #include <optional>
-#include <span>
+#include <span>  // NOLINT
+#include <sstream>
+#include <string>
 #include <string_view>
+#include <system_error>  // NOLINT
+#include <tuple>
 #include <unordered_map>
 #include <utility>
 #include <variant>
+#include <vector>
+
+#include "absl/strings/match.h"
+#include "absl/strings/numbers.h"
+#include "boost/algorithm/string/case_conv.hpp"  // NOLINT
+#include "boost/algorithm/string/classification.hpp"  // NOLINT
+#include "boost/algorithm/string/replace.hpp"  // NOLINT
+#include "boost/algorithm/string/split.hpp"  // NOLINT
+#include "boost/beast/core/detail/base64.hpp"  // NOLINT
+#include "boost/beast/http/verb.hpp"  // NOLINT
+#include "boost/container/flat_map.hpp"  // NOLINT
+#include "boost/system/linux_error.hpp"  // NOLINT
+#include "bmcweb_config.h"
+#include "app.hpp"
+#include "http_request.hpp"
+#include "http_response.hpp"
+#include "logging.hpp"
+#include "utility.hpp"
+#include "async_resp.hpp"
+#include "dbus_utility.hpp"
+#include "http_utility.hpp"
+#include "human_sort.hpp"
+#include "str_utility.hpp"
+#include "error_messages.hpp"
+#include "generated/enums/log_entry.hpp"
+#include "gzfile.hpp"
+#include "query.hpp"
+#include "registries.hpp"
+#include "registries/privilege_registry.hpp"
+#include "task_messages.hpp"
+#include "dbus_utils.hpp"
+#include "json_utils.hpp"
+#include "system_utils.hpp"
+#include "time_utils.hpp"
+#include "external_storer.hpp"  // NOLINT(misc-include-cleaner)
+#include "task.hpp"
+#include <nlohmann/json.hpp>
+#include "managed_store.hpp"
+#include "managed_store_types.hpp"
+#include "sdbusplus/message.hpp"
+#include "sdbusplus/message/native_types.hpp"
+#include "sdbusplus/unpack_properties.hpp"  // NOLINT
 
 #ifdef UNIT_TEST_BUILD
-#include "test/g3/mock_managed_store.hpp" // NOLINT
+#include "test/g3/mock_managed_store.hpp"  // NOLINT
 #endif
 
-namespace redfish
-{
+namespace redfish {
 #ifdef BMCWEB_ENABLE_RASMANAGER_EVENT_LOG
 constexpr char const* rasManagerObject = "com.intel.RAS";
 constexpr char const* rasManagerPath = "/com/intel/ras/logs";
@@ -86,175 +109,157 @@
 constexpr uint16_t kBtSetToHardMask = 0x01;
 constexpr uint16_t kRtToBtMask = 0x02;
 
-enum class DumpCreationProgress : std::uint8_t
-{
-    DUMP_CREATE_SUCCESS,
-    DUMP_CREATE_FAILED,
-    DUMP_CREATE_INPROGRESS
+enum class DumpCreationProgress : std::uint8_t {
+  DUMP_CREATE_SUCCESS,
+  DUMP_CREATE_FAILED,
+  DUMP_CREATE_INPROGRESS
 };
 
-std::string dumpTypeToString(DumpType dumpType)
-{
-    return std::string(dumpTypeStrings[static_cast<size_t>(dumpType)]);
+std::string dumpTypeToString(DumpType dumpType) {
+  return std::string(dumpTypeStrings[static_cast<size_t>(dumpType)]);
 }
 
-inline std::string bootTimeDataTypeToString(const BootTimeDataType dataType)
-{
-    return std::string(bootTimeDataTypeString[static_cast<size_t>(dataType)]);
+inline std::string bootTimeDataTypeToString(const BootTimeDataType dataType) {
+  return std::string(bootTimeDataTypeString[static_cast<size_t>(dataType)]);
 }
 
 inline static int getJournalMetadata(sd_journal* journal,
                                      std::string_view field,
-                                     std::string_view& contents)
-{
-    const char* data = nullptr;
-    size_t length = 0;
-    int ret = 0;
-    // Get the metadata from the requested field of the journal entry
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
-    const void** dataVoid = reinterpret_cast<const void**>(&data);
+                                     std::string_view& contents) {
+  const char* data = nullptr;
+  size_t length = 0;
+  int ret = 0;
+  // Get the metadata from the requested field of the journal entry
+  // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
+  const void** dataVoid = reinterpret_cast<const void**>(&data);
 
-    ret = sd_journal_get_data(journal, field.data(), dataVoid, &length);
-    if (ret < 0)
-    {
-        return ret;
-    }
-    contents = std::string_view(data, length);
-    // Only use the content after the "=" character.
-    contents.remove_prefix(std::min(contents.find('=') + 1, contents.size()));
+  ret = sd_journal_get_data(journal, field.data(), dataVoid, &length);
+  if (ret < 0) {
     return ret;
+  }
+  contents = std::string_view(data, length);
+  // Only use the content after the "=" character.
+  contents.remove_prefix(std::min(contents.find('=') + 1, contents.size()));
+  return ret;
 }
 
-inline static int getJournalMetadata(sd_journal* journal,
-                                     std::string_view field, const int& base,
-                                     int64_t& contents)
-{
-    int ret = 0;
-    std::string_view metadata;
-    // Get the metadata from the requested field of the journal entry
-    ret = getJournalMetadata(journal, field, metadata);
-    if (ret < 0)
-    {
-        return ret;
-    }
-    contents = strtol(metadata.data(), nullptr, base);
+inline static int getJournalMetadataToInt64(sd_journal* journal,
+                                            std::string_view field,
+                                            int64_t& contents) {
+  int ret = 0;
+  std::string_view metadata;
+  // Get the metadata from the requested field of the journal entry
+  ret = getJournalMetadata(journal, field, metadata);
+  if (ret < 0) {
     return ret;
+  }
+
+  bool parsed = absl::SimpleAtoi(metadata, &contents);
+
+  if (!parsed) {
+    BMCWEB_LOG_ERROR
+        << "getJournalMetadata: Failed to parse metadata(severity): "
+        << metadata;
+    return -EINVAL;
+  }
+
+  return ret;
 }
 
 inline static bool getEntryTimestamp(sd_journal* journal,
-                                     std::string& entryTimestamp)
-{
-    int ret = 0;
-    uint64_t timestamp = 0;
-    ret = sd_journal_get_realtime_usec(journal, &timestamp);
-    if (ret < 0)
-    {
-        BMCWEB_LOG_ERROR << "Failed to read entry timestamp: "
-                         << strerror(-ret);
-        return false;
-    }
-    entryTimestamp = redfish::time_utils::getDateTimeUintUs(timestamp);
-    return true;
+                                     std::string& entryTimestamp) {
+  int ret = 0;
+  uint64_t timestamp = 0;
+  ret = sd_journal_get_realtime_usec(journal, &timestamp);
+  if (ret < 0) {
+    BMCWEB_LOG_ERROR << "Failed to read entry timestamp: " << strerror(-ret);
+    return false;
+  }
+  entryTimestamp = redfish::time_utils::getDateTimeUintUs(timestamp);
+  return true;
 }
 
 inline static bool getUniqueEntryID(sd_journal* journal, std::string& entryID,
-                                    const bool firstEntry = true)
-{
-    int ret = 0;
-    static uint64_t prevTs = 0;
-    static int index = 0;
-    if (firstEntry)
-    {
-        prevTs = 0;
-    }
+                                    const bool firstEntry = true) {
+  int ret = 0;
+  static uint64_t prevTs = 0;
+  static int index = 0;
+  if (firstEntry) {
+    prevTs = 0;
+  }
 
-    // Get the entry timestamp
-    uint64_t curTs = 0;
-    ret = sd_journal_get_realtime_usec(journal, &curTs);
-    if (ret < 0)
-    {
-        BMCWEB_LOG_ERROR << "Failed to read entry timestamp: "
-                         << strerror(-ret);
-        return false;
-    }
-    // If the timestamp isn't unique, increment the index
-    if (curTs == prevTs)
-    {
-        index++;
-    }
-    else
-    {
-        // Otherwise, reset it
-        index = 0;
-    }
-    // Save the timestamp
-    prevTs = curTs;
+  // Get the entry timestamp
+  uint64_t curTs = 0;
+  ret = sd_journal_get_realtime_usec(journal, &curTs);
+  if (ret < 0) {
+    BMCWEB_LOG_ERROR << "Failed to read entry timestamp: " << strerror(-ret);
+    return false;
+  }
+  // If the timestamp isn't unique, increment the index
+  if (curTs == prevTs) {
+    index++;
+  } else {
+    // Otherwise, reset it
+    index = 0;
+  }
+  // Save the timestamp
+  prevTs = curTs;
 
-    entryID = std::to_string(curTs);
-    if (index > 0)
-    {
-        entryID += "_" + std::to_string(index);
-    }
-    return true;
+  entryID = std::to_string(curTs);
+  if (index > 0) {
+    entryID += "_" + std::to_string(index);
+  }
+  return true;
 }
 
-inline static bool
-    getTimestampFromID(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                       const std::string& entryID, uint64_t& timestamp,
-                       uint64_t& index)
-{
-    if (entryID.empty())
-    {
-        return false;
-    }
-    // Convert the unique ID back to a timestamp to find the entry
-    std::string_view tsStr(entryID);
+inline static bool getTimestampFromID(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& entryID, uint64_t& timestamp, uint64_t& index) {
+  if (entryID.empty()) {
+    return false;
+  }
+  // Convert the unique ID back to a timestamp to find the entry
+  std::string_view tsStr(entryID);
 
-    auto underscorePos = tsStr.find('_');
-    if (underscorePos != std::string_view::npos)
-    {
-        // Timestamp has an index
-        tsStr.remove_suffix(tsStr.size() - underscorePos);
-        std::string_view indexStr(entryID);
-        indexStr.remove_prefix(underscorePos + 1);
-        auto [ptr, ec] = std::from_chars(
-            indexStr.data(), indexStr.data() + indexStr.size(), index);
-        if (ec != std::errc())
-        {
-            messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
-            return false;
-        }
+  auto underscorePos = tsStr.find('_');
+  if (underscorePos != std::string_view::npos) {
+    // Timestamp has an index
+    tsStr.remove_suffix(tsStr.size() - underscorePos);
+    std::string_view indexStr(entryID);
+    indexStr.remove_prefix(underscorePos + 1);
+    auto [ptr, ec] = std::from_chars(indexStr.data(),
+                                     indexStr.data() + indexStr.size(), index);
+    if (ec != std::errc()) {
+      messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
+      return false;
     }
-    // Timestamp has no index
-    auto [ptr, ec] =
-        std::from_chars(tsStr.data(), tsStr.data() + tsStr.size(), timestamp);
-    if (ec != std::errc())
-    {
-        messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
-        return false;
-    }
-    return true;
+  }
+  // Timestamp has no index
+  auto [ptr, ec] =
+      std::from_chars(tsStr.data(), tsStr.data() + tsStr.size(), timestamp);
+  if (ec != std::errc()) {
+    messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
+    return false;
+  }
+  return true;
 }
 
-inline log_entry::OriginatorTypes
-    mapDbusOriginatorTypeToRedfish(const std::string& originatorType)
-{
-    if (originatorType ==
-        "xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes.Client")
-    {
-        return log_entry::OriginatorTypes::Client;
-    }
-    if (originatorType ==
-        "xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes.Internal")
-    {
-        return log_entry::OriginatorTypes::Internal;
-    }
-    if (originatorType ==
-        "xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes.SupportingService")
-    {
-        return log_entry::OriginatorTypes::SupportingService;
-    }
-    return log_entry::OriginatorTypes::Invalid;
+inline log_entry::OriginatorTypes mapDbusOriginatorTypeToRedfish(
+    const std::string& originatorType) {
+  if (originatorType ==
+      "xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes.Client") {
+    return log_entry::OriginatorTypes::Client;
+  }
+  if (originatorType ==
+      "xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes.Internal") {
+    return log_entry::OriginatorTypes::Internal;
+  }
+  if (originatorType ==
+      "xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes."
+      "SupportingService") {
+    return log_entry::OriginatorTypes::SupportingService;
+  }
+  return log_entry::OriginatorTypes::Invalid;
 }
 
 inline void parseDumpEntryFromDbusObject(
@@ -262,169 +267,127 @@
     std::string& dumpStatus, uint64_t& size, uint64_t& timestampUs,
     std::string& originatorId, log_entry::OriginatorTypes& originatorType,
     std::string& entryType, std::string& primaryLogId,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    for (const auto& interfaceMap : object.second)
-    {
-        if (interfaceMap.first == "xyz.openbmc_project.Common.Progress")
-        {
-            for (const auto& propertyMap : interfaceMap.second)
-            {
-                if (propertyMap.first == "Status")
-                {
-                    const auto* status =
-                        std::get_if<std::string>(&propertyMap.second);
-                    if (status == nullptr)
-                    {
-                        messages::internalError(asyncResp->res);
-                        break;
-                    }
-                    dumpStatus = *status;
-                }
-            }
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  for (const auto& interfaceMap : object.second) {
+    if (interfaceMap.first == "xyz.openbmc_project.Common.Progress") {
+      for (const auto& propertyMap : interfaceMap.second) {
+        if (propertyMap.first == "Status") {
+          const auto* status = std::get_if<std::string>(&propertyMap.second);
+          if (status == nullptr) {
+            messages::internalError(asyncResp->res);
+            break;
+          }
+          dumpStatus = *status;
         }
-        else if (interfaceMap.first == "xyz.openbmc_project.Dump.Entry")
-        {
-            for (const auto& propertyMap : interfaceMap.second)
-            {
-                if (propertyMap.first == "Size")
-                {
-                    const auto* sizePtr =
-                        std::get_if<uint64_t>(&propertyMap.second);
-                    if (sizePtr == nullptr)
-                    {
-                        messages::internalError(asyncResp->res);
-                        break;
-                    }
-                    size = *sizePtr;
-                    break;
-                }
-            }
+      }
+    } else if (interfaceMap.first == "xyz.openbmc_project.Dump.Entry") {
+      for (const auto& propertyMap : interfaceMap.second) {
+        if (propertyMap.first == "Size") {
+          const auto* sizePtr = std::get_if<uint64_t>(&propertyMap.second);
+          if (sizePtr == nullptr) {
+            messages::internalError(asyncResp->res);
+            break;
+          }
+          size = *sizePtr;
+          break;
         }
-        else if (interfaceMap.first == "xyz.openbmc_project.Time.EpochTime")
-        {
-            for (const auto& propertyMap : interfaceMap.second)
-            {
-                if (propertyMap.first == "Elapsed")
-                {
-                    const uint64_t* usecsTimeStamp =
-                        std::get_if<uint64_t>(&propertyMap.second);
-                    if (usecsTimeStamp == nullptr)
-                    {
-                        messages::internalError(asyncResp->res);
-                        break;
-                    }
-                    timestampUs = *usecsTimeStamp;
-                    break;
-                }
-            }
+      }
+    } else if (interfaceMap.first == "xyz.openbmc_project.Time.EpochTime") {
+      for (const auto& propertyMap : interfaceMap.second) {
+        if (propertyMap.first == "Elapsed") {
+          const uint64_t* usecsTimeStamp =
+              std::get_if<uint64_t>(&propertyMap.second);
+          if (usecsTimeStamp == nullptr) {
+            messages::internalError(asyncResp->res);
+            break;
+          }
+          timestampUs = *usecsTimeStamp;
+          break;
         }
-        else if (interfaceMap.first ==
-                 "xyz.openbmc_project.Common.OriginatedBy")
-        {
-            for (const auto& propertyMap : interfaceMap.second)
-            {
-                if (propertyMap.first == "OriginatorId")
-                {
-                    const std::string* id =
-                        std::get_if<std::string>(&propertyMap.second);
-                    if (id == nullptr)
-                    {
-                        messages::internalError(asyncResp->res);
-                        break;
-                    }
-                    originatorId = *id;
-                }
+      }
+    } else if (interfaceMap.first ==
+               "xyz.openbmc_project.Common.OriginatedBy") {
+      for (const auto& propertyMap : interfaceMap.second) {
+        if (propertyMap.first == "OriginatorId") {
+          const std::string* id = std::get_if<std::string>(&propertyMap.second);
+          if (id == nullptr) {
+            messages::internalError(asyncResp->res);
+            break;
+          }
+          originatorId = *id;
+        }
 
-                if (propertyMap.first == "OriginatorType")
-                {
-                    const std::string* type =
-                        std::get_if<std::string>(&propertyMap.second);
-                    if (type == nullptr)
-                    {
-                        messages::internalError(asyncResp->res);
-                        break;
-                    }
+        if (propertyMap.first == "OriginatorType") {
+          const std::string* type =
+              std::get_if<std::string>(&propertyMap.second);
+          if (type == nullptr) {
+            messages::internalError(asyncResp->res);
+            break;
+          }
 
-                    originatorType = mapDbusOriginatorTypeToRedfish(*type);
-                    if (originatorType == log_entry::OriginatorTypes::Invalid)
-                    {
-                        messages::internalError(asyncResp->res);
-                        break;
-                    }
-                }
-            }
+          originatorType = mapDbusOriginatorTypeToRedfish(*type);
+          if (originatorType == log_entry::OriginatorTypes::Invalid) {
+            messages::internalError(asyncResp->res);
+            break;
+          }
         }
-        else if (interfaceMap.first ==
-                 "xyz.openbmc_project.Dump.Entry.FaultLog")
-        {
-            for (const auto& propertyMap : interfaceMap.second)
-            {
-                if (propertyMap.first == "Type")
-                {
-                    const std::string* entryTypePtr =
-                        std::get_if<std::string>(&propertyMap.second);
-                    if (entryTypePtr == nullptr)
-                    {
-                        messages::internalError(asyncResp->res);
-                        break;
-                    }
-                    if (*entryTypePtr ==
-                        "xyz.openbmc_project.Common.FaultLogType.FaultLogTypes.Crashdump")
-                    {
-                        entryType = "Crashdump";
-                    }
-                    else if (
-                        *entryTypePtr ==
-                        "xyz.openbmc_project.Common.FaultLogType.FaultLogTypes.CPER")
-                    {
-                        entryType = "CPER";
-                    }
-                }
-                else if (propertyMap.first == "PrimaryLogId")
-                {
-                    const std::string* primaryLogIdPtr =
-                        std::get_if<std::string>(&propertyMap.second);
-                    if (primaryLogIdPtr == nullptr)
-                    {
-                        messages::internalError(asyncResp->res);
-                        break;
-                    }
-                    primaryLogId = *primaryLogIdPtr;
-                }
-            }
+      }
+    } else if (interfaceMap.first ==
+               "xyz.openbmc_project.Dump.Entry.FaultLog") {
+      for (const auto& propertyMap : interfaceMap.second) {
+        if (propertyMap.first == "Type") {
+          const std::string* entryTypePtr =
+              std::get_if<std::string>(&propertyMap.second);
+          if (entryTypePtr == nullptr) {
+            messages::internalError(asyncResp->res);
+            break;
+          }
+          if (*entryTypePtr ==
+              "xyz.openbmc_project.Common.FaultLogType.FaultLogTypes."
+              "Crashdump") {
+            entryType = "Crashdump";
+          } else if (*entryTypePtr ==
+                     "xyz.openbmc_project.Common.FaultLogType.FaultLogTypes."
+                     "CPER") {
+            entryType = "CPER";
+          }
+        } else if (propertyMap.first == "PrimaryLogId") {
+          const std::string* primaryLogIdPtr =
+              std::get_if<std::string>(&propertyMap.second);
+          if (primaryLogIdPtr == nullptr) {
+            messages::internalError(asyncResp->res);
+            break;
+          }
+          primaryLogId = *primaryLogIdPtr;
         }
+      }
     }
+  }
 }
 
-static std::string getDumpEntriesPath(const Dump& dump)
-{
-    std::string entriesPath;
+static std::string getDumpEntriesPath(const Dump& dump) {
+  std::string entriesPath;
 
-    switch (dump.type)
-    {
-        case DumpType::BMC_DUMP:
-            entriesPath = "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/";
-            break;
-        case DumpType::BMC_FAULT_LOG:
-            entriesPath =
-                "/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/";
-            break;
-        case DumpType::SYSTEM_DUMP:
-            entriesPath =
-                "/redfish/v1/Systems/system/LogServices/Dump/Entries/";
-            break;
-        case DumpType::SYSTEM_FAULT_LOG:
-            if (dump.systemName)
-            {
-                entriesPath = "/redfish/v1/Systems/" + *dump.systemName +
-                              "/LogServices/FaultLog/Entries/";
-            }
-            break;
-    }
+  switch (dump.type) {
+    case DumpType::BMC_DUMP:
+      entriesPath = "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/";
+      break;
+    case DumpType::BMC_FAULT_LOG:
+      entriesPath = "/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/";
+      break;
+    case DumpType::SYSTEM_DUMP:
+      entriesPath = "/redfish/v1/Systems/system/LogServices/Dump/Entries/";
+      break;
+    case DumpType::SYSTEM_FAULT_LOG:
+      if (dump.systemName) {
+        entriesPath = "/redfish/v1/Systems/" + *dump.systemName +
+                      "/LogServices/FaultLog/Entries/";
+      }
+      break;
+  }
 
-    // Returns empty string on error
-    return entriesPath;
+  // Returns empty string on error
+  return entriesPath;
 }
 
 constexpr std::array<std::pair<std::string_view, std::string_view>, 2>
@@ -432,25 +395,21 @@
         {{"system1", "/xyz/openbmc_project/dump/faultlog/0"},
          {"system2", "/xyz/openbmc_project/dump/faultlog/1"}}};
 
-inline std::optional<std::string> getDumpEntryPathFromDump(const Dump& dump)
-{
-    if (!dump.systemName || *dump.systemName == "system")
-    {
-        return "/xyz/openbmc_project/dump/" +
-               std::string(boost::algorithm::to_lower_copy(
-                   dumpTypeToString(dump.type))) +
-               "/entry/";
-    }
+inline std::optional<std::string> getDumpEntryPathFromDump(const Dump& dump) {
+  if (!dump.systemName || *dump.systemName == "system") {
+    return "/xyz/openbmc_project/dump/" +
+           std::string(
+               boost::algorithm::to_lower_copy(dumpTypeToString(dump.type))) +
+           "/entry/";
+  }
 
-    for (const auto& mapping : systemNameToDumpEntryPath)
-    {
-        if (mapping.first == *dump.systemName)
-        {
-            return std::string(mapping.second) + "/entry/";
-        }
+  for (const auto& mapping : systemNameToDumpEntryPath) {
+    if (mapping.first == *dump.systemName) {
+      return std::string(mapping.second) + "/entry/";
     }
+  }
 
-    return std::nullopt;
+  return std::nullopt;
 }
 
 // This function queries the collectionUri, and add the fields from the
@@ -465,63 +424,55 @@
     const std::string& collectionUri,
     std::unordered_map<std::string, nlohmann::json::json_pointer>&
         faultLogEntries,
-    nlohmann::json& originalMembers)
-{
-    std::error_code ec;
-    crow::Request newReq({boost::beast::http::verb::get, collectionUri, 11},
-                         ec);
+    nlohmann::json& originalMembers) {
+  std::error_code ec;
+  crow::Request newReq({boost::beast::http::verb::get, collectionUri, 11}, ec);
 
-    if (ec)
-    {
-        messages::internalError(asyncResp->res);
-        return;
-    }
+  if (ec) {
+    messages::internalError(asyncResp->res);
+    return;
+  }
 
-    newReq.with_trust_bundle = origReq.with_trust_bundle;
-    newReq.peer_authenticated = origReq.peer_authenticated;
-    newReq.peer_privileges = origReq.peer_privileges;
-    newReq.fromGrpc = origReq.fromGrpc;
+  newReq.with_trust_bundle = origReq.with_trust_bundle;
+  newReq.peer_authenticated = origReq.peer_authenticated;
+  newReq.peer_privileges = origReq.peer_privileges;
+  newReq.fromGrpc = origReq.fromGrpc;
 
-    auto newAsyncResp = std::make_shared<bmcweb::AsyncResp>(asyncResp->strand_);
-    newAsyncResp->response_type = asyncResp->response_type;
+  auto newAsyncResp = std::make_shared<bmcweb::AsyncResp>(asyncResp->strand_);
+  newAsyncResp->response_type = asyncResp->response_type;
 
-    newAsyncResp->res.setCompleteRequestHandler(
-        [faultLogEntries{std::move(faultLogEntries)},
-         originalMembers(std::move(originalMembers)),
-         asyncResp](const crow::Response& subResp) mutable {
-        if (!subResp.jsonValue.contains("Members"))
-        {
-            BMCWEB_LOG_WARNING << "Sub query response is empty.";
-            return;
+  newAsyncResp->res.setCompleteRequestHandler(
+      [faultLogEntries{std::move(faultLogEntries)},
+       originalMembers(std::move(originalMembers)),
+       asyncResp](const crow::Response& subResp) mutable {
+        if (!subResp.jsonValue.contains("Members")) {
+          BMCWEB_LOG_WARNING << "Sub query response is empty.";
+          return;
         }
-        for (const auto& resItem : subResp.jsonValue["Members"])
-        {
-            const std::string link = resItem["@odata.id"];
-            if (!faultLogEntries.contains(link))
-            {
-                // This could happen when there is inconsistency in cache.
-                // Ignoring this specific entry.
-                BMCWEB_LOG_WARNING << "Entry doesn't exist in response: "
-                                   << link;
-                continue;
-            }
+        for (const auto& resItem : subResp.jsonValue["Members"]) {
+          const std::string link = resItem["@odata.id"];
+          if (!faultLogEntries.contains(link)) {
+            // This could happen when there is inconsistency in cache.
+            // Ignoring this specific entry.
+            BMCWEB_LOG_WARNING << "Entry doesn't exist in response: " << link;
+            continue;
+          }
 
-            // This path is within "Members". Since it has been moved to a
-            // separate jsonArray, it looks like '/0/Links/RelatedLogEntries/0'
-            // here.
-            const std::string& jsonPath = faultLogEntries.at(link).to_string();
-            std::vector<std::string> split;
-            bmcweb::split(split, jsonPath, '/');
-            if (split.size() < 2)
-            {
-                BMCWEB_LOG_WARNING << "Invalid JSON path for entry " << link;
-                continue;
-            }
-            unsigned int memberIdx =
-                static_cast<unsigned int>(std::stoi(split[1]));
-            originalMembers[faultLogEntries.at(link)] = resItem;
-            asyncResp->res.jsonValue["Members"].push_back(
-                std::move(originalMembers[""_json_pointer / memberIdx]));
+          // This path is within "Members". Since it has been moved to a
+          // separate jsonArray, it looks like '/0/Links/RelatedLogEntries/0'
+          // here.
+          const std::string& jsonPath = faultLogEntries.at(link).to_string();
+          std::vector<std::string> split;
+          bmcweb::split(split, jsonPath, '/');
+          if (split.size() < 2) {
+            BMCWEB_LOG_WARNING << "Invalid JSON path for entry " << link;
+            continue;
+          }
+          unsigned int memberIdx =
+              static_cast<unsigned int>(std::stoi(split[1]));
+          originalMembers[faultLogEntries.at(link)] = resItem;
+          asyncResp->res.jsonValue["Members"].push_back(
+              std::move(originalMembers[""_json_pointer / memberIdx]));
         }
 
         asyncResp->res.jsonValue["Members@odata.count"] =
@@ -530,99 +481,89 @@
         asyncResp->res.eventSourceIds.insert(
             asyncResp->res.eventSourceIds.end(), subResp.eventSourceIds.begin(),
             subResp.eventSourceIds.end());
-    });
+      });
 
-    app.handle(newReq, newAsyncResp);
-    redfish::query_param::propogateError(asyncResp->res, newAsyncResp->res);
+  app.handle(newReq, newAsyncResp);
+  redfish::query_param::propogateError(asyncResp->res, newAsyncResp->res);
 }
 
-inline bool shouldEfficientExpandFaultLog(
-    DumpType dumpType,
-    uint64_t delegatedExpandLevel)
-{
-    // We only apply efficient expand when delegated expand level is 2+,
-    // as log services are auto-expanded.
-    // And only BMC_FAULT_LOG and SYSTEM_FAULT_LOG is supported.
-    return (dumpType == DumpType::BMC_FAULT_LOG ||
-            dumpType == DumpType::SYSTEM_FAULT_LOG) &&
-            delegatedExpandLevel > 1;
+inline bool shouldEfficientExpandFaultLog(DumpType dumpType,
+                                          uint64_t delegatedExpandLevel) {
+  // We only apply efficient expand when delegated expand level is 2+,
+  // as log services are auto-expanded.
+  // And only BMC_FAULT_LOG and SYSTEM_FAULT_LOG is supported.
+  return (dumpType == DumpType::BMC_FAULT_LOG ||
+          dumpType == DumpType::SYSTEM_FAULT_LOG) &&
+         delegatedExpandLevel > 1;
 }
 
 void getDumpEntryCollection(App& app, const crow::Request& req,
                             const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                             const Dump& dump,
-                            const query_param::Query& delegatedQuery)
-{
-    std::string entriesPath = getDumpEntriesPath(dump);
-    if (entriesPath.empty())
-    {
-        messages::internalError(asyncResp->res);
-        return;
+                            const query_param::Query& delegatedQuery) {
+  std::string entriesPath = getDumpEntriesPath(dump);
+  if (entriesPath.empty()) {
+    messages::internalError(asyncResp->res);
+    return;
+  }
+
+  uint64_t filterTimestampUs = 0;
+  uint64_t delegatedExpandLevel = delegatedQuery.expandLevel;
+
+  if (!delegatedQuery.filter.empty()) {
+    std::vector<std::string> filterParams;
+    bmcweb::split(filterParams, delegatedQuery.filter, ' ');
+
+    // Only supported filter query is "Created ge '<timestamp>'"
+    if (filterParams.size() != 3 || filterParams[0] != "Created" ||
+        filterParams[1] != "ge") {
+      redfish::messages::queryParameterValueFormatError(
+          asyncResp->res, "$filter", delegatedQuery.filter);
+      asyncResp->res.result(boost::beast::http::status::not_implemented);
+      return;
     }
 
-    uint64_t filterTimestampUs = 0;
-    uint64_t delegatedExpandLevel = delegatedQuery.expandLevel;
-
-    if (!delegatedQuery.filter.empty())
-    {
-        std::vector<std::string> filterParams;
-        bmcweb::split(filterParams, delegatedQuery.filter, ' ');
-
-        // Only supported filter query is "Created ge '<timestamp>'"
-        if (filterParams.size() != 3 || filterParams[0] != "Created" ||
-            filterParams[1] != "ge")
-        {
-            redfish::messages::queryParameterValueFormatError(
-                asyncResp->res, "$filter", delegatedQuery.filter);
-            asyncResp->res.result(boost::beast::http::status::not_implemented);
-            return;
-        }
-
-        std::string& timestampStr = filterParams[2];
-        if (timestampStr.size() < 2 || timestampStr.at(0) != '\'' ||
-            timestampStr.at(timestampStr.size() - 1) != '\'')
-        {
-            BMCWEB_LOG_ERROR << "Filter Timestamp not quoted " << timestampStr;
-            redfish::messages::queryParameterValueFormatError(
-                asyncResp->res, "$filter", delegatedQuery.filter);
-            return;
-        }
-        std::optional<redfish::time_utils::usSinceEpoch>
-            filterTimestampUsChrono = redfish::time_utils::dateStringToEpoch(
-                timestampStr.substr(1, timestampStr.size() - 2));
-        if (filterTimestampUsChrono == std::nullopt)
-        {
-            BMCWEB_LOG_ERROR << "Filter Timestamp validation failure"
-                             << filterParams[2];
-            redfish::messages::queryParameterValueFormatError(
-                asyncResp->res, "$filter", delegatedQuery.filter);
-            return;
-        }
-        filterTimestampUs = filterTimestampUsChrono->count();
+    std::string& timestampStr = filterParams[2];
+    if (timestampStr.size() < 2 || timestampStr.at(0) != '\'' ||
+        timestampStr.at(timestampStr.size() - 1) != '\'') {
+      BMCWEB_LOG_ERROR << "Filter Timestamp not quoted " << timestampStr;
+      redfish::messages::queryParameterValueFormatError(
+          asyncResp->res, "$filter", delegatedQuery.filter);
+      return;
     }
+    std::optional<redfish::time_utils::usSinceEpoch> filterTimestampUsChrono =
+        redfish::time_utils::dateStringToEpoch(
+            timestampStr.substr(1, timestampStr.size() - 2));
+    if (filterTimestampUsChrono == std::nullopt) {
+      BMCWEB_LOG_ERROR << "Filter Timestamp validation failure"
+                       << filterParams[2];
+      redfish::messages::queryParameterValueFormatError(
+          asyncResp->res, "$filter", delegatedQuery.filter);
+      return;
+    }
+    filterTimestampUs = filterTimestampUsChrono->count();
+  }
 
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    managedStore::GetManagedObjectStore()->getManagedObjectsWithContext(
-        "xyz.openbmc_project.Dump.Manager", {"/xyz/openbmc_project/dump"},
-        context,
-        // App's lifespan is tied with the program as it is created in the main
-        // function
-        [&app, asyncResp, entriesPath, dump, filterTimestampUs, req,
-         delegatedExpandLevel](
-            const boost::system::error_code& ec,
-            const dbus::utility::ManagedObjectType& managedObjects) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "DumpEntry resp_handler got error " << ec;
-            messages::internalError(asyncResp->res);
-            return;
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  managedStore::GetManagedObjectStore()->getManagedObjectsWithContext(
+      "xyz.openbmc_project.Dump.Manager", {"/xyz/openbmc_project/dump"},
+      context,
+      // App's lifespan is tied with the program as it is created in the main
+      // function
+      [&app, asyncResp, entriesPath, dump, filterTimestampUs, req,
+       delegatedExpandLevel](
+          const boost::system::error_code& ec,
+          const dbus::utility::ManagedObjectType& managedObjects) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "DumpEntry resp_handler got error " << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         // Remove ending slash
         std::string odataIdStr = entriesPath;
-        if (!odataIdStr.empty())
-        {
-            odataIdStr.pop_back();
+        if (!odataIdStr.empty()) {
+          odataIdStr.pop_back();
         }
 
         asyncResp->res.jsonValue["@odata.type"] =
@@ -638,19 +579,18 @@
         std::optional<std::string> dumpEntryPath =
             getDumpEntryPathFromDump(dump);
 
-        if (!dumpEntryPath)
-        {
-            BMCWEB_LOG_ERROR << "Cant convert system "
-                             << dump.systemName.value_or("None")
-                             << "to dumpEntryPath";
-            messages::internalError(asyncResp->res);
-            return;
+        if (!dumpEntryPath) {
+          BMCWEB_LOG_ERROR << "Cant convert system "
+                           << dump.systemName.value_or("None")
+                           << "to dumpEntryPath";
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         dbus::utility::ManagedObjectType resp = managedObjects;
         std::sort(resp.begin(), resp.end(), [](const auto& l, const auto& r) {
-            return AlphanumLess<std::string>()(l.first.filename(),
-                                               r.first.filename());
+          return AlphanumLess<std::string>()(l.first.filename(),
+                                             r.first.filename());
         });
 
         // This maps the collection URI to all the entries and their json
@@ -672,615 +612,523 @@
         //         "@odata.id": "../FaultLog/Entries/1",
         //        }
         //  ]
-        std::unordered_map<
-            std::string,
-            nlohmann::json> faultLogOriginalMembers;
+        std::unordered_map<std::string, nlohmann::json> faultLogOriginalMembers;
 
-        for (auto& object : resp)
-        {
-            if (object.first.str.find(*dumpEntryPath) == std::string::npos)
-            {
-                continue;
-            }
-            uint64_t timestampUs = 0;
-            uint64_t size = 0;
-            std::string dumpStatus;
-            std::string originatorId;
-            std::string primaryLogId;
-            std::string entryType;
-            log_entry::OriginatorTypes originatorType =
-                log_entry::OriginatorTypes::Internal;
-            nlohmann::json::object_t thisEntry;
+        for (auto& object : resp) {
+          if (object.first.str.find(*dumpEntryPath) == std::string::npos) {
+            continue;
+          }
+          uint64_t timestampUs = 0;
+          uint64_t size = 0;
+          std::string dumpStatus;
+          std::string originatorId;
+          std::string primaryLogId;
+          std::string entryType;
+          log_entry::OriginatorTypes originatorType =
+              log_entry::OriginatorTypes::Internal;
+          nlohmann::json::object_t thisEntry;
 
-            std::string entryID = object.first.filename();
-            if (entryID.empty())
-            {
-                continue;
-            }
+          std::string entryID = object.first.filename();
+          if (entryID.empty()) {
+            continue;
+          }
 
-            parseDumpEntryFromDbusObject(object, dumpStatus, size, timestampUs,
-                                         originatorId, originatorType,
-                                         entryType, primaryLogId, asyncResp);
+          parseDumpEntryFromDbusObject(object, dumpStatus, size, timestampUs,
+                                       originatorId, originatorType, entryType,
+                                       primaryLogId, asyncResp);
 
-            if (dumpStatus !=
-                    "xyz.openbmc_project.Common.Progress.OperationStatus.Completed" &&
-                !dumpStatus.empty())
-            {
-                // Dump status is not Complete, no need to enumerate
-                continue;
-            }
+          if (dumpStatus !=
+                  "xyz.openbmc_project.Common.Progress.OperationStatus."
+                  "Completed" &&
+              !dumpStatus.empty()) {
+            // Dump status is not Complete, no need to enumerate
+            continue;
+          }
 
-            if (timestampUs < filterTimestampUs)
-            {
-                continue;
-            }
+          if (timestampUs < filterTimestampUs) {
+            continue;
+          }
 
-            thisEntry["@odata.type"] = "#LogEntry.v1_11_0.LogEntry";
-            thisEntry["@odata.id"] = entriesPath + entryID;
-            thisEntry["Id"] = entryID;
-            thisEntry["EntryType"] = "Event";
-            thisEntry["Name"] = dumpTypeToString(dump.type) + " Dump Entry";
+          thisEntry["@odata.type"] = "#LogEntry.v1_11_0.LogEntry";
+          thisEntry["@odata.id"] = entriesPath + entryID;
+          thisEntry["Id"] = entryID;
+          thisEntry["EntryType"] = "Event";
+          thisEntry["Name"] = dumpTypeToString(dump.type) + " Dump Entry";
+          thisEntry["Created"] =
+              redfish::time_utils::getDateTimeUintUs(timestampUs);
+
+          if (!originatorId.empty()) {
+            thisEntry["Originator"] = originatorId;
+            thisEntry["OriginatorType"] = originatorType;
+          }
+
+          if (dump.type == DumpType::BMC_DUMP) {
+            thisEntry["DiagnosticDataType"] = "Manager";
+            thisEntry["AdditionalDataURI"] =
+                entriesPath + entryID + "/attachment";
+            thisEntry["AdditionalDataSizeBytes"] = size;
+          } else if (dump.type == DumpType::BMC_FAULT_LOG ||
+                     dump.type == DumpType::SYSTEM_FAULT_LOG) {
             thisEntry["Created"] =
                 redfish::time_utils::getDateTimeUintUs(timestampUs);
+            thisEntry["DiagnosticDataType"] = "OEM";
+            thisEntry["OEMDiagnosticDataType"] = "OpenBMC Fault Log";
+            thisEntry["EntryType"] = "Oem";
 
-            if (!originatorId.empty())
-            {
-                thisEntry["Originator"] = originatorId;
-                thisEntry["OriginatorType"] = originatorType;
-            }
+            std::string systemPathSegment =
+                dump.systemName ? *dump.systemName : "system";
 
-            if (dump.type == DumpType::BMC_DUMP)
-            {
-                thisEntry["DiagnosticDataType"] = "Manager";
+            if (entryType == "CPER") {
+              if (absl::StrContains(primaryLogId, "/Entries/")) {
+                // This is for backward compatibility; we can remove it
+                // later.
+                thisEntry["AdditionalDataURI"] = crow::utility::urlFromPieces(
+                    "redfish", "v1", "Systems", systemPathSegment,
+                    "LogServices", primaryLogId);
+              } else {
+                // Will eventually be changed from AdditionalDataURI to
+                // OriginOfCondition Link
                 thisEntry["AdditionalDataURI"] =
-                    entriesPath + entryID + "/attachment";
-                thisEntry["AdditionalDataSizeBytes"] = size;
-            }
-            else if (dump.type == DumpType::BMC_FAULT_LOG ||
-                     dump.type == DumpType::SYSTEM_FAULT_LOG)
-            {
-                thisEntry["Created"] =
-                    redfish::time_utils::getDateTimeUintUs(timestampUs);
-                thisEntry["DiagnosticDataType"] = "OEM";
-                thisEntry["OEMDiagnosticDataType"] = "OpenBMC Fault Log";
-                thisEntry["EntryType"] = "Oem";
-
-                std::string systemPathSegment =
-                    dump.systemName ? *dump.systemName : "system";
-
-                if (entryType == "CPER")
-                {
-                    if (absl::StrContains(primaryLogId, "/Entries/"))
-                    {
-                        // This is for backward compatibility; we can remove it
-                        // later.
-                        thisEntry["AdditionalDataURI"] =
-                            crow::utility::urlFromPieces(
-                                "redfish", "v1", "Systems", systemPathSegment,
-                                "LogServices", primaryLogId);
-                    }
-                    else
-                    {
-                        // Will eventually be changed from AdditionalDataURI to
-                        // OriginOfCondition Link
-                        thisEntry["AdditionalDataURI"] =
 #ifdef BMCWEB_ENABLE_CPER_CRASHDUMP_USE_FAULTLOG_ID
-                            crow::utility::urlFromPieces(
-                                "redfish", "v1", "Systems", systemPathSegment,
-                                "LogServices",
-                                std::string(hostCperLogServiceName), "Entries",
-                                entryID);
+                    crow::utility::urlFromPieces(
+                        "redfish", "v1", "Systems", systemPathSegment,
+                        "LogServices", std::string(hostCperLogServiceName),
+                        "Entries", entryID);
 #else
-                            crow::utility::urlFromPieces(
-                                "redfish", "v1", "Systems", systemPathSegment,
-                                "LogServices",
-                                std::string(hostCperLogServiceName), "Entries",
-                                primaryLogId);
+                    crow::utility::urlFromPieces(
+                        "redfish", "v1", "Systems", systemPathSegment,
+                        "LogServices", std::string(hostCperLogServiceName),
+                        "Entries", primaryLogId);
 #endif
-                    }
-                    thisEntry["OemRecordFormat"] = "CPER";
-                }
-                else if (entryType == "Crashdump")
-                {
-                    thisEntry["AdditionalDataURI"] =
+              }
+              thisEntry["OemRecordFormat"] = "CPER";
+            } else if (entryType == "Crashdump") {
+              thisEntry["AdditionalDataURI"] =
 #ifdef BMCWEB_ENABLE_CPER_CRASHDUMP_USE_FAULTLOG_ID
-                        crow::utility::urlFromPieces(
-                            "redfish", "v1", "Systems", systemPathSegment,
-                            "LogServices", "Crashdump", "Entries", entryID);
+                  crow::utility::urlFromPieces("redfish", "v1", "Systems",
+                                               systemPathSegment, "LogServices",
+                                               "Crashdump", "Entries", entryID);
 #else
-                        crow::utility::urlFromPieces("redfish", "v1", "Systems",
-                                                     systemPathSegment,
-                                                     "LogServices", "Crashdump",
-                                                     "Entries", primaryLogId);
+                  crow::utility::urlFromPieces(
+                      "redfish", "v1", "Systems", systemPathSegment,
+                      "LogServices", "Crashdump", "Entries", primaryLogId);
 #endif
-                    thisEntry["OemRecordFormat"] = "Crashdump";
-                }
-                // entryType must be of CPER or CrashDump or else accessing
-                // thisEntry["AdditionalDataURI"] becomes undefined behavior
-                else
-                {
-                    BMCWEB_LOG_ERROR << "entryType of faultLog is invalid";
-                    messages::internalError(asyncResp->res);
-                    return;
-                }
-
-                // Also export a RelatedLogEntry link to the AdditionalDataURI.
-                thisEntry["Links"]["RelatedLogEntries"] =
-                    nlohmann::json::array();
-                nlohmann::json::object_t relatedLogEntry;
-                relatedLogEntry["@odata.id"] = thisEntry["AdditionalDataURI"];
-                thisEntry["Links"]["RelatedLogEntries"].emplace_back(
-                    relatedLogEntry);
-            }
-            else if (dump.type == DumpType::SYSTEM_DUMP)
-            {
-                thisEntry["DiagnosticDataType"] = "OEM";
-                thisEntry["OEMDiagnosticDataType"] = "System";
-                thisEntry["AdditionalDataURI"] =
-                    entriesPath + entryID + "/attachment";
-                thisEntry["AdditionalDataSizeBytes"] = size;
+              thisEntry["OemRecordFormat"] = "Crashdump";
+            } else {
+              // entryType must be of CPER or CrashDump or else accessing
+              // thisEntry["AdditionalDataURI"] becomes undefined behavior
+              BMCWEB_LOG_ERROR << "entryType of faultLog is invalid";
+              messages::internalError(asyncResp->res);
+              return;
             }
 
-            if (shouldEfficientExpandFaultLog(dump.type, delegatedExpandLevel))
-            {
-                std::string dataUri = thisEntry["AdditionalDataURI"];
-                std::string collectionUri =
-                    dataUri.substr(0, dataUri.rfind('/') + 1);
-                if (!faultLogEntries.contains(collectionUri))
-                {
-                    faultLogEntries.emplace(
-                        collectionUri,
-                        std::unordered_map<std::string,
-                                           nlohmann::json::json_pointer>());
-                    faultLogOriginalMembers.emplace(
-                        collectionUri,
-                        nlohmann::json::array());
-                }
-                auto jsonPath = ""_json_pointer /
-                    faultLogOriginalMembers[collectionUri].size() / "Links" /
-                    "RelatedLogEntries" /
-                    (thisEntry["Links"]["RelatedLogEntries"].size() - 1);
-                faultLogEntries[collectionUri].emplace(dataUri, jsonPath);
-                faultLogOriginalMembers[collectionUri].push_back(std::move(thisEntry));
+            // Also export a RelatedLogEntry link to the AdditionalDataURI.
+            thisEntry["Links"]["RelatedLogEntries"] = nlohmann::json::array();
+            nlohmann::json::object_t relatedLogEntry;
+            relatedLogEntry["@odata.id"] = thisEntry["AdditionalDataURI"];
+            thisEntry["Links"]["RelatedLogEntries"].emplace_back(
+                relatedLogEntry);
+          } else if (dump.type == DumpType::SYSTEM_DUMP) {
+            thisEntry["DiagnosticDataType"] = "OEM";
+            thisEntry["OEMDiagnosticDataType"] = "System";
+            thisEntry["AdditionalDataURI"] =
+                entriesPath + entryID + "/attachment";
+            thisEntry["AdditionalDataSizeBytes"] = size;
+          }
+
+          if (shouldEfficientExpandFaultLog(dump.type, delegatedExpandLevel)) {
+            std::string dataUri = thisEntry["AdditionalDataURI"];
+            std::string collectionUri =
+                dataUri.substr(0, dataUri.rfind('/') + 1);
+            if (!faultLogEntries.contains(collectionUri)) {
+              faultLogEntries.emplace(
+                  collectionUri,
+                  std::unordered_map<std::string,
+                                     nlohmann::json::json_pointer>());
+              faultLogOriginalMembers.emplace(collectionUri,
+                                              nlohmann::json::array());
             }
-            else
-            {
-                entriesArray.push_back(std::move(thisEntry));
-            }
+            auto jsonPath =
+                ""_json_pointer /
+                faultLogOriginalMembers[collectionUri].size() / "Links" /
+                "RelatedLogEntries" /
+                (thisEntry["Links"]["RelatedLogEntries"].size() - 1);
+            faultLogEntries[collectionUri].emplace(dataUri, jsonPath);
+            faultLogOriginalMembers[collectionUri].push_back(
+                std::move(thisEntry));
+          } else {
+            entriesArray.push_back(std::move(thisEntry));
+          }
         }
         asyncResp->res.jsonValue["Members@odata.count"] = entriesArray.size();
 
-        if (shouldEfficientExpandFaultLog(dump.type, delegatedExpandLevel))
-        {
-            // faultLogEntries and faultLogOriginamMemobers will be moved
-            // into the completion handler of sub queries in
-            // queryFaultCollection. It won't be availabe in this scope after
-            // this loop.
-            for (auto& [collectionUri, uriJsonPaths] : faultLogEntries)
-            {
-                nlohmann::json& originalMembers =
-                    faultLogOriginalMembers[collectionUri];
-                queryFaultCollection(app, req, asyncResp, collectionUri,
-                                     uriJsonPaths, originalMembers);
-            }
+        if (shouldEfficientExpandFaultLog(dump.type, delegatedExpandLevel)) {
+          // faultLogEntries and faultLogOriginamMemobers will be moved
+          // into the completion handler of sub queries in
+          // queryFaultCollection. It won't be availabe in this scope after
+          // this loop.
+          for (auto& [collectionUri, uriJsonPaths] : faultLogEntries) {
+            nlohmann::json& originalMembers =
+                faultLogOriginalMembers[collectionUri];
+            queryFaultCollection(app, req, asyncResp, collectionUri,
+                                 uriJsonPaths, originalMembers);
+          }
         }
-    });
+      });
 }
 
-inline void
-    getDumpEntryById(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                     const std::string& entryID, const Dump& dump)
-{
-    std::string entriesPath = getDumpEntriesPath(dump);
-    if (entriesPath.empty())
-    {
-        messages::internalError(asyncResp->res);
-        return;
-    }
+inline void getDumpEntryById(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& entryID, const Dump& dump) {
+  std::string entriesPath = getDumpEntriesPath(dump);
+  if (entriesPath.empty()) {
+    messages::internalError(asyncResp->res);
+    return;
+  }
 
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    managedStore::GetManagedObjectStore()->getManagedObjectsWithContext(
-        "xyz.openbmc_project.Dump.Manager", {"/xyz/openbmc_project/dump"},
-        context,
-        [asyncResp, entryID, dump,
-         entriesPath](const boost::system::error_code& ec,
-                      const dbus::utility::ManagedObjectType& resp) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "DumpEntry resp_handler got error " << ec;
-            messages::internalError(asyncResp->res);
-            return;
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  managedStore::GetManagedObjectStore()->getManagedObjectsWithContext(
+      "xyz.openbmc_project.Dump.Manager", {"/xyz/openbmc_project/dump"},
+      context,
+      [asyncResp, entryID, dump, entriesPath](
+          const boost::system::error_code& ec,
+          const dbus::utility::ManagedObjectType& resp) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "DumpEntry resp_handler got error " << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         bool foundDumpEntry = false;
         std::optional<std::string> dumpEntryPath =
             getDumpEntryPathFromDump(dump);
 
-        if (!dumpEntryPath)
-        {
-            BMCWEB_LOG_ERROR << "Cant convert system "
-                             << dump.systemName.value_or("None")
-                             << "to dumpEntryPath";
-            messages::internalError(asyncResp->res);
-            return;
+        if (!dumpEntryPath) {
+          BMCWEB_LOG_ERROR << "Cant convert system "
+                           << dump.systemName.value_or("None")
+                           << "to dumpEntryPath";
+          messages::internalError(asyncResp->res);
+          return;
         }
 
-        for (const auto& objectPath : resp)
-        {
-            if (objectPath.first.str != *dumpEntryPath + entryID)
-            {
-                continue;
-            }
+        for (const auto& objectPath : resp) {
+          if (objectPath.first.str != *dumpEntryPath + entryID) {
+            continue;
+          }
 
-            foundDumpEntry = true;
-            uint64_t timestampUs = 0;
-            uint64_t size = 0;
-            std::string dumpStatus;
-            std::string originatorId;
-            std::string primaryLogId;
-            std::string entryType;
-            log_entry::OriginatorTypes originatorType =
-                log_entry::OriginatorTypes::Internal;
+          foundDumpEntry = true;
+          uint64_t timestampUs = 0;
+          uint64_t size = 0;
+          std::string dumpStatus;
+          std::string originatorId;
+          std::string primaryLogId;
+          std::string entryType;
+          log_entry::OriginatorTypes originatorType =
+              log_entry::OriginatorTypes::Internal;
 
-            parseDumpEntryFromDbusObject(
-                objectPath, dumpStatus, size, timestampUs, originatorId,
-                originatorType, entryType, primaryLogId, asyncResp);
+          parseDumpEntryFromDbusObject(
+              objectPath, dumpStatus, size, timestampUs, originatorId,
+              originatorType, entryType, primaryLogId, asyncResp);
 
-            if (dumpStatus !=
-                    "xyz.openbmc_project.Common.Progress.OperationStatus.Completed" &&
-                !dumpStatus.empty())
-            {
-                // Dump status is not Complete
-                // return not found until status is changed to Completed
-                messages::resourceNotFound(
-                    asyncResp->res, dumpTypeToString(dump.type) + " dump",
-                    entryID);
-                return;
-            }
+          if (dumpStatus !=
+                  "xyz.openbmc_project.Common.Progress.OperationStatus."
+                  "Completed" &&
+              !dumpStatus.empty()) {
+            // Dump status is not Complete
+            // return not found until status is changed to Completed
+            messages::resourceNotFound(
+                asyncResp->res, dumpTypeToString(dump.type) + " dump", entryID);
+            return;
+          }
 
-            asyncResp->res.jsonValue["@odata.type"] =
-                "#LogEntry.v1_11_0.LogEntry";
-            asyncResp->res.jsonValue["@odata.id"] = entriesPath + entryID;
-            asyncResp->res.jsonValue["Id"] = entryID;
-            asyncResp->res.jsonValue["EntryType"] = "Event";
-            asyncResp->res.jsonValue["Name"] =
-                dumpTypeToString(dump.type) + " Dump Entry";
+          asyncResp->res.jsonValue["@odata.type"] =
+              "#LogEntry.v1_11_0.LogEntry";
+          asyncResp->res.jsonValue["@odata.id"] = entriesPath + entryID;
+          asyncResp->res.jsonValue["Id"] = entryID;
+          asyncResp->res.jsonValue["EntryType"] = "Event";
+          asyncResp->res.jsonValue["Name"] =
+              dumpTypeToString(dump.type) + " Dump Entry";
+          asyncResp->res.jsonValue["Created"] =
+              redfish::time_utils::getDateTimeUintUs(timestampUs);
+
+          if (!originatorId.empty()) {
+            asyncResp->res.jsonValue["Originator"] = originatorId;
+            asyncResp->res.jsonValue["OriginatorType"] = originatorType;
+          }
+
+          if (dump.type == DumpType::BMC_DUMP) {
+            asyncResp->res.jsonValue["DiagnosticDataType"] = "Manager";
+            asyncResp->res.jsonValue["AdditionalDataURI"] =
+                entriesPath + entryID + "/attachment";
+            asyncResp->res.jsonValue["AdditionalDataSizeBytes"] = size;
+          } else if (dump.type == DumpType::BMC_FAULT_LOG ||
+                     dump.type == DumpType::SYSTEM_FAULT_LOG) {
             asyncResp->res.jsonValue["Created"] =
                 redfish::time_utils::getDateTimeUintUs(timestampUs);
+            asyncResp->res.jsonValue["DiagnosticDataType"] = "OEM";
+            asyncResp->res.jsonValue["OEMDiagnosticDataType"] =
+                "OpenBMC Fault Log";
+            asyncResp->res.jsonValue["EntryType"] = "Oem";
 
-            if (!originatorId.empty())
-            {
-                asyncResp->res.jsonValue["Originator"] = originatorId;
-                asyncResp->res.jsonValue["OriginatorType"] = originatorType;
-            }
+            std::string systemPathSegment =
+                dump.systemName ? *dump.systemName : "system";
 
-            if (dump.type == DumpType::BMC_DUMP)
-            {
-                asyncResp->res.jsonValue["DiagnosticDataType"] = "Manager";
+            if (entryType == "CPER") {
+              if (absl::StrContains(primaryLogId, "/Entries/")) {
+                // This is for backward compatibility; we can remove it
+                // later.
                 asyncResp->res.jsonValue["AdditionalDataURI"] =
-                    entriesPath + entryID + "/attachment";
-                asyncResp->res.jsonValue["AdditionalDataSizeBytes"] = size;
-            }
-            else if (dump.type == DumpType::BMC_FAULT_LOG ||
-                     dump.type == DumpType::SYSTEM_FAULT_LOG)
-            {
-                asyncResp->res.jsonValue["Created"] =
-                    redfish::time_utils::getDateTimeUintUs(timestampUs);
-                asyncResp->res.jsonValue["DiagnosticDataType"] = "OEM";
-                asyncResp->res.jsonValue["OEMDiagnosticDataType"] =
-                    "OpenBMC Fault Log";
-                asyncResp->res.jsonValue["EntryType"] = "Oem";
-
-                std::string systemPathSegment =
-                    dump.systemName ? *dump.systemName : "system";
-
-                if (entryType == "CPER")
-                {
-                    if (absl::StrContains(primaryLogId, "/Entries/"))
-                    {
-                        // This is for backward compatibility; we can remove it
-                        // later.
-                        asyncResp->res.jsonValue["AdditionalDataURI"] =
-                            crow::utility::urlFromPieces(
-                                "redfish", "v1", "Systems", systemPathSegment,
-                                "LogServices", primaryLogId);
-                    }
-                    else
-                    {
-                        // Will eventually be changed from AdditionalDataURI to
-                        // OriginOfCondition Link
-                        asyncResp->res.jsonValue["AdditionalDataURI"] =
-#ifdef BMCWEB_ENABLE_CPER_CRASHDUMP_USE_FAULTLOG_ID
-                            crow::utility::urlFromPieces(
-                                "redfish", "v1", "Systems", systemPathSegment,
-                                "LogServices",
-                                std::string(hostCperLogServiceName), "Entries",
-                                entryID);
-#else
-                            crow::utility::urlFromPieces(
-                                "redfish", "v1", "Systems", systemPathSegment,
-                                "LogServices",
-                                std::string(hostCperLogServiceName), "Entries",
-                                primaryLogId);
-#endif
-                    }
-                    asyncResp->res.jsonValue["OemRecordFormat"] = "CPER";
-                }
-                else if (entryType == "Crashdump")
-                {
-                    asyncResp->res.jsonValue["AdditionalDataURI"] =
-#ifdef BMCWEB_ENABLE_CPER_CRASHDUMP_USE_FAULTLOG_ID
-                        crow::utility::urlFromPieces(
-                            "redfish", "v1", "Systems", systemPathSegment,
-                            "LogServices", "Crashdump", "Entries", entryID);
-#else
-                        crow::utility::urlFromPieces("redfish", "v1", "Systems",
-                                                     systemPathSegment,
-                                                     "LogServices", "Crashdump",
-                                                     "Entries", primaryLogId);
-#endif
-                    asyncResp->res.jsonValue["OemRecordFormat"] = "Crashdump";
-                }
-                // entryType must be of CPER or CrashDump or else accessing
-                // thisEntry["AdditionalDataURI"] becomes undefined behavior
-                else
-                {
-                    BMCWEB_LOG_ERROR << "entryType of faultLog is invalid";
-                    messages::internalError(asyncResp->res);
-                    return;
-                }
-
-                // Also export a RelatedLogEntry link to the AdditionalDataURI.
-                asyncResp->res.jsonValue["Links"]["RelatedLogEntries"] =
-                    nlohmann::json::array();
-                nlohmann::json::object_t relatedLogEntry;
-                relatedLogEntry["@odata.id"] =
-                    asyncResp->res.jsonValue["AdditionalDataURI"];
-                asyncResp->res.jsonValue["Links"]["RelatedLogEntries"]
-                    .emplace_back(relatedLogEntry);
-            }
-            else if (dump.type == DumpType::SYSTEM_DUMP)
-            {
-                asyncResp->res.jsonValue["DiagnosticDataType"] = "OEM";
-                asyncResp->res.jsonValue["OEMDiagnosticDataType"] = "System";
+                    crow::utility::urlFromPieces("redfish", "v1", "Systems",
+                                                 systemPathSegment,
+                                                 "LogServices", primaryLogId);
+              } else {
+                // Will eventually be changed from AdditionalDataURI to
+                // OriginOfCondition Link
                 asyncResp->res.jsonValue["AdditionalDataURI"] =
-                    entriesPath + entryID + "/attachment";
-                asyncResp->res.jsonValue["AdditionalDataSizeBytes"] = size;
+#ifdef BMCWEB_ENABLE_CPER_CRASHDUMP_USE_FAULTLOG_ID
+                    crow::utility::urlFromPieces(
+                        "redfish", "v1", "Systems", systemPathSegment,
+                        "LogServices", std::string(hostCperLogServiceName),
+                        "Entries", entryID);
+#else
+                    crow::utility::urlFromPieces(
+                        "redfish", "v1", "Systems", systemPathSegment,
+                        "LogServices", std::string(hostCperLogServiceName),
+                        "Entries", primaryLogId);
+#endif
+              }
+              asyncResp->res.jsonValue["OemRecordFormat"] = "CPER";
+            } else if (entryType == "Crashdump") {
+              asyncResp->res.jsonValue["AdditionalDataURI"] =
+#ifdef BMCWEB_ENABLE_CPER_CRASHDUMP_USE_FAULTLOG_ID
+                  crow::utility::urlFromPieces("redfish", "v1", "Systems",
+                                               systemPathSegment, "LogServices",
+                                               "Crashdump", "Entries", entryID);
+#else
+                  crow::utility::urlFromPieces(
+                      "redfish", "v1", "Systems", systemPathSegment,
+                      "LogServices", "Crashdump", "Entries", primaryLogId);
+#endif
+              asyncResp->res.jsonValue["OemRecordFormat"] = "Crashdump";
+            } else {
+              // entryType must be of CPER or CrashDump or else accessing
+              // thisEntry["AdditionalDataURI"] becomes undefined behavior
+              BMCWEB_LOG_ERROR << "entryType of faultLog is invalid";
+              messages::internalError(asyncResp->res);
+              return;
             }
+
+            // Also export a RelatedLogEntry link to the AdditionalDataURI.
+            asyncResp->res.jsonValue["Links"]["RelatedLogEntries"] =
+                nlohmann::json::array();
+            nlohmann::json::object_t relatedLogEntry;
+            relatedLogEntry["@odata.id"] =
+                asyncResp->res.jsonValue["AdditionalDataURI"];
+            asyncResp->res.jsonValue["Links"]["RelatedLogEntries"].emplace_back(
+                relatedLogEntry);
+          } else if (dump.type == DumpType::SYSTEM_DUMP) {
+            asyncResp->res.jsonValue["DiagnosticDataType"] = "OEM";
+            asyncResp->res.jsonValue["OEMDiagnosticDataType"] = "System";
+            asyncResp->res.jsonValue["AdditionalDataURI"] =
+                entriesPath + entryID + "/attachment";
+            asyncResp->res.jsonValue["AdditionalDataSizeBytes"] = size;
+          }
         }
-        if (!foundDumpEntry)
-        {
-            BMCWEB_LOG_ERROR << "Can't find Dump Entry";
-            messages::internalError(asyncResp->res);
-            return;
+        if (!foundDumpEntry) {
+          BMCWEB_LOG_ERROR << "Can't find Dump Entry";
+          messages::internalError(asyncResp->res);
+          return;
         }
-    });
+      });
 }
 
 inline void deleteDumpEntry(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                            const std::string& entryID, const Dump& dump)
-{
-    auto respHandler = [asyncResp,
-                        entryID](const boost::system::error_code& ec) {
-        BMCWEB_LOG_DEBUG << "Dump Entry doDelete callback: Done";
-        if (ec)
-        {
-            if (ec.value() == EBADR)
-            {
-                messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
-                return;
-            }
-            BMCWEB_LOG_ERROR << "Dump (DBus) doDelete respHandler got error "
-                             << ec << " entryID=" << entryID;
-            messages::internalError(asyncResp->res);
-            return;
-        }
-    };
-
-    std::optional<std::string> dumpEntryPath = getDumpEntryPathFromDump(dump);
-
-    if (!dumpEntryPath)
-    {
-        BMCWEB_LOG_ERROR << "Cant convert system "
-                         << dump.systemName.value_or("None")
-                         << "to dumpEntryPath";
-        messages::internalError(asyncResp->res);
+                            const std::string& entryID, const Dump& dump) {
+  auto respHandler = [asyncResp, entryID](const boost::system::error_code& ec) {
+    BMCWEB_LOG_DEBUG << "Dump Entry doDelete callback: Done";
+    if (ec) {
+      if (ec.value() == EBADR) {
+        messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
         return;
+      }
+      BMCWEB_LOG_ERROR << "Dump (DBus) doDelete respHandler got error " << ec
+                       << " entryID=" << entryID;
+      messages::internalError(asyncResp->res);
+      return;
     }
+  };
 
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        respHandler, "xyz.openbmc_project.Dump.Manager",
-        *dumpEntryPath + entryID, "xyz.openbmc_project.Object.Delete",
-        "Delete");
+  std::optional<std::string> dumpEntryPath = getDumpEntryPathFromDump(dump);
+
+  if (!dumpEntryPath) {
+    BMCWEB_LOG_ERROR << "Cant convert system "
+                     << dump.systemName.value_or("None") << "to dumpEntryPath";
+    messages::internalError(asyncResp->res);
+    return;
+  }
+
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_, respHandler, "xyz.openbmc_project.Dump.Manager",
+      *dumpEntryPath + entryID, "xyz.openbmc_project.Object.Delete", "Delete");
 }
 
 constexpr const char* dumpsFolderBasePath =
     "/var/lib/phosphor-debug-collector/dumps";
 
 inline bool getDumpFiles(crow::Response& resp, const std::string& dumpFilePath,
-                         std::vector<std::filesystem::path>& dumpFiles)
-{
-    std::error_code ec;
-    std::filesystem::directory_iterator logPath(dumpFilePath, ec);
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << ec.message();
-        if (ec.value() == ENOENT)
-        {
-            // The directory didn't exist
-            messages::resourceNotFound(resp, "", "");
-        }
-        else
-        {
-            messages::internalError(resp);
-        }
-        return false;
+                         std::vector<std::filesystem::path>& dumpFiles) {
+  std::error_code ec;
+  std::filesystem::directory_iterator logPath(dumpFilePath, ec);
+  if (ec) {
+    BMCWEB_LOG_ERROR << ec.message();
+    if (ec.value() == ENOENT) {
+      // The directory didn't exist
+      messages::resourceNotFound(resp, "", "");
+    } else {
+      messages::internalError(resp);
     }
+    return false;
+  }
 
-    for (const std::filesystem::directory_entry& it : logPath)
-    {
-        std::string filename = it.path().filename();
-        dumpFiles.emplace_back(it.path());
-    }
+  for (const std::filesystem::directory_entry& it : logPath) {
+    std::string filename = it.path().filename();
+    dumpFiles.emplace_back(it.path());
+  }
 
-    return true;
+  return true;
 }
 
-inline void
-    downloadDumpEntry(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                      const std::string& entryID, const Dump& dump)
-{
-    if (dump.type != DumpType::BMC_DUMP)
-    {
-        // We don't know for sure what resource was originally queried
-        messages::resourceNotFound(asyncResp->res, "", "");
-        return;
-    }
+inline void downloadDumpEntry(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& entryID, const Dump& dump) {
+  if (dump.type != DumpType::BMC_DUMP) {
+    // We don't know for sure what resource was originally queried
+    messages::resourceNotFound(asyncResp->res, "", "");
+    return;
+  }
 
-    std::string dumpFolderPath = dumpsFolderBasePath;
-    dumpFolderPath += "/" + entryID;
-    std::vector<std::filesystem::path> dumpFiles;
-    if (!getDumpFiles(asyncResp->res, dumpFolderPath, dumpFiles))
-    {
-        // getDumpFiles() will have already written the error to the response
-        BMCWEB_LOG_ERROR << "failed to get host log file path";
-        return;
-    }
+  std::string dumpFolderPath = dumpsFolderBasePath;
+  dumpFolderPath += "/" + entryID;
+  std::vector<std::filesystem::path> dumpFiles;
+  if (!getDumpFiles(asyncResp->res, dumpFolderPath, dumpFiles)) {
+    // getDumpFiles() will have already written the error to the response
+    BMCWEB_LOG_ERROR << "failed to get host log file path";
+    return;
+  }
 
-    if (dumpFiles.size() != 1)
-    {
-        BMCWEB_LOG_ERROR << "Expected 1 dump file, found " << dumpFiles.size()
-                         << " dump files";
-        messages::internalError(asyncResp->res);
-        return;
-    }
+  if (dumpFiles.size() != 1) {
+    BMCWEB_LOG_ERROR << "Expected 1 dump file, found " << dumpFiles.size()
+                     << " dump files";
+    messages::internalError(asyncResp->res);
+    return;
+  }
 
-    const std::string& dumpFile = dumpFiles.front().string();
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
-    int fd = open(dumpFile.c_str(), O_RDONLY);
-    if (fd < 0)
-    {
-        BMCWEB_LOG_ERROR << "Failed to open dump file!";
-        messages::internalError(asyncResp->res);
-        return;
-    }
+  const std::string& dumpFile = dumpFiles.front().string();
+  // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
+  int fd = open(dumpFile.c_str(), O_RDONLY);
+  if (fd < 0) {
+    BMCWEB_LOG_ERROR << "Failed to open dump file!";
+    messages::internalError(asyncResp->res);
+    return;
+  }
 
-    int64_t size = lseek(fd, 0, SEEK_END);
-    if (size == -1)
-    {
-        messages::internalError(asyncResp->res);
-        return;
-    }
+  int64_t size = lseek(fd, 0, SEEK_END);
+  if (size == -1) {
+    messages::internalError(asyncResp->res);
+    return;
+  }
 
-    // Arbitrary max size of 8MB
-    constexpr int maxFileSize = 8 * 1024 * 1024;
-    if (size > maxFileSize)
-    {
-        BMCWEB_LOG_ERROR << "File size " << size
-                         << " exceeds maximum allowed size of " << maxFileSize;
-        messages::internalError(asyncResp->res);
-    }
-    std::vector<char> data(static_cast<size_t>(size));
-    int64_t rc = lseek(fd, 0, SEEK_SET);
-    if (rc == -1)
-    {
-        messages::internalError(asyncResp->res);
-        return;
-    }
-    rc = read(fd, data.data(), data.size());
-    if ((rc == -1) || (rc != size))
-    {
-        messages::internalError(asyncResp->res);
-        return;
-    }
-    close(fd);
+  // Arbitrary max size of 8MB
+  constexpr int maxFileSize = 8 * 1024 * 1024;
+  if (size > maxFileSize) {
+    BMCWEB_LOG_ERROR << "File size " << size
+                     << " exceeds maximum allowed size of " << maxFileSize;
+    messages::internalError(asyncResp->res);
+  }
+  std::vector<char> data(static_cast<size_t>(size));
+  int64_t rc = lseek(fd, 0, SEEK_SET);
+  if (rc == -1) {
+    messages::internalError(asyncResp->res);
+    return;
+  }
+  rc = read(fd, data.data(), data.size());
+  if ((rc == -1) || (rc != size)) {
+    messages::internalError(asyncResp->res);
+    return;
+  }
+  close(fd);
 
-    std::string_view strData(data.data(), data.size());
-    std::string output(strData);
-    asyncResp->res.addHeader(boost::beast::http::field::content_type,
-                             "application/octet-stream");
-    asyncResp->res.body() = std::move(output);
+  std::string_view strData(data.data(), data.size());
+  std::string output(strData);
+  asyncResp->res.addHeader(boost::beast::http::field::content_type,
+                           "application/octet-stream");
+  asyncResp->res.body() = std::move(output);
 }
 
-inline DumpCreationProgress
-    mapDbusStatusToDumpProgress(const std::string& status)
-{
-    if (status ==
-            "xyz.openbmc_project.Common.Progress.OperationStatus.Failed" ||
-        status == "xyz.openbmc_project.Common.Progress.OperationStatus.Aborted")
-    {
+inline DumpCreationProgress mapDbusStatusToDumpProgress(
+    const std::string& status) {
+  if (status == "xyz.openbmc_project.Common.Progress.OperationStatus.Failed" ||
+      status == "xyz.openbmc_project.Common.Progress.OperationStatus.Aborted") {
+    return DumpCreationProgress::DUMP_CREATE_FAILED;
+  }
+  if (status ==
+      "xyz.openbmc_project.Common.Progress.OperationStatus.Completed") {
+    return DumpCreationProgress::DUMP_CREATE_SUCCESS;
+  }
+  return DumpCreationProgress::DUMP_CREATE_INPROGRESS;
+}
+
+inline DumpCreationProgress getDumpCompletionStatus(
+    const dbus::utility::DBusPropertiesMap& values) {
+  for (const auto& [key, val] : values) {
+    if (key == "Status") {
+      const std::string* value = std::get_if<std::string>(&val);
+      if (value == nullptr) {
+        BMCWEB_LOG_ERROR << "Status property value is null";
         return DumpCreationProgress::DUMP_CREATE_FAILED;
+      }
+      return mapDbusStatusToDumpProgress(*value);
     }
-    if (status ==
-        "xyz.openbmc_project.Common.Progress.OperationStatus.Completed")
-    {
-        return DumpCreationProgress::DUMP_CREATE_SUCCESS;
-    }
-    return DumpCreationProgress::DUMP_CREATE_INPROGRESS;
+  }
+  return DumpCreationProgress::DUMP_CREATE_INPROGRESS;
 }
 
-inline DumpCreationProgress
-    getDumpCompletionStatus(const dbus::utility::DBusPropertiesMap& values)
-{
-    for (const auto& [key, val] : values)
-    {
-        if (key == "Status")
-        {
-            const std::string* value = std::get_if<std::string>(&val);
-            if (value == nullptr)
-            {
-                BMCWEB_LOG_ERROR << "Status property value is null";
-                return DumpCreationProgress::DUMP_CREATE_FAILED;
-            }
-            return mapDbusStatusToDumpProgress(*value);
-        }
-    }
-    return DumpCreationProgress::DUMP_CREATE_INPROGRESS;
-}
-
-inline std::string getDumpEntryPath(const std::string& dumpPath)
-{
-    if (dumpPath == "/xyz/openbmc_project/dump/bmc/entry")
-    {
-        return "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/";
-    }
-    if (dumpPath == "/xyz/openbmc_project/dump/system/entry")
-    {
-        return "/redfish/v1/Systems/system/LogServices/Dump/Entries/";
-    }
-    return "";
+inline std::string getDumpEntryPath(const std::string& dumpPath) {
+  if (dumpPath == "/xyz/openbmc_project/dump/bmc/entry") {
+    return "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/";
+  }
+  if (dumpPath == "/xyz/openbmc_project/dump/system/entry") {
+    return "/redfish/v1/Systems/system/LogServices/Dump/Entries/";
+  }
+  return "";
 }
 
 inline void createDumpTaskCallback(
     task::Payload&& payload,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const sdbusplus::message::object_path& createdObjPath)
-{
-    const std::string dumpPath = createdObjPath.parent_path().str;
-    const std::string dumpId = createdObjPath.filename();
+    const sdbusplus::message::object_path& createdObjPath) {
+  const std::string dumpPath = createdObjPath.parent_path().str;
+  const std::string dumpId = createdObjPath.filename();
 
-    std::string dumpEntryPath = getDumpEntryPath(dumpPath);
+  std::string dumpEntryPath = getDumpEntryPath(dumpPath);
 
-    if (dumpEntryPath.empty())
-    {
-        BMCWEB_LOG_ERROR << "Invalid dump type received";
-        messages::internalError(asyncResp->res);
-        return;
-    }
+  if (dumpEntryPath.empty()) {
+    BMCWEB_LOG_ERROR << "Invalid dump type received";
+    messages::internalError(asyncResp->res);
+    return;
+  }
 
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp, payload, createdObjPath,
-         dumpEntryPath{std::move(dumpEntryPath)},
-         dumpId](const boost::system::error_code& ec,
-                 const std::string& introspectXml) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "Introspect call failed with error: "
-                             << ec.message();
-            messages::internalError(asyncResp->res);
-            return;
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp, payload, createdObjPath,
+       dumpEntryPath{std::move(dumpEntryPath)},
+       dumpId](const boost::system::error_code& ec,
+               const std::string& introspectXml) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "Introspect call failed with error: "
+                           << ec.message();
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         // Check if the created dump object has implemented Progress
@@ -1291,83 +1139,75 @@
 
         doc.Parse(introspectXml.data(), introspectXml.size());
         tinyxml2::XMLNode* pRoot = doc.FirstChildElement("node");
-        if (pRoot == nullptr)
-        {
-            BMCWEB_LOG_ERROR << "XML document failed to parse";
-            messages::internalError(asyncResp->res);
-            return;
+        if (pRoot == nullptr) {
+          BMCWEB_LOG_ERROR << "XML document failed to parse";
+          messages::internalError(asyncResp->res);
+          return;
         }
         tinyxml2::XMLElement* interfaceNode =
             pRoot->FirstChildElement("interface");
 
         bool isProgressIntfPresent = false;
-        while (interfaceNode != nullptr)
-        {
-            const char* thisInterfaceName = interfaceNode->Attribute("name");
-            if (thisInterfaceName != nullptr)
-            {
-                if (thisInterfaceName ==
-                    std::string_view("xyz.openbmc_project.Common.Progress"))
-                {
-                    interfaceNode =
-                        interfaceNode->NextSiblingElement("interface");
-                    continue;
-                }
-                isProgressIntfPresent = true;
-                break;
+        while (interfaceNode != nullptr) {
+          const char* thisInterfaceName = interfaceNode->Attribute("name");
+          if (thisInterfaceName != nullptr) {
+            if (thisInterfaceName ==
+                std::string_view("xyz.openbmc_project.Common.Progress")) {
+              interfaceNode = interfaceNode->NextSiblingElement("interface");
+              continue;
             }
-            interfaceNode = interfaceNode->NextSiblingElement("interface");
+            isProgressIntfPresent = true;
+            break;
+          }
+          interfaceNode = interfaceNode->NextSiblingElement("interface");
         }
 
         std::shared_ptr<task::TaskData> task = task::TaskData::createTask(
             [createdObjPath, dumpEntryPath, dumpId, isProgressIntfPresent](
                 const boost::system::error_code& err, sdbusplus::message_t& msg,
                 const std::shared_ptr<task::TaskData>& taskData) {
-            if (err)
-            {
+              if (err) {
                 BMCWEB_LOG_ERROR << createdObjPath.str
                                  << ": Error in creating dump";
                 taskData->messages.emplace_back(messages::internalError());
                 taskData->state = "Cancelled";
                 return task::completed;
-            }
+              }
 
-            if (isProgressIntfPresent)
-            {
+              if (isProgressIntfPresent) {
                 dbus::utility::DBusPropertiesMap values;
                 std::string prop;
                 msg.read(prop, values);
 
                 DumpCreationProgress dumpStatus =
                     getDumpCompletionStatus(values);
-                if (dumpStatus == DumpCreationProgress::DUMP_CREATE_FAILED)
-                {
-                    BMCWEB_LOG_ERROR << createdObjPath.str
-                                     << ": Error in creating dump";
-                    taskData->state = "Cancelled";
-                    return task::completed;
+                if (dumpStatus == DumpCreationProgress::DUMP_CREATE_FAILED) {
+                  BMCWEB_LOG_ERROR << createdObjPath.str
+                                   << ": Error in creating dump";
+                  taskData->state = "Cancelled";
+                  return task::completed;
                 }
 
-                if (dumpStatus == DumpCreationProgress::DUMP_CREATE_INPROGRESS)
-                {
-                    BMCWEB_LOG_DEBUG << createdObjPath.str
-                                     << ": Dump creation task is in progress";
-                    return !task::completed;
+                if (dumpStatus ==
+                    DumpCreationProgress::DUMP_CREATE_INPROGRESS) {
+                  BMCWEB_LOG_DEBUG << createdObjPath.str
+                                   << ": Dump creation task is in progress";
+                  return !task::completed;
                 }
-            }
+              }
 
-            nlohmann::json retMessage = messages::success();
-            taskData->messages.emplace_back(retMessage);
+              nlohmann::json retMessage = messages::success();
+              taskData->messages.emplace_back(retMessage);
 
-            std::string headerLoc =
-                "Location: " + dumpEntryPath + http_helpers::urlEncode(dumpId);
-            taskData->payload->httpHeaders.emplace_back(std::move(headerLoc));
+              std::string headerLoc = "Location: " + dumpEntryPath +
+                                      http_helpers::urlEncode(dumpId);
+              taskData->payload->httpHeaders.emplace_back(std::move(headerLoc));
 
-            BMCWEB_LOG_DEBUG << createdObjPath.str
-                             << ": Dump creation task completed";
-            taskData->state = "Completed";
-            return task::completed;
-        },
+              BMCWEB_LOG_DEBUG << createdObjPath.str
+                               << ": Dump creation task completed";
+              taskData->state = "Completed";
+              return task::completed;
+            },
             "type='signal',interface='org.freedesktop.DBus.Properties',"
             "member='PropertiesChanged',path='" +
                 createdObjPath.str + "'");
@@ -1377,383 +1217,342 @@
         task->startTimer(std::chrono::minutes(6));
         task->populateResp(asyncResp->res);
         task->payload.emplace(payload);
-    },
-        "xyz.openbmc_project.Dump.Manager", createdObjPath,
-        "org.freedesktop.DBus.Introspectable", "Introspect");
+      },
+      "xyz.openbmc_project.Dump.Manager", createdObjPath,
+      "org.freedesktop.DBus.Introspectable", "Introspect");
 }
 
 inline void createDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                       const crow::Request& req, const Dump& dump)
-{
-    std::string dumpPath = getDumpEntriesPath(dump);
-    if (dumpPath.empty())
-    {
-        messages::internalError(asyncResp->res);
-        return;
+                       const crow::Request& req, const Dump& dump) {
+  std::string dumpPath = getDumpEntriesPath(dump);
+  if (dumpPath.empty()) {
+    messages::internalError(asyncResp->res);
+    return;
+  }
+
+  std::optional<std::string> diagnosticDataType;
+  std::optional<std::string> oemDiagnosticDataType;
+
+  if (!redfish::json_util::readJsonAction(
+          req, asyncResp->res, "DiagnosticDataType", diagnosticDataType,
+          "OEMDiagnosticDataType", oemDiagnosticDataType)) {
+    return;
+  }
+
+  if (dump.type == DumpType::SYSTEM_DUMP) {
+    if (!oemDiagnosticDataType || !diagnosticDataType) {
+      BMCWEB_LOG_ERROR
+          << "CreateDump action parameter "
+             "'DiagnosticDataType'/'OEMDiagnosticDataType' value not found!";
+      messages::actionParameterMissing(
+          asyncResp->res, "CollectDiagnosticData",
+          "DiagnosticDataType & OEMDiagnosticDataType");
+      return;
     }
-
-    std::optional<std::string> diagnosticDataType;
-    std::optional<std::string> oemDiagnosticDataType;
-
-    if (!redfish::json_util::readJsonAction(
-            req, asyncResp->res, "DiagnosticDataType", diagnosticDataType,
-            "OEMDiagnosticDataType", oemDiagnosticDataType))
-    {
-        return;
+    if ((*oemDiagnosticDataType != "System") ||
+        (*diagnosticDataType != "OEM")) {
+      BMCWEB_LOG_ERROR << "Wrong parameter values passed";
+      messages::internalError(asyncResp->res);
+      return;
     }
+    dumpPath = "/redfish/v1/Systems/system/LogServices/Dump/";
+  } else if (dump.type == DumpType::BMC_DUMP) {
+    if (!diagnosticDataType) {
+      BMCWEB_LOG_ERROR
+          << "CreateDump action parameter 'DiagnosticDataType' not found!";
+      messages::actionParameterMissing(asyncResp->res, "CollectDiagnosticData",
+                                       "DiagnosticDataType");
+      return;
+    }
+    if (*diagnosticDataType != "Manager") {
+      BMCWEB_LOG_ERROR
+          << "Wrong parameter value passed for 'DiagnosticDataType'";
+      messages::internalError(asyncResp->res);
+      return;
+    }
+    dumpPath = "/redfish/v1/Managers/bmc/LogServices/Dump/";
+  } else {
+    BMCWEB_LOG_ERROR << "CreateDump failed. Unknown dump type";
+    messages::internalError(asyncResp->res);
+    return;
+  }
 
-    if (dump.type == DumpType::SYSTEM_DUMP)
-    {
-        if (!oemDiagnosticDataType || !diagnosticDataType)
-        {
-            BMCWEB_LOG_ERROR
-                << "CreateDump action parameter 'DiagnosticDataType'/'OEMDiagnosticDataType' value not found!";
-            messages::actionParameterMissing(
-                asyncResp->res, "CollectDiagnosticData",
-                "DiagnosticDataType & OEMDiagnosticDataType");
-            return;
-        }
-        if ((*oemDiagnosticDataType != "System") ||
-            (*diagnosticDataType != "OEM"))
-        {
-            BMCWEB_LOG_ERROR << "Wrong parameter values passed";
+  std::vector<std::pair<std::string, std::variant<std::string, uint64_t>>>
+      createDumpParamVec;
+
+  if (req.session != nullptr) {
+    createDumpParamVec.emplace_back(
+        "xyz.openbmc_project.Dump.Create.CreateParameters.OriginatorId",
+        req.session->clientIp);
+    createDumpParamVec.emplace_back(
+        "xyz.openbmc_project.Dump.Create.CreateParameters.OriginatorType",
+        "xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes.Client");
+  }
+
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp, payload(task::Payload(req)), dumpPath](
+          const boost::system::error_code& ec, const sdbusplus::message_t& msg,
+          const sdbusplus::message::object_path& objPath) mutable {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "CreateDump resp_handler got error " << ec;
+          const sd_bus_error* dbusError = msg.get_error();
+          if (dbusError == nullptr) {
             messages::internalError(asyncResp->res);
             return;
-        }
-        dumpPath = "/redfish/v1/Systems/system/LogServices/Dump/";
-    }
-    else if (dump.type == DumpType::BMC_DUMP)
-    {
-        if (!diagnosticDataType)
-        {
-            BMCWEB_LOG_ERROR
-                << "CreateDump action parameter 'DiagnosticDataType' not found!";
-            messages::actionParameterMissing(
-                asyncResp->res, "CollectDiagnosticData", "DiagnosticDataType");
+          }
+
+          BMCWEB_LOG_ERROR << "CreateDump DBus error: " << dbusError->name
+                           << " and error msg: " << dbusError->message;
+          if (std::string_view("xyz.openbmc_project.Common.Error.NotAllowed") ==
+              dbusError->name) {
+            messages::resourceInStandby(asyncResp->res);
             return;
-        }
-        if (*diagnosticDataType != "Manager")
-        {
-            BMCWEB_LOG_ERROR
-                << "Wrong parameter value passed for 'DiagnosticDataType'";
-            messages::internalError(asyncResp->res);
+          }
+          if (std::string_view(
+                  "xyz.openbmc_project.Dump.Create.Error.Disabled") ==
+              dbusError->name) {
+            messages::serviceDisabled(asyncResp->res, dumpPath);
             return;
-        }
-        dumpPath = "/redfish/v1/Managers/bmc/LogServices/Dump/";
-    }
-    else
-    {
-        BMCWEB_LOG_ERROR << "CreateDump failed. Unknown dump type";
-        messages::internalError(asyncResp->res);
-        return;
-    }
-
-    std::vector<std::pair<std::string, std::variant<std::string, uint64_t>>>
-        createDumpParamVec;
-
-    if (req.session != nullptr)
-    {
-        createDumpParamVec.emplace_back(
-            "xyz.openbmc_project.Dump.Create.CreateParameters.OriginatorId",
-            req.session->clientIp);
-        createDumpParamVec.emplace_back(
-            "xyz.openbmc_project.Dump.Create.CreateParameters.OriginatorType",
-            "xyz.openbmc_project.Common.OriginatedBy.OriginatorTypes.Client");
-    }
-
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp, payload(task::Payload(req)),
-         dumpPath](const boost::system::error_code& ec,
-                   const sdbusplus::message_t& msg,
-                   const sdbusplus::message::object_path& objPath) mutable {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "CreateDump resp_handler got error " << ec;
-            const sd_bus_error* dbusError = msg.get_error();
-            if (dbusError == nullptr)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-
-            BMCWEB_LOG_ERROR << "CreateDump DBus error: " << dbusError->name
-                             << " and error msg: " << dbusError->message;
-            if (std::string_view(
-                    "xyz.openbmc_project.Common.Error.NotAllowed") ==
-                dbusError->name)
-            {
-                messages::resourceInStandby(asyncResp->res);
-                return;
-            }
-            if (std::string_view(
-                    "xyz.openbmc_project.Dump.Create.Error.Disabled") ==
-                dbusError->name)
-            {
-                messages::serviceDisabled(asyncResp->res, dumpPath);
-                return;
-            }
-            if (std::string_view(
-                    "xyz.openbmc_project.Common.Error.Unavailable") ==
-                dbusError->name)
-            {
-                messages::resourceInUse(asyncResp->res);
-                return;
-            }
-            // Other Dbus errors such as:
-            // xyz.openbmc_project.Common.Error.InvalidArgument &
-            // org.freedesktop.DBus.Error.InvalidArgs are all related to
-            // the dbus call that is made here in the bmcweb
-            // implementation and has nothing to do with the client's
-            // input in the request. Hence, returning internal error
-            // back to the client.
-            messages::internalError(asyncResp->res);
+          }
+          if (std::string_view(
+                  "xyz.openbmc_project.Common.Error.Unavailable") ==
+              dbusError->name) {
+            messages::resourceInUse(asyncResp->res);
             return;
+          }
+          // Other Dbus errors such as:
+          // xyz.openbmc_project.Common.Error.InvalidArgument &
+          // org.freedesktop.DBus.Error.InvalidArgs are all related to
+          // the dbus call that is made here in the bmcweb
+          // implementation and has nothing to do with the client's
+          // input in the request. Hence, returning internal error
+          // back to the client.
+          messages::internalError(asyncResp->res);
+          return;
         }
         BMCWEB_LOG_DEBUG << "Dump Created. Path: " << objPath.str;
         createDumpTaskCallback(std::move(payload), asyncResp, objPath);
-    },
-        "xyz.openbmc_project.Dump.Manager",
-        "/xyz/openbmc_project/dump/" +
-            std::string(
-                boost::algorithm::to_lower_copy(dumpTypeToString(dump.type))),
-        "xyz.openbmc_project.Dump.Create", "CreateDump", createDumpParamVec);
+      },
+      "xyz.openbmc_project.Dump.Manager",
+      "/xyz/openbmc_project/dump/" +
+          std::string(
+              boost::algorithm::to_lower_copy(dumpTypeToString(dump.type))),
+      "xyz.openbmc_project.Dump.Create", "CreateDump", createDumpParamVec);
 }
 
-inline std::optional<std::string> getDumpManagerCollectionPath(const Dump& dump)
-{
-    if (!dump.systemName || *dump.systemName == "system")
-    {
-        return "/xyz/openbmc_project/dump/" +
-               std::string(boost::algorithm::to_lower_copy(
-                   dumpTypeToString(dump.type)));
-    }
+inline std::optional<std::string> getDumpManagerCollectionPath(
+    const Dump& dump) {
+  if (!dump.systemName || *dump.systemName == "system") {
+    return "/xyz/openbmc_project/dump/" +
+           std::string(
+               boost::algorithm::to_lower_copy(dumpTypeToString(dump.type)));
+  }
 
-    for (const auto& mapping : systemNameToDumpEntryPath)
-    {
-        if (mapping.first == *dump.systemName)
-        {
-            return std::string(mapping.second);
-        }
+  for (const auto& mapping : systemNameToDumpEntryPath) {
+    if (mapping.first == *dump.systemName) {
+      return std::string(mapping.second);
     }
+  }
 
-    return std::nullopt;
+  return std::nullopt;
 }
 
 inline void clearDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                      const Dump& dump)
-{
-    std::optional<std::string> dumpManagerCollectionPath =
-        getDumpManagerCollectionPath(dump);
+                      const Dump& dump) {
+  std::optional<std::string> dumpManagerCollectionPath =
+      getDumpManagerCollectionPath(dump);
 
-    if (!dumpManagerCollectionPath)
-    {
-        BMCWEB_LOG_ERROR << "Cant get dumpManagerCollectionPath from system "
-                         << dump.systemName.value_or("none");
-        messages::internalError(asyncResp->res);
-        return;
-    }
+  if (!dumpManagerCollectionPath) {
+    BMCWEB_LOG_ERROR << "Cant get dumpManagerCollectionPath from system "
+                     << dump.systemName.value_or("none");
+    messages::internalError(asyncResp->res);
+    return;
+  }
 
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "clearDump resp_handler got error " << ec;
-            messages::internalError(asyncResp->res);
-            return;
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp](const boost::system::error_code& ec) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "clearDump resp_handler got error " << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
-    }, "xyz.openbmc_project.Dump.Manager", *dumpManagerCollectionPath,
-        "xyz.openbmc_project.Collection.DeleteAll", "DeleteAll");
+      },
+      "xyz.openbmc_project.Dump.Manager", *dumpManagerCollectionPath,
+      "xyz.openbmc_project.Collection.DeleteAll", "DeleteAll");
 }
 
-inline static void
-    parseCrashdumpParameters(const dbus::utility::DBusPropertiesMap& params,
-                             std::string& filename, std::string& timestamp,
-                             std::string& logfile)
-{
-    const std::string* filenamePtr = nullptr;
-    const std::string* timestampPtr = nullptr;
-    const std::string* logfilePtr = nullptr;
+inline static void parseCrashdumpParameters(
+    const dbus::utility::DBusPropertiesMap& params, std::string& filename,
+    std::string& timestamp, std::string& logfile) {
+  const std::string* filenamePtr = nullptr;
+  const std::string* timestampPtr = nullptr;
+  const std::string* logfilePtr = nullptr;
 
-    const bool success = sdbusplus::unpackPropertiesNoThrow(
-        dbus_utils::UnpackErrorPrinter(), params, "Timestamp", timestampPtr,
-        "Filename", filenamePtr, "Log", logfilePtr);
+  const bool success = sdbusplus::unpackPropertiesNoThrow(
+      dbus_utils::UnpackErrorPrinter(), params, "Timestamp", timestampPtr,
+      "Filename", filenamePtr, "Log", logfilePtr);
 
-    if (!success)
-    {
-        return;
-    }
+  if (!success) {
+    return;
+  }
 
-    if (filenamePtr != nullptr)
-    {
-        filename = *filenamePtr;
-    }
+  if (filenamePtr != nullptr) {
+    filename = *filenamePtr;
+  }
 
-    if (timestampPtr != nullptr)
-    {
-        timestamp = *timestampPtr;
-    }
+  if (timestampPtr != nullptr) {
+    timestamp = *timestampPtr;
+  }
 
-    if (logfilePtr != nullptr)
-    {
-        logfile = *logfilePtr;
-    }
+  if (logfilePtr != nullptr) {
+    logfile = *logfilePtr;
+  }
 }
 
-inline void
-    handleLogServices(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                      const std::string& systemPath)
-{
-    // If the systemPath is empty, then the system is single host
-    bool multiHost = !systemPath.empty();
+inline void handleLogServices(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& systemPath) {
+  // If the systemPath is empty, then the system is single host
+  bool multiHost = !systemPath.empty();
 
-    // Default systemName is system and change if system is multi-host
-    std::string systemName = "system";
+  // Default systemName is system and change if system is multi-host
+  std::string systemName = "system";
 
-    if (multiHost)
-    {
-        systemName = sdbusplus::message::object_path(systemPath).filename();
-    }
+  if (multiHost) {
+    systemName = sdbusplus::message::object_path(systemPath).filename();
+  }
 
-    // Collections don't include the static data added by SubRoute
-    // because it has a duplicate entry for members
-    asyncResp->res.jsonValue["@odata.type"] =
-        "#LogServiceCollection.LogServiceCollection";
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/" + systemName + "/LogServices";
-    asyncResp->res.jsonValue["Name"] = "System Log Services Collection";
-    asyncResp->res.jsonValue["Description"] =
-        "Collection of LogServices for this Computer System";
+  // Collections don't include the static data added by SubRoute
+  // because it has a duplicate entry for members
+  asyncResp->res.jsonValue["@odata.type"] =
+      "#LogServiceCollection.LogServiceCollection";
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/" + systemName + "/LogServices";
+  asyncResp->res.jsonValue["Name"] = "System Log Services Collection";
+  asyncResp->res.jsonValue["Description"] =
+      "Collection of LogServices for this Computer System";
 
-    nlohmann::json& logServiceArray = asyncResp->res.jsonValue["Members"];
-    logServiceArray = nlohmann::json::array();
+  nlohmann::json& logServiceArray = asyncResp->res.jsonValue["Members"];
+  logServiceArray = nlohmann::json::array();
 
 #ifdef BMCWEB_ENABLE_REDFISH_HOST_LOGGER
-    nlohmann::json::object_t hostlogger;
-    hostlogger["@odata.id"] =
-        "/redfish/v1/Systems/" + systemName + "/LogServices/HostLogger";
-    logServiceArray.push_back(std::move(hostlogger));
+  nlohmann::json::object_t hostlogger;
+  hostlogger["@odata.id"] =
+      "/redfish/v1/Systems/" + systemName + "/LogServices/HostLogger";
+  logServiceArray.push_back(std::move(hostlogger));
 #endif
 
 #ifdef BMCWEB_ENABLE_REDFISH_SYSTEM_FAULT_LOG
-    nlohmann::json::object_t faultLog;
-    faultLog["@odata.id"] =
-        "/redfish/v1/Systems/" + systemName + "/LogServices/FaultLog";
-    logServiceArray.push_back(std::move(faultLog));
+  nlohmann::json::object_t faultLog;
+  faultLog["@odata.id"] =
+      "/redfish/v1/Systems/" + systemName + "/LogServices/FaultLog";
+  logServiceArray.push_back(std::move(faultLog));
 #endif
 
-    // Similar to the structure of the ComputerSystem Handlers, we will separate
-    // multi-host features and singlehost features.
-    if (!multiHost)
-    {
+  // Similar to the structure of the ComputerSystem Handlers, we will separate
+  // multi-host features and singlehost features.
+  if (!multiHost) {
 #ifdef BMCWEB_ENABLE_REDFISH_EVENT_LOG
-        nlohmann::json::object_t eventLog;
-        eventLog["@odata.id"] =
-            "/redfish/v1/Systems/system/LogServices/EventLog";
-        logServiceArray.push_back(std::move(eventLog));
+    nlohmann::json::object_t eventLog;
+    eventLog["@odata.id"] = "/redfish/v1/Systems/system/LogServices/EventLog";
+    logServiceArray.push_back(std::move(eventLog));
 #endif
 
 #ifdef BMCWEB_ENABLE_RASMANAGER_EVENT_LOG
-        nlohmann::json::object_t rasManagerLog;
-        rasManagerLog["@odata.id"] =
-            "/redfish/v1/Systems/system/LogServices/HostCper";
-        logServiceArray.push_back(std::move(rasManagerLog));
+    nlohmann::json::object_t rasManagerLog;
+    rasManagerLog["@odata.id"] =
+        "/redfish/v1/Systems/system/LogServices/HostCper";
+    logServiceArray.push_back(std::move(rasManagerLog));
 #endif
 
 #ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
-        nlohmann::json::object_t dumpLog;
-        dumpLog["@odata.id"] = "/redfish/v1/Systems/system/LogServices/Dump";
-        logServiceArray.push_back(std::move(dumpLog));
+    nlohmann::json::object_t dumpLog;
+    dumpLog["@odata.id"] = "/redfish/v1/Systems/system/LogServices/Dump";
+    logServiceArray.push_back(std::move(dumpLog));
 #endif
 
 #ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
-        nlohmann::json::object_t crashdump;
-        crashdump["@odata.id"] =
-            "/redfish/v1/Systems/system/LogServices/Crashdump";
-        logServiceArray.push_back(std::move(crashdump));
+    nlohmann::json::object_t crashdump;
+    crashdump["@odata.id"] = "/redfish/v1/Systems/system/LogServices/Crashdump";
+    logServiceArray.push_back(std::move(crashdump));
 #endif
 
 #ifdef BMCWEB_ENABLE_PPR
-        nlohmann::json::object_t ppr;
-        ppr["@odata.id"] =
-            "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair";
-        logServiceArray.push_back(std::move(ppr));
+    nlohmann::json::object_t ppr;
+    ppr["@odata.id"] =
+        "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair";
+    logServiceArray.push_back(std::move(ppr));
 #endif
 
 #ifdef BMCWEB_ENABLE_REDFISH_EXTERNAL_STORER
-        // This is the ExternalStorer integration point
-        for (const auto& instance :
-             external_storer::rememberLogServices()->listInstances())
-        {
-            nlohmann::json::object_t externalStorerInstance;
-            externalStorerInstance["@odata.id"] =
-                "/redfish/v1/Systems/system/LogServices/" + instance;
-            logServiceArray.push_back(std::move(externalStorerInstance));
-        }
+    // This is the ExternalStorer integration point
+    for (const auto& instance :
+         external_storer::rememberLogServices()->listInstances()) {
+      nlohmann::json::object_t externalStorerInstance;
+      externalStorerInstance["@odata.id"] =
+          "/redfish/v1/Systems/system/LogServices/" + instance;
+      logServiceArray.push_back(std::move(externalStorerInstance));
+    }
 #endif
 
 #ifdef BMCWEB_ENABLE_REDFISH_BOOT_TIME_LOG
-        nlohmann::json::object_t bootTime;
-        bootTime["@odata.id"] =
-            "/redfish/v1/Systems/" + systemName + "/LogServices/BootTime";
-        logServiceArray.push_back(std::move(bootTime));
+    nlohmann::json::object_t bootTime;
+    bootTime["@odata.id"] =
+        "/redfish/v1/Systems/" + systemName + "/LogServices/BootTime";
+    logServiceArray.push_back(std::move(bootTime));
 #endif
-        constexpr std::array<std::string_view, 1> interfaces = {
-            "xyz.openbmc_project.State.Boot.PostCode"};
-        managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-        managedStore::GetManagedObjectStore()->getSubTreePaths(
-            "/", 0, interfaces, requestContext,
-            [asyncResp](const boost::system::error_code& ec,
-                        const dbus::utility::MapperGetSubTreePathsResponse&
-                            subtreePath) {
-            if (ec)
-            {
-                BMCWEB_LOG_ERROR << ec;
-                return;
+    constexpr std::array<std::string_view, 1> interfaces = {
+        "xyz.openbmc_project.State.Boot.PostCode"};
+    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+    managedStore::GetManagedObjectStore()->getSubTreePaths(
+        "/", 0, interfaces, requestContext,
+        [asyncResp](
+            const boost::system::error_code& ec,
+            const dbus::utility::MapperGetSubTreePathsResponse& subtreePath) {
+          if (ec) {
+            BMCWEB_LOG_ERROR << ec;
+            return;
+          }
+
+          for (const auto& pathStr : subtreePath) {
+            if (absl::StrContains(pathStr, "PostCode")) {
+              nlohmann::json& logServiceArrayLocal =
+                  asyncResp->res.jsonValue["Members"];
+              nlohmann::json::object_t member;
+              member["@odata.id"] =
+                  "/redfish/v1/Systems/system/LogServices/PostCodes";
+
+              logServiceArrayLocal.push_back(std::move(member));
+
+              asyncResp->res.jsonValue["Members@odata.count"] =
+                  logServiceArrayLocal.size();
+              return;
             }
-
-            for (const auto& pathStr : subtreePath)
-            {
-                if (absl::StrContains(pathStr, "PostCode"))
-                {
-                    nlohmann::json& logServiceArrayLocal =
-                        asyncResp->res.jsonValue["Members"];
-                    nlohmann::json::object_t member;
-                    member["@odata.id"] =
-                        "/redfish/v1/Systems/system/LogServices/PostCodes";
-
-                    logServiceArrayLocal.push_back(std::move(member));
-
-                    asyncResp->res.jsonValue["Members@odata.count"] =
-                        logServiceArrayLocal.size();
-                    return;
-                }
-            }
+          }
         });
-    }
-    asyncResp->res.jsonValue["Members@odata.count"] = logServiceArray.size();
+  }
+  asyncResp->res.jsonValue["Members@odata.count"] = logServiceArray.size();
 }
 
-void requestRoutesSystemLogServiceCollection(App& app)
-{
-    /**
-     * Functions triggers appropriate requests on DBus
-     */
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/")
-        .privileges(redfish::privileges::getLogServiceCollection)
-        .methods(boost::beast::http::verb::get)(
-            [&app](const crow::Request& req,
-                   const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                   const std::string& systemName) {
-        if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-        {
-            return;
-        }
+void requestRoutesSystemLogServiceCollection(App& app) {
+  /**
+   * Functions triggers appropriate requests on DBus
+   */
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/")
+      .privileges(redfish::privileges::getLogServiceCollection)
+      .methods(boost::beast::http::verb::get)(
+          [&app](const crow::Request& req,
+                 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                 const std::string& systemName) {
+            if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+              return;
+            }
 
-        redfish::system_utils::getSystemInformation(asyncResp, systemName,
-                                                    handleLogServices);
-    });
+            redfish::system_utils::getSystemInformation(asyncResp, systemName,
+                                                        handleLogServices);
+          });
 }
 
 constexpr const char* hostLoggerFolderPath = "/var/log/console";
@@ -1762,1353 +1561,1186 @@
 constexpr std::array<std::pair<std::string_view, std::string_view>, 2>
     systemNameToLogPrefix{{{"system1", "S2"}, {"system2", "S1"}}};
 
-inline bool
-    getHostLoggerFiles(const std::string& hostLoggerFilePath,
-                       std::vector<std::filesystem::path>& hostLoggerFiles,
-                       const std::string& systemName, bool multiHost)
-{
-    std::error_code ec;
-    std::filesystem::directory_iterator logPath(hostLoggerFilePath, ec);
-    if (ec)
-    {
-        BMCWEB_LOG_ERROR << ec.message();
-        return false;
+inline bool getHostLoggerFiles(
+    const std::string& hostLoggerFilePath,
+    std::vector<std::filesystem::path>& hostLoggerFiles,
+    const std::string& systemName, bool multiHost) {
+  std::error_code ec;
+  std::filesystem::directory_iterator logPath(hostLoggerFilePath, ec);
+  if (ec) {
+    BMCWEB_LOG_ERROR << ec.message();
+    return false;
+  }
+
+  // Setting default filePrefix is log
+  std::string filePrefix = defaultLogPrefix;
+
+  // For multi-host systems, the prefix will change based on which host
+  if (multiHost) {
+    // Right now we dont have a guarateed and extendable way to determine
+    // which file is for which host. Will hardcode for now and fix later
+    bool systemFound = false;
+    for (const auto& mapping : systemNameToLogPrefix) {
+      if (mapping.first == systemName) {
+        filePrefix += mapping.second;
+        systemFound = true;
+        break;
+      }
     }
 
-    // Setting default filePrefix is log
-    std::string filePrefix = defaultLogPrefix;
-
-    // For multi-host systems, the prefix will change based on which host
-    if (multiHost)
-    {
-        // Right now we dont have a guarateed and extendable way to determine
-        // which file is for which host. Will hardcode for now and fix later
-        bool systemFound = false;
-        for (const auto& mapping : systemNameToLogPrefix)
-        {
-            if (mapping.first == systemName)
-            {
-                filePrefix += mapping.second;
-                systemFound = true;
-                break;
-            }
-        }
-
-        if (!systemFound)
-        {
-            BMCWEB_LOG_ERROR << "Could not find HostLogPrefix for system "
-                             << systemName;
-            return false;
-        }
+    if (!systemFound) {
+      BMCWEB_LOG_ERROR << "Could not find HostLogPrefix for system "
+                       << systemName;
+      return false;
     }
+  }
 
-    for (const std::filesystem::directory_entry& it : logPath)
-    {
-        std::string filename = it.path().filename();
-        // Prefix of each log files is "log". Find the file and save the
-        // path
-        if (filename.starts_with(filePrefix))
-        {
-            hostLoggerFiles.emplace_back(it.path());
-        }
+  for (const std::filesystem::directory_entry& it : logPath) {
+    std::string filename = it.path().filename();
+    // Prefix of each log files is "log". Find the file and save the
+    // path
+    if (filename.starts_with(filePrefix)) {
+      hostLoggerFiles.emplace_back(it.path());
     }
-    // As the log files rotate, they are appended with a ".#" that is higher for
-    // the older logs. Since we start from oldest logs, sort the name in
-    // descending order.
-    std::sort(hostLoggerFiles.rbegin(), hostLoggerFiles.rend(),
-              AlphanumLess<std::string>());
+  }
+  // As the log files rotate, they are appended with a ".#" that is higher for
+  // the older logs. Since we start from oldest logs, sort the name in
+  // descending order.
+  std::sort(hostLoggerFiles.rbegin(), hostLoggerFiles.rend(),
+            AlphanumLess<std::string>());
 
-    return true;
+  return true;
 }
 
 inline bool getHostLoggerEntries(
     const std::vector<std::filesystem::path>& hostLoggerFiles, uint64_t skip,
-    uint64_t top, std::vector<std::string>& logEntries, size_t& logCount)
-{
-    GzFileReader logFile;
+    uint64_t top, std::vector<std::string>& logEntries, size_t& logCount) {
+  GzFileReader logFile;
 
-    // Go though all log files and expose host logs.
-    for (const std::filesystem::path& it : hostLoggerFiles)
-    {
-        if (!logFile.gzGetLines(it.string(), skip, top, logEntries, logCount))
-        {
-            BMCWEB_LOG_ERROR << "fail to expose host logs";
-            return false;
-        }
+  // Go though all log files and expose host logs.
+  for (const std::filesystem::path& it : hostLoggerFiles) {
+    if (!logFile.gzGetLines(it.string(), skip, top, logEntries, logCount)) {
+      BMCWEB_LOG_ERROR << "fail to expose host logs";
+      return false;
     }
-    // Get lastMessage from constructor by getter
-    std::string lastMessage = logFile.getLastMessage();
-    if (!lastMessage.empty())
-    {
-        logCount++;
-        if (logCount > skip && logCount <= (skip + top))
-        {
-            logEntries.push_back(lastMessage);
-        }
+  }
+  // Get lastMessage from constructor by getter
+  std::string lastMessage = logFile.getLastMessage();
+  if (!lastMessage.empty()) {
+    logCount++;
+    if (logCount > skip && logCount <= (skip + top)) {
+      logEntries.push_back(lastMessage);
     }
-    return true;
+  }
+  return true;
 }
 
 inline void fillHostLoggerEntryJson(const std::string& logEntryID,
                                     const std::string& msg,
                                     nlohmann::json::object_t& logEntryJson,
-                                    const std::string& systemName)
-{
-    // Fill in the log entry with the gathered data.
-    logEntryJson["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
-    logEntryJson["@odata.id"] = crow::utility::urlFromPieces(
-        "redfish", "v1", "Systems", systemName, "LogServices", "HostLogger",
-        "Entries", logEntryID);
-    logEntryJson["Name"] = "Host Logger Entry";
-    logEntryJson["Id"] = logEntryID;
-    logEntryJson["Message"] = msg;
-    logEntryJson["EntryType"] = "Oem";
-    logEntryJson["Severity"] = "OK";
-    logEntryJson["OemRecordFormat"] = "Host Logger Entry";
+                                    const std::string& systemName) {
+  // Fill in the log entry with the gathered data.
+  logEntryJson["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
+  logEntryJson["@odata.id"] = crow::utility::urlFromPieces(
+      "redfish", "v1", "Systems", systemName, "LogServices", "HostLogger",
+      "Entries", logEntryID);
+  logEntryJson["Name"] = "Host Logger Entry";
+  logEntryJson["Id"] = logEntryID;
+  logEntryJson["Message"] = msg;
+  logEntryJson["EntryType"] = "Oem";
+  logEntryJson["Severity"] = "OK";
+  logEntryJson["OemRecordFormat"] = "Host Logger Entry";
 }
 
-inline void
-    handleSystemHostLogger(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                           const std::string& systemPath)
-{
-    // Default systemName is system and change if system is multi-host
-    std::string systemName = "system";
-    if (!systemPath.empty())
-    {
-        systemName = sdbusplus::message::object_path(systemPath).filename();
-    }
+inline void handleSystemHostLogger(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& systemPath) {
+  // Default systemName is system and change if system is multi-host
+  std::string systemName = "system";
+  if (!systemPath.empty()) {
+    systemName = sdbusplus::message::object_path(systemPath).filename();
+  }
 
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/" + systemName + "/LogServices/HostLogger";
-    asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_1_0.LogService";
-    asyncResp->res.jsonValue["Name"] = "Host Logger Service";
-    asyncResp->res.jsonValue["Description"] = "Host Logger Service";
-    asyncResp->res.jsonValue["Id"] = "HostLogger";
-    asyncResp->res.jsonValue["Entries"]["@odata.id"] =
-        "/redfish/v1/Systems/" + systemName + "/LogServices/HostLogger/Entries";
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/" + systemName + "/LogServices/HostLogger";
+  asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_1_0.LogService";
+  asyncResp->res.jsonValue["Name"] = "Host Logger Service";
+  asyncResp->res.jsonValue["Description"] = "Host Logger Service";
+  asyncResp->res.jsonValue["Id"] = "HostLogger";
+  asyncResp->res.jsonValue["Entries"]["@odata.id"] =
+      "/redfish/v1/Systems/" + systemName + "/LogServices/HostLogger/Entries";
 }
 
-void requestRoutesSystemHostLogger(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/HostLogger/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            [&app](const crow::Request& req,
-                   const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                   const std::string& systemName) {
-        if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-        {
-            return;
-        }
-        redfish::system_utils::getSystemInformation(asyncResp, systemName,
-                                                    handleSystemHostLogger);
-    });
+void requestRoutesSystemHostLogger(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/HostLogger/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(
+          [&app](const crow::Request& req,
+                 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                 const std::string& systemName) {
+            if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+              return;
+            }
+            redfish::system_utils::getSystemInformation(asyncResp, systemName,
+                                                        handleSystemHostLogger);
+          });
 }
 
 inline void handleSystemHostLoggerCollection(
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemPath, const query_param::Query& delegatedQuery)
-{
-    // If the systemPath is empty, then the system is single host
-    bool multiHost = !systemPath.empty();
+    const std::string& systemPath, const query_param::Query& delegatedQuery) {
+  // If the systemPath is empty, then the system is single host
+  bool multiHost = !systemPath.empty();
 
-    // Default systemName is system and change if system is multi-host
-    std::string systemName = "system";
-    if (multiHost)
-    {
-        systemName = sdbusplus::message::object_path(systemPath).filename();
+  // Default systemName is system and change if system is multi-host
+  std::string systemName = "system";
+  if (multiHost) {
+    systemName = sdbusplus::message::object_path(systemPath).filename();
+  }
+
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/" + systemName + "/LogServices/HostLogger/Entries";
+  asyncResp->res.jsonValue["@odata.type"] =
+      "#LogEntryCollection.LogEntryCollection";
+  asyncResp->res.jsonValue["Name"] = "HostLogger Entries";
+  asyncResp->res.jsonValue["Description"] = "Collection of HostLogger Entries";
+  nlohmann::json& logEntryArray = asyncResp->res.jsonValue["Members"];
+  logEntryArray = nlohmann::json::array();
+  asyncResp->res.jsonValue["Members@odata.count"] = 0;
+
+  std::vector<std::filesystem::path> hostLoggerFiles;
+  if (!getHostLoggerFiles(hostLoggerFolderPath, hostLoggerFiles, systemName,
+                          multiHost)) {
+    BMCWEB_LOG_ERROR << "fail to get host log file path";
+    return;
+  }
+  // If we weren't provided top and skip limits, use the defaults.
+  size_t skip = delegatedQuery.skip.value_or(0);
+  size_t top = delegatedQuery.top.value_or(query_param::Query::maxTop);
+  size_t logCount = 0;
+  // This vector only store the entries we want to expose that
+  // control by skip and top.
+  std::vector<std::string> logEntries;
+  if (!getHostLoggerEntries(hostLoggerFiles, skip, top, logEntries, logCount)) {
+    messages::internalError(asyncResp->res);
+    return;
+  }
+  // If vector is empty, that means skip value larger than total
+  // log count
+  if (logEntries.empty()) {
+    asyncResp->res.jsonValue["Members@odata.count"] = logCount;
+    return;
+  }
+  if (!logEntries.empty()) {
+    for (size_t i = 0; i < logEntries.size(); i++) {
+      nlohmann::json::object_t hostLogEntry;
+      fillHostLoggerEntryJson(std::to_string(skip + i), logEntries[i],
+                              hostLogEntry, systemName);
+      logEntryArray.push_back(std::move(hostLogEntry));
     }
 
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/" + systemName + "/LogServices/HostLogger/Entries";
-    asyncResp->res.jsonValue["@odata.type"] =
-        "#LogEntryCollection.LogEntryCollection";
-    asyncResp->res.jsonValue["Name"] = "HostLogger Entries";
-    asyncResp->res.jsonValue["Description"] =
-        "Collection of HostLogger Entries";
-    nlohmann::json& logEntryArray = asyncResp->res.jsonValue["Members"];
-    logEntryArray = nlohmann::json::array();
-    asyncResp->res.jsonValue["Members@odata.count"] = 0;
-
-    std::vector<std::filesystem::path> hostLoggerFiles;
-    if (!getHostLoggerFiles(hostLoggerFolderPath, hostLoggerFiles, systemName,
-                            multiHost))
-    {
-        BMCWEB_LOG_ERROR << "fail to get host log file path";
-        return;
+    asyncResp->res.jsonValue["Members@odata.count"] = logCount;
+    if (skip + top < logCount) {
+      asyncResp->res.jsonValue["Members@odata.nextLink"] =
+          "/redfish/v1/Systems/" + systemName +
+          "/LogServices/HostLogger/Entries?$skip=" + std::to_string(skip + top);
     }
-    // If we weren't provided top and skip limits, use the defaults.
-    size_t skip = delegatedQuery.skip.value_or(0);
-    size_t top = delegatedQuery.top.value_or(query_param::Query::maxTop);
-    size_t logCount = 0;
-    // This vector only store the entries we want to expose that
-    // control by skip and top.
-    std::vector<std::string> logEntries;
-    if (!getHostLoggerEntries(hostLoggerFiles, skip, top, logEntries, logCount))
-    {
-        messages::internalError(asyncResp->res);
-        return;
-    }
-    // If vector is empty, that means skip value larger than total
-    // log count
-    if (logEntries.empty())
-    {
-        asyncResp->res.jsonValue["Members@odata.count"] = logCount;
-        return;
-    }
-    if (!logEntries.empty())
-    {
-        for (size_t i = 0; i < logEntries.size(); i++)
-        {
-            nlohmann::json::object_t hostLogEntry;
-            fillHostLoggerEntryJson(std::to_string(skip + i), logEntries[i],
-                                    hostLogEntry, systemName);
-            logEntryArray.push_back(std::move(hostLogEntry));
-        }
-
-        asyncResp->res.jsonValue["Members@odata.count"] = logCount;
-        if (skip + top < logCount)
-        {
-            asyncResp->res.jsonValue["Members@odata.nextLink"] =
-                "/redfish/v1/Systems/" + systemName +
-                "/LogServices/HostLogger/Entries?$skip=" +
-                std::to_string(skip + top);
-        }
-    }
+  }
 }
 
 inline void handleGetSystemHostLoggerCollection(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    query_param::QueryCapabilities capabilities = {
-        .canDelegateTop = true,
-        .canDelegateSkip = true,
-    };
-    query_param::Query delegatedQuery;
-    if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
-                                                  delegatedQuery, capabilities))
-    {
-        return;
-    }
-    redfish::system_utils::getSystemInformation(
-        asyncResp, systemName,
-        [delegatedQuery](const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                         const std::string& systemPath) {
+    const std::string& systemName) {
+  query_param::QueryCapabilities capabilities = {
+      .canDelegateTop = true,
+      .canDelegateSkip = true,
+  };
+  query_param::Query delegatedQuery;
+  if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
+                                                delegatedQuery, capabilities)) {
+    return;
+  }
+  redfish::system_utils::getSystemInformation(
+      asyncResp, systemName,
+      [delegatedQuery](const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+                       const std::string& systemPath) {
         handleSystemHostLoggerCollection(aResp, systemPath, delegatedQuery);
-    });
+      });
 }
 
-void requestRoutesSystemHostLoggerCollection(App& app)
-{
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Systems/<str>/LogServices/HostLogger/Entries/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleGetSystemHostLoggerCollection, std::ref(app)));
+void requestRoutesSystemHostLoggerCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/HostLogger/Entries/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetSystemHostLoggerCollection, std::ref(app)));
 }
 
 inline void handleSystemHostLoggerLogEntry(
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemPath, const std::string& param)
-{
-    // If the systemPath is empty, then the system is single host
-    bool multiHost = !systemPath.empty();
+    const std::string& systemPath, const std::string& param) {
+  // If the systemPath is empty, then the system is single host
+  bool multiHost = !systemPath.empty();
 
-    // Default systemName is system and change if system is multi-host
-    std::string systemName = "system";
-    if (multiHost)
-    {
-        systemName = sdbusplus::message::object_path(systemPath).filename();
-    }
+  // Default systemName is system and change if system is multi-host
+  std::string systemName = "system";
+  if (multiHost) {
+    systemName = sdbusplus::message::object_path(systemPath).filename();
+  }
 
-    const std::string& targetID = param;
+  const std::string& targetID = param;
 
-    uint64_t idInt = 0;
+  uint64_t idInt = 0;
 
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
-    const char* end = targetID.data() + targetID.size();
+  // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
+  const char* end = targetID.data() + targetID.size();
 
-    auto [ptr, ec] = std::from_chars(targetID.data(), end, idInt);
-    if (ec == std::errc::invalid_argument ||
-        ec == std::errc::result_out_of_range)
-    {
-        messages::resourceNotFound(asyncResp->res, "LogEntry", param);
-        return;
-    }
-
-    std::vector<std::filesystem::path> hostLoggerFiles;
-    if (!getHostLoggerFiles(hostLoggerFolderPath, hostLoggerFiles, systemName,
-                            multiHost))
-    {
-        BMCWEB_LOG_ERROR << "fail to get host log file path";
-        return;
-    }
-
-    size_t logCount = 0;
-    size_t top = 1;
-    std::vector<std::string> logEntries;
-    // We can get specific entry by skip and top. For example, if we
-    // want to get nth entry, we can set skip = n-1 and top = 1 to
-    // get that entry
-    if (!getHostLoggerEntries(hostLoggerFiles, idInt, top, logEntries,
-                              logCount))
-    {
-        messages::internalError(asyncResp->res);
-        return;
-    }
-
-    if (!logEntries.empty())
-    {
-        nlohmann::json::object_t hostLogEntry;
-        fillHostLoggerEntryJson(targetID, logEntries[0], hostLogEntry,
-                                systemName);
-        asyncResp->res.jsonValue.update(hostLogEntry);
-        return;
-    }
-
-    // Requested ID was not found
+  auto [ptr, ec] = std::from_chars(targetID.data(), end, idInt);
+  if (ec == std::errc::invalid_argument ||
+      ec == std::errc::result_out_of_range) {
     messages::resourceNotFound(asyncResp->res, "LogEntry", param);
+    return;
+  }
+
+  std::vector<std::filesystem::path> hostLoggerFiles;
+  if (!getHostLoggerFiles(hostLoggerFolderPath, hostLoggerFiles, systemName,
+                          multiHost)) {
+    BMCWEB_LOG_ERROR << "fail to get host log file path";
+    return;
+  }
+
+  size_t logCount = 0;
+  size_t top = 1;
+  std::vector<std::string> logEntries;
+  // We can get specific entry by skip and top. For example, if we
+  // want to get nth entry, we can set skip = n-1 and top = 1 to
+  // get that entry
+  if (!getHostLoggerEntries(hostLoggerFiles, idInt, top, logEntries,
+                            logCount)) {
+    messages::internalError(asyncResp->res);
+    return;
+  }
+
+  if (!logEntries.empty()) {
+    nlohmann::json::object_t hostLogEntry;
+    fillHostLoggerEntryJson(targetID, logEntries[0], hostLogEntry, systemName);
+    asyncResp->res.jsonValue.update(hostLogEntry);
+    return;
+  }
+
+  // Requested ID was not found
+  messages::resourceNotFound(asyncResp->res, "LogEntry", param);
 }
 
 inline void handleGetSystemHostLoggerLogEntry(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName, const std::string& param)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    redfish::system_utils::getSystemInformation(
-        asyncResp, systemName,
-        [param](const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                const std::string& systemPath) {
+    const std::string& systemName, const std::string& param) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  redfish::system_utils::getSystemInformation(
+      asyncResp, systemName,
+      [param](const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+              const std::string& systemPath) {
         handleSystemHostLoggerLogEntry(aResp, systemPath, param);
-    });
+      });
 }
 
-void requestRoutesSystemHostLoggerLogEntry(App& app)
-{
-    BMCWEB_ROUTE(
-        app, "/redfish/v1/Systems/<str>/LogServices/HostLogger/Entries/<str>/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetSystemHostLoggerLogEntry, std::ref(app)));
+void requestRoutesSystemHostLoggerLogEntry(App& app) {
+  BMCWEB_ROUTE(
+      app, "/redfish/v1/Systems/<str>/LogServices/HostLogger/Entries/<str>/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetSystemHostLoggerLogEntry, std::ref(app)));
 }
 
 inline void handleBMCLogServicesCollectionGet(
     crow::App& app, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    // Collections don't include the static data added by SubRoute
-    // because it has a duplicate entry for members
-    asyncResp->res.jsonValue["@odata.type"] =
-        "#LogServiceCollection.LogServiceCollection";
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Managers/bmc/LogServices";
-    asyncResp->res.jsonValue["Name"] = "Open BMC Log Services Collection";
-    asyncResp->res.jsonValue["Description"] =
-        "Collection of LogServices for this Manager";
-    nlohmann::json& logServiceArray = asyncResp->res.jsonValue["Members"];
-    logServiceArray = nlohmann::json::array();
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  // Collections don't include the static data added by SubRoute
+  // because it has a duplicate entry for members
+  asyncResp->res.jsonValue["@odata.type"] =
+      "#LogServiceCollection.LogServiceCollection";
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Managers/bmc/LogServices";
+  asyncResp->res.jsonValue["Name"] = "Open BMC Log Services Collection";
+  asyncResp->res.jsonValue["Description"] =
+      "Collection of LogServices for this Manager";
+  nlohmann::json& logServiceArray = asyncResp->res.jsonValue["Members"];
+  logServiceArray = nlohmann::json::array();
 
 #ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
-    nlohmann::json::object_t journal;
-    journal["@odata.id"] = "/redfish/v1/Managers/bmc/LogServices/Journal";
-    logServiceArray.push_back(std::move(journal));
+  nlohmann::json::object_t journal;
+  journal["@odata.id"] = "/redfish/v1/Managers/bmc/LogServices/Journal";
+  logServiceArray.push_back(std::move(journal));
 #endif
 
 #ifdef BMCWEB_ENABLE_REDFISH_BOOT_TIME_LOG
-    nlohmann::json::object_t bootTime;
-    bootTime["@odata.id"] = "/redfish/v1/Managers/bmc/LogServices/BootTime";
-    logServiceArray.push_back(std::move(bootTime));
+  nlohmann::json::object_t bootTime;
+  bootTime["@odata.id"] = "/redfish/v1/Managers/bmc/LogServices/BootTime";
+  logServiceArray.push_back(std::move(bootTime));
 #endif
 
-    asyncResp->res.jsonValue["Members@odata.count"] = logServiceArray.size();
+  asyncResp->res.jsonValue["Members@odata.count"] = logServiceArray.size();
 
 #ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
-    constexpr std::array<std::string_view, 1> interfaces = {
-        "xyz.openbmc_project.Collection.DeleteAll"};
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    managedStore::GetManagedObjectStore()->getSubTreePaths(
-        "/xyz/openbmc_project/dump", 0, interfaces, requestContext,
-        [asyncResp](
-            const boost::system::error_code& ec,
-            const dbus::utility::MapperGetSubTreePathsResponse& subTreePaths) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR
-                << "handleBMCLogServicesCollectionGet respHandler got error "
-                << ec;
-            // Assume that getting an error simply means there are no dump
-            // LogServices. Return without adding any error response.
-            return;
+  constexpr std::array<std::string_view, 1> interfaces = {
+      "xyz.openbmc_project.Collection.DeleteAll"};
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  managedStore::GetManagedObjectStore()->getSubTreePaths(
+      "/xyz/openbmc_project/dump", 0, interfaces, requestContext,
+      [asyncResp](
+          const boost::system::error_code& ec,
+          const dbus::utility::MapperGetSubTreePathsResponse& subTreePaths) {
+        if (ec) {
+          BMCWEB_LOG_ERROR
+              << "handleBMCLogServicesCollectionGet respHandler got error "
+              << ec;
+          // Assume that getting an error simply means there are no dump
+          // LogServices. Return without adding any error response.
+          return;
         }
 
         nlohmann::json& logServiceArrayLocal =
             asyncResp->res.jsonValue["Members"];
 
-        for (const std::string& path : subTreePaths)
-        {
-            if (path == "/xyz/openbmc_project/dump/bmc")
-            {
-                nlohmann::json::object_t member;
-                member["@odata.id"] =
-                    "/redfish/v1/Managers/bmc/LogServices/Dump";
-                logServiceArrayLocal.push_back(std::move(member));
-            }
-            else if (path == "/xyz/openbmc_project/dump/faultlog")
-            {
-                nlohmann::json::object_t member;
-                member["@odata.id"] =
-                    "/redfish/v1/Managers/bmc/LogServices/FaultLog";
-                logServiceArrayLocal.push_back(std::move(member));
-            }
+        for (const std::string& path : subTreePaths) {
+          if (path == "/xyz/openbmc_project/dump/bmc") {
+            nlohmann::json::object_t member;
+            member["@odata.id"] = "/redfish/v1/Managers/bmc/LogServices/Dump";
+            logServiceArrayLocal.push_back(std::move(member));
+          } else if (path == "/xyz/openbmc_project/dump/faultlog") {
+            nlohmann::json::object_t member;
+            member["@odata.id"] =
+                "/redfish/v1/Managers/bmc/LogServices/FaultLog";
+            logServiceArrayLocal.push_back(std::move(member));
+          }
         }
 
         asyncResp->res.jsonValue["Members@odata.count"] =
             logServiceArrayLocal.size();
-    });
+      });
 #endif
 }
 
-void requestRoutesBMCLogServiceCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/")
-        .privileges(redfish::privileges::getLogServiceCollection)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleBMCLogServicesCollectionGet, std::ref(app)));
+void requestRoutesBMCLogServiceCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/")
+      .privileges(redfish::privileges::getLogServiceCollection)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleBMCLogServicesCollectionGet, std::ref(app)));
 }
 
 inline void handleGetBMCJournalLogService(
     App& app, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_1_0.LogService";
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Managers/bmc/LogServices/Journal";
-    asyncResp->res.jsonValue["Name"] = "Open BMC Journal Log Service";
-    asyncResp->res.jsonValue["Description"] = "BMC Journal Log Service";
-    asyncResp->res.jsonValue["Id"] = "Journal";
-    asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_1_0.LogService";
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Managers/bmc/LogServices/Journal";
+  asyncResp->res.jsonValue["Name"] = "Open BMC Journal Log Service";
+  asyncResp->res.jsonValue["Description"] = "BMC Journal Log Service";
+  asyncResp->res.jsonValue["Id"] = "Journal";
+  asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
 
-    std::pair<std::string, std::string> redfishDateTimeOffset =
-        redfish::time_utils::getDateTimeOffsetNow();
-    asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
-    asyncResp->res.jsonValue["DateTimeLocalOffset"] =
-        redfishDateTimeOffset.second;
+  std::pair<std::string, std::string> redfishDateTimeOffset =
+      redfish::time_utils::getDateTimeOffsetNow();
+  asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
+  asyncResp->res.jsonValue["DateTimeLocalOffset"] =
+      redfishDateTimeOffset.second;
 
-    asyncResp->res.jsonValue["Entries"]["@odata.id"] =
-        "/redfish/v1/Managers/bmc/LogServices/Journal/Entries";
+  asyncResp->res.jsonValue["Entries"]["@odata.id"] =
+      "/redfish/v1/Managers/bmc/LogServices/Journal/Entries";
 }
 
-void requestRoutesBMCJournalLogService(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/Journal/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetBMCJournalLogService, std::ref(app)));
+void requestRoutesBMCJournalLogService(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/Journal/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetBMCJournalLogService, std::ref(app)));
 }
 
-static int
-    fillBMCJournalLogEntryJson(const std::string& bmcJournalLogEntryID,
-                               sd_journal* journal,
-                               nlohmann::json::object_t& bmcJournalLogEntryJson)
-{
-    // Get the Log Entry contents
-    int ret = 0;
+static int fillBMCJournalLogEntryJson(
+    const std::string& bmcJournalLogEntryID, sd_journal* journal,
+    nlohmann::json::object_t& bmcJournalLogEntryJson) {
+  // Get the Log Entry contents
+  int ret = 0;
 
-    std::string message;
-    std::string_view syslogID;
-    ret = getJournalMetadata(journal, "SYSLOG_IDENTIFIER", syslogID);
-    if (ret < 0)
-    {
-        BMCWEB_LOG_ERROR << "Failed to read SYSLOG_IDENTIFIER field: "
-                         << strerror(-ret);
-    }
-    if (!syslogID.empty())
-    {
-        message += std::string(syslogID) + ": ";
-    }
+  std::string message;
+  std::string_view syslogID;
+  ret = getJournalMetadata(journal, "SYSLOG_IDENTIFIER", syslogID);
+  if (ret < 0) {
+    BMCWEB_LOG_ERROR << "Failed to read SYSLOG_IDENTIFIER field: "
+                     << strerror(-ret);
+  }
+  if (!syslogID.empty()) {
+    message += std::string(syslogID) + ": ";
+  }
 
-    std::string_view msg;
-    ret = getJournalMetadata(journal, "MESSAGE", msg);
-    if (ret < 0)
-    {
-        BMCWEB_LOG_ERROR << "Failed to read MESSAGE field: " << strerror(-ret);
-        return 1;
-    }
-    message += std::string(msg);
+  std::string_view msg;
+  ret = getJournalMetadata(journal, "MESSAGE", msg);
+  if (ret < 0) {
+    BMCWEB_LOG_ERROR << "Failed to read MESSAGE field: " << strerror(-ret);
+    return 1;
+  }
+  message += std::string(msg);
 
-    // Get the severity from the PRIORITY field
-    int64_t severity = 8; // Default to an invalid priority
-    ret = getJournalMetadata(journal, "PRIORITY", 10, severity);
-    if (ret < 0)
-    {
-        BMCWEB_LOG_ERROR << "Failed to read PRIORITY field: " << strerror(-ret);
-    }
+  // Get the severity from the PRIORITY field
+  int64_t severity = 8;  // Default to an invalid priority
+  ret = getJournalMetadataToInt64(journal, "PRIORITY", severity);
+  if (ret < 0) {
+    BMCWEB_LOG_ERROR << "Failed to read PRIORITY field: " << strerror(-ret);
+  }
 
-    // Get the Created time from the timestamp
-    std::string entryTimeStr;
-    if (!getEntryTimestamp(journal, entryTimeStr))
-    {
-        return 1;
-    }
+  // Get the Created time from the timestamp
+  std::string entryTimeStr;
+  if (!getEntryTimestamp(journal, entryTimeStr)) {
+    return 1;
+  }
 
-    // Fill in the log entry with the gathered data
-    bmcJournalLogEntryJson["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
-    bmcJournalLogEntryJson["@odata.id"] = crow::utility::urlFromPieces(
-        "redfish", "v1", "Managers", "bmc", "LogServices", "Journal", "Entries",
-        bmcJournalLogEntryID);
-    bmcJournalLogEntryJson["Name"] = "BMC Journal Entry";
-    bmcJournalLogEntryJson["Id"] = bmcJournalLogEntryID;
-    bmcJournalLogEntryJson["Message"] = std::move(message);
-    bmcJournalLogEntryJson["EntryType"] = "Oem";
-    bmcJournalLogEntryJson["Severity"] = severity <= 2   ? "Critical"
-                                         : severity <= 4 ? "Warning"
-                                                         : "OK";
-    bmcJournalLogEntryJson["OemRecordFormat"] = "BMC Journal Entry";
-    bmcJournalLogEntryJson["Created"] = std::move(entryTimeStr);
-    return 0;
+  // Fill in the log entry with the gathered data
+  bmcJournalLogEntryJson["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
+  bmcJournalLogEntryJson["@odata.id"] = crow::utility::urlFromPieces(
+      "redfish", "v1", "Managers", "bmc", "LogServices", "Journal", "Entries",
+      bmcJournalLogEntryID);
+  bmcJournalLogEntryJson["Name"] = "BMC Journal Entry";
+  bmcJournalLogEntryJson["Id"] = bmcJournalLogEntryID;
+  bmcJournalLogEntryJson["Message"] = std::move(message);
+  bmcJournalLogEntryJson["EntryType"] = "Oem";
+  bmcJournalLogEntryJson["Severity"] = severity <= 2   ? "Critical"
+                                       : severity <= 4 ? "Warning"
+                                                       : "OK";
+  bmcJournalLogEntryJson["OemRecordFormat"] = "BMC Journal Entry";
+  bmcJournalLogEntryJson["Created"] = std::move(entryTimeStr);
+  return 0;
 }
 
 inline void handleGetBMCJournalLogEntryCollection(
     App& app, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    query_param::QueryCapabilities capabilities = {
-        .canDelegateTop = true,
-        .canDelegateSkip = true,
-    };
-    query_param::Query delegatedQuery;
-    if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
-                                                  delegatedQuery, capabilities))
-    {
-        return;
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  query_param::QueryCapabilities capabilities = {
+      .canDelegateTop = true,
+      .canDelegateSkip = true,
+  };
+  query_param::Query delegatedQuery;
+  if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
+                                                delegatedQuery, capabilities)) {
+    return;
+  }
+
+  size_t skip = delegatedQuery.skip.value_or(0);
+  size_t top = delegatedQuery.top.value_or(query_param::Query::maxTop);
+
+  // Collections don't include the static data added by SubRoute
+  // because it has a duplicate entry for members
+  asyncResp->res.jsonValue["@odata.type"] =
+      "#LogEntryCollection.LogEntryCollection";
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Managers/bmc/LogServices/Journal/Entries";
+  asyncResp->res.jsonValue["Name"] = "Open BMC Journal Entries";
+  asyncResp->res.jsonValue["Description"] = "Collection of BMC Journal Entries";
+  nlohmann::json& logEntryArray = asyncResp->res.jsonValue["Members"];
+  logEntryArray = nlohmann::json::array();
+
+  // Go through the journal and use the timestamp to create a
+  // unique ID for each entry
+  sd_journal* journalTmp = nullptr;
+  int ret = sd_journal_open(&journalTmp, SD_JOURNAL_LOCAL_ONLY);
+  if (ret < 0) {
+    BMCWEB_LOG_ERROR << "failed to open journal: " << strerror(-ret);
+    messages::internalError(asyncResp->res);
+    return;
+  }
+  std::unique_ptr<sd_journal, decltype(&sd_journal_close)> journal(
+      journalTmp, sd_journal_close);
+  journalTmp = nullptr;
+  uint64_t entryCount = 0;
+  // Reset the unique ID on the first entry
+  bool firstEntry = true;
+  SD_JOURNAL_FOREACH(journal.get()) {
+    entryCount++;
+    // Handle paging using skip (number of entries to skip from
+    // the start) and top (number of entries to display)
+    if (entryCount <= skip || entryCount > skip + top) {
+      continue;
     }
 
-    size_t skip = delegatedQuery.skip.value_or(0);
-    size_t top = delegatedQuery.top.value_or(query_param::Query::maxTop);
-
-    // Collections don't include the static data added by SubRoute
-    // because it has a duplicate entry for members
-    asyncResp->res.jsonValue["@odata.type"] =
-        "#LogEntryCollection.LogEntryCollection";
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Managers/bmc/LogServices/Journal/Entries";
-    asyncResp->res.jsonValue["Name"] = "Open BMC Journal Entries";
-    asyncResp->res.jsonValue["Description"] =
-        "Collection of BMC Journal Entries";
-    nlohmann::json& logEntryArray = asyncResp->res.jsonValue["Members"];
-    logEntryArray = nlohmann::json::array();
-
-    // Go through the journal and use the timestamp to create a
-    // unique ID for each entry
-    sd_journal* journalTmp = nullptr;
-    int ret = sd_journal_open(&journalTmp, SD_JOURNAL_LOCAL_ONLY);
-    if (ret < 0)
-    {
-        BMCWEB_LOG_ERROR << "failed to open journal: " << strerror(-ret);
-        messages::internalError(asyncResp->res);
-        return;
+    std::string idStr;
+    if (!getUniqueEntryID(journal.get(), idStr, firstEntry)) {
+      continue;
     }
-    std::unique_ptr<sd_journal, decltype(&sd_journal_close)> journal(
-        journalTmp, sd_journal_close);
-    journalTmp = nullptr;
-    uint64_t entryCount = 0;
-    // Reset the unique ID on the first entry
-    bool firstEntry = true;
-    SD_JOURNAL_FOREACH(journal.get())
-    {
-        entryCount++;
-        // Handle paging using skip (number of entries to skip from
-        // the start) and top (number of entries to display)
-        if (entryCount <= skip || entryCount > skip + top)
-        {
-            continue;
-        }
+    firstEntry = false;
 
-        std::string idStr;
-        if (!getUniqueEntryID(journal.get(), idStr, firstEntry))
-        {
-            continue;
-        }
-        firstEntry = false;
-
-        nlohmann::json::object_t bmcJournalLogEntry;
-        if (fillBMCJournalLogEntryJson(idStr, journal.get(),
-                                       bmcJournalLogEntry) != 0)
-        {
-            messages::internalError(asyncResp->res);
-            return;
-        }
-        logEntryArray.push_back(std::move(bmcJournalLogEntry));
+    nlohmann::json::object_t bmcJournalLogEntry;
+    if (fillBMCJournalLogEntryJson(idStr, journal.get(), bmcJournalLogEntry) !=
+        0) {
+      messages::internalError(asyncResp->res);
+      return;
     }
-    asyncResp->res.jsonValue["Members@odata.count"] = entryCount;
-    if (skip + top < entryCount)
-    {
-        asyncResp->res.jsonValue["Members@odata.nextLink"] =
-            "/redfish/v1/Managers/bmc/LogServices/Journal/Entries?$skip=" +
-            std::to_string(skip + top);
-    }
+    logEntryArray.push_back(std::move(bmcJournalLogEntry));
+  }
+  asyncResp->res.jsonValue["Members@odata.count"] = entryCount;
+  if (skip + top < entryCount) {
+    asyncResp->res.jsonValue["Members@odata.nextLink"] =
+        "/redfish/v1/Managers/bmc/LogServices/Journal/Entries?$skip=" +
+        std::to_string(skip + top);
+  }
 }
 
-void requestRoutesBMCJournalLogEntryCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/Journal/Entries/")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleGetBMCJournalLogEntryCollection, std::ref(app)));
+void requestRoutesBMCJournalLogEntryCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/Journal/Entries/")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleGetBMCJournalLogEntryCollection, std::ref(app)));
 }
 
 inline void handleGetBMCJournalLogEntry(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& entryID)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    // Convert the unique ID back to a timestamp to find the entry
-    uint64_t ts = 0;
-    uint64_t index = 0;
-    if (!getTimestampFromID(asyncResp, entryID, ts, index))
-    {
-        return;
-    }
+    const std::string& entryID) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  // Convert the unique ID back to a timestamp to find the entry
+  uint64_t ts = 0;
+  uint64_t index = 0;
+  if (!getTimestampFromID(asyncResp, entryID, ts, index)) {
+    return;
+  }
 
-    sd_journal* journalTmp = nullptr;
-    int ret = sd_journal_open(&journalTmp, SD_JOURNAL_LOCAL_ONLY);
-    if (ret < 0)
-    {
-        BMCWEB_LOG_ERROR << "failed to open journal: " << strerror(-ret);
-        messages::internalError(asyncResp->res);
-        return;
+  sd_journal* journalTmp = nullptr;
+  int ret = sd_journal_open(&journalTmp, SD_JOURNAL_LOCAL_ONLY);
+  if (ret < 0) {
+    BMCWEB_LOG_ERROR << "failed to open journal: " << strerror(-ret);
+    messages::internalError(asyncResp->res);
+    return;
+  }
+  std::unique_ptr<sd_journal, decltype(&sd_journal_close)> journal(
+      journalTmp, sd_journal_close);
+  journalTmp = nullptr;
+  // Go to the timestamp in the log and move to the entry at the
+  // index tracking the unique ID
+  std::string idStr;
+  bool firstEntry = true;
+  ret = sd_journal_seek_realtime_usec(journal.get(), ts);
+  if (ret < 0) {
+    BMCWEB_LOG_ERROR << "failed to seek to an entry in journal"
+                     << strerror(-ret);
+    messages::internalError(asyncResp->res);
+    return;
+  }
+  for (uint64_t i = 0; i <= index; i++) {
+    sd_journal_next(journal.get());
+    if (!getUniqueEntryID(journal.get(), idStr, firstEntry)) {
+      messages::internalError(asyncResp->res);
+      return;
     }
-    std::unique_ptr<sd_journal, decltype(&sd_journal_close)> journal(
-        journalTmp, sd_journal_close);
-    journalTmp = nullptr;
-    // Go to the timestamp in the log and move to the entry at the
-    // index tracking the unique ID
-    std::string idStr;
-    bool firstEntry = true;
-    ret = sd_journal_seek_realtime_usec(journal.get(), ts);
-    if (ret < 0)
-    {
-        BMCWEB_LOG_ERROR << "failed to seek to an entry in journal"
-                         << strerror(-ret);
-        messages::internalError(asyncResp->res);
-        return;
-    }
-    for (uint64_t i = 0; i <= index; i++)
-    {
-        sd_journal_next(journal.get());
-        if (!getUniqueEntryID(journal.get(), idStr, firstEntry))
-        {
-            messages::internalError(asyncResp->res);
-            return;
-        }
-        firstEntry = false;
-    }
-    // Confirm that the entry ID matches what was requested
-    if (idStr != entryID)
-    {
-        messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
-        return;
-    }
+    firstEntry = false;
+  }
+  // Confirm that the entry ID matches what was requested
+  if (idStr != entryID) {
+    messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
+    return;
+  }
 
-    nlohmann::json::object_t bmcJournalLogEntry;
-    if (fillBMCJournalLogEntryJson(entryID, journal.get(),
-                                   bmcJournalLogEntry) != 0)
-    {
-        messages::internalError(asyncResp->res);
-        return;
-    }
-    asyncResp->res.jsonValue.update(bmcJournalLogEntry);
+  nlohmann::json::object_t bmcJournalLogEntry;
+  if (fillBMCJournalLogEntryJson(entryID, journal.get(), bmcJournalLogEntry) !=
+      0) {
+    messages::internalError(asyncResp->res);
+    return;
+  }
+  asyncResp->res.jsonValue.update(bmcJournalLogEntry);
 }
 
-void requestRoutesBMCJournalLogEntry(App& app)
-{
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Managers/bmc/LogServices/Journal/Entries/<str>/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetBMCJournalLogEntry, std::ref(app)));
+void requestRoutesBMCJournalLogEntry(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Managers/bmc/LogServices/Journal/Entries/<str>/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetBMCJournalLogEntry, std::ref(app)));
 }
 
-namespace internal
-{
+namespace internal {
 void getDumpServiceInfo(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                        const Dump& dump)
-{
-    std::string dumpPath;
-    std::string overWritePolicy;
-    bool collectDiagnosticDataSupported = false;
+                        const Dump& dump) {
+  std::string dumpPath;
+  std::string overWritePolicy;
+  bool collectDiagnosticDataSupported = false;
 
-    switch (dump.type)
-    {
-        case DumpType::BMC_DUMP:
-            dumpPath = "/redfish/v1/Managers/bmc/LogServices/Dump";
-            overWritePolicy = "WrapsWhenFull";
-            collectDiagnosticDataSupported = true;
-            break;
-        case DumpType::BMC_FAULT_LOG:
-            dumpPath = "/redfish/v1/Managers/bmc/LogServices/FaultLog";
-            overWritePolicy = "Unknown";
-            collectDiagnosticDataSupported = false;
-            break;
-        case DumpType::SYSTEM_DUMP:
-            dumpPath = "/redfish/v1/Systems/system/LogServices/Dump";
-            overWritePolicy = "WrapsWhenFull";
-            collectDiagnosticDataSupported = true;
-            break;
-        case DumpType::SYSTEM_FAULT_LOG:
-            if (dump.systemName)
-            {
-                dumpPath = "/redfish/v1/Systems/" + *dump.systemName +
-                           "/LogServices/FaultLog";
-                overWritePolicy = "Unknown";
-                collectDiagnosticDataSupported = false;
-            }
-            break;
-    }
+  switch (dump.type) {
+    case DumpType::BMC_DUMP:
+      dumpPath = "/redfish/v1/Managers/bmc/LogServices/Dump";
+      overWritePolicy = "WrapsWhenFull";
+      collectDiagnosticDataSupported = true;
+      break;
+    case DumpType::BMC_FAULT_LOG:
+      dumpPath = "/redfish/v1/Managers/bmc/LogServices/FaultLog";
+      overWritePolicy = "Unknown";
+      collectDiagnosticDataSupported = false;
+      break;
+    case DumpType::SYSTEM_DUMP:
+      dumpPath = "/redfish/v1/Systems/system/LogServices/Dump";
+      overWritePolicy = "WrapsWhenFull";
+      collectDiagnosticDataSupported = true;
+      break;
+    case DumpType::SYSTEM_FAULT_LOG:
+      if (dump.systemName) {
+        dumpPath =
+            "/redfish/v1/Systems/" + *dump.systemName + "/LogServices/FaultLog";
+        overWritePolicy = "Unknown";
+        collectDiagnosticDataSupported = false;
+      }
+      break;
+  }
 
-    asyncResp->res.jsonValue["@odata.id"] = dumpPath;
-    asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_2_0.LogService";
-    asyncResp->res.jsonValue["Name"] =
-        dumpTypeToString(dump.type) + " Dump LogService";
-    asyncResp->res.jsonValue["Description"] =
-        dumpTypeToString(dump.type) + " Dump LogService";
-    asyncResp->res.jsonValue["Id"] = std::filesystem::path(dumpPath).filename();
-    asyncResp->res.jsonValue["OverWritePolicy"] = std::move(overWritePolicy);
+  asyncResp->res.jsonValue["@odata.id"] = dumpPath;
+  asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_2_0.LogService";
+  asyncResp->res.jsonValue["Name"] =
+      dumpTypeToString(dump.type) + " Dump LogService";
+  asyncResp->res.jsonValue["Description"] =
+      dumpTypeToString(dump.type) + " Dump LogService";
+  asyncResp->res.jsonValue["Id"] = std::filesystem::path(dumpPath).filename();
+  asyncResp->res.jsonValue["OverWritePolicy"] = std::move(overWritePolicy);
 
-    std::pair<std::string, std::string> redfishDateTimeOffset =
-        redfish::time_utils::getDateTimeOffsetNow();
-    asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
-    asyncResp->res.jsonValue["DateTimeLocalOffset"] =
-        redfishDateTimeOffset.second;
+  std::pair<std::string, std::string> redfishDateTimeOffset =
+      redfish::time_utils::getDateTimeOffsetNow();
+  asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
+  asyncResp->res.jsonValue["DateTimeLocalOffset"] =
+      redfishDateTimeOffset.second;
 
-    asyncResp->res.jsonValue["Entries"]["@odata.id"] = dumpPath + "/Entries";
+  asyncResp->res.jsonValue["Entries"]["@odata.id"] = dumpPath + "/Entries";
 
-    if (collectDiagnosticDataSupported)
-    {
-        asyncResp->res.jsonValue["Actions"]["#LogService.CollectDiagnosticData"]
-                                ["target"] =
-            dumpPath + "/Actions/LogService.CollectDiagnosticData";
-    }
+  if (collectDiagnosticDataSupported) {
+    asyncResp->res
+        .jsonValue["Actions"]["#LogService.CollectDiagnosticData"]["target"] =
+        dumpPath + "/Actions/LogService.CollectDiagnosticData";
+  }
 
-    constexpr std::array<std::string_view, 1> interfaces = {deleteAllInterface};
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    managedStore::GetManagedObjectStore()->getSubTreePaths(
-        "/xyz/openbmc_project/dump", 0, interfaces, requestContext,
-        [asyncResp, dump, dumpPath](
-            const boost::system::error_code& ec,
-            const dbus::utility::MapperGetSubTreePathsResponse& subTreePaths) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "getDumpServiceInfo respHandler got error "
-                             << ec;
-            // Assume that getting an error simply means there are no dump
-            // LogServices. Return without adding any error response.
-            return;
+  constexpr std::array<std::string_view, 1> interfaces = {deleteAllInterface};
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  managedStore::GetManagedObjectStore()->getSubTreePaths(
+      "/xyz/openbmc_project/dump", 0, interfaces, requestContext,
+      [asyncResp, dump, dumpPath](
+          const boost::system::error_code& ec,
+          const dbus::utility::MapperGetSubTreePathsResponse& subTreePaths) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "getDumpServiceInfo respHandler got error " << ec;
+          // Assume that getting an error simply means there are no dump
+          // LogServices. Return without adding any error response.
+          return;
         }
 
         std::optional<std::string> dumpManagerCollectionPath =
             getDumpManagerCollectionPath(dump);
 
-        if (!dumpManagerCollectionPath)
-        {
-            BMCWEB_LOG_ERROR
-                << "Cant get dumpManagerCollectionPath from system "
-                << dump.systemName.value_or("none");
-            messages::internalError(asyncResp->res);
-            return;
+        if (!dumpManagerCollectionPath) {
+          BMCWEB_LOG_ERROR << "Cant get dumpManagerCollectionPath from system "
+                           << dump.systemName.value_or("none");
+          messages::internalError(asyncResp->res);
+          return;
         }
 
-        for (const std::string& path : subTreePaths)
-        {
-            if (path == *dumpManagerCollectionPath)
-            {
-                asyncResp->res
-                    .jsonValue["Actions"]["#LogService.ClearLog"]["target"] =
-                    dumpPath + "/Actions/LogService.ClearLog";
-                break;
-            }
+        for (const std::string& path : subTreePaths) {
+          if (path == *dumpManagerCollectionPath) {
+            asyncResp->res
+                .jsonValue["Actions"]["#LogService.ClearLog"]["target"] =
+                dumpPath + "/Actions/LogService.ClearLog";
+            break;
+          }
         }
-    });
+      });
 }
-} // namespace internal
+}  // namespace internal
 
 inline void handleLogServicesDumpServiceGet(
     crow::App& app, DumpType dumpType, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    internal::getDumpServiceInfo(asyncResp, Dump{.type = dumpType});
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  internal::getDumpServiceInfo(asyncResp, Dump{.type = dumpType});
 }
 
 inline void handleLogServicesDumpServiceComputerSystemGet(
     crow::App& app, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, const std::string& id)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (id != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem", id);
-        return;
-    }
-    internal::getDumpServiceInfo(asyncResp,
-                                 Dump{.type = DumpType::SYSTEM_DUMP});
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& id) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (id != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", id);
+    return;
+  }
+  internal::getDumpServiceInfo(asyncResp, Dump{.type = DumpType::SYSTEM_DUMP});
 }
 
 inline void handleLogServicesDumpEntriesCollectionGet(
     crow::App& app, DumpType dumpType, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    query_param::QueryCapabilities capabilities = {
-        .canDelegateExpandLevel = 2,
-        .canDelegateFilter = true,
-    };
-    query_param::Query delegatedQuery;
-    if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
-                                                  delegatedQuery, capabilities))
-    {
-        return;
-    }
-    getDumpEntryCollection(app, req, asyncResp, Dump{.type = dumpType},
-                           delegatedQuery);
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  query_param::QueryCapabilities capabilities = {
+      .canDelegateExpandLevel = 2,
+      .canDelegateFilter = true,
+  };
+  query_param::Query delegatedQuery;
+  if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
+                                                delegatedQuery, capabilities)) {
+    return;
+  }
+  getDumpEntryCollection(app, req, asyncResp, Dump{.type = dumpType},
+                         delegatedQuery);
 }
 
 inline void handleLogServicesDumpEntriesCollectionComputerSystemGet(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& chassisId)
-{
-    query_param::QueryCapabilities capabilities = {
-        .canDelegateExpandLevel = 2,
-        .canDelegateFilter = true,
-    };
-    query_param::Query delegatedQuery;
+    const std::string& chassisId) {
+  query_param::QueryCapabilities capabilities = {
+      .canDelegateExpandLevel = 2,
+      .canDelegateFilter = true,
+  };
+  query_param::Query delegatedQuery;
 
-    if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
-                                                  delegatedQuery, capabilities))
-    {
-        return;
-    }
-    if (chassisId != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
-        return;
-    }
-    getDumpEntryCollection(app, req, asyncResp,
-                           Dump{.type = DumpType::SYSTEM_DUMP}, delegatedQuery);
+  if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
+                                                delegatedQuery, capabilities)) {
+    return;
+  }
+  if (chassisId != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
+    return;
+  }
+  getDumpEntryCollection(app, req, asyncResp,
+                         Dump{.type = DumpType::SYSTEM_DUMP}, delegatedQuery);
 }
 
 inline void handleLogServicesDumpEntryGet(
     crow::App& app, DumpType dumpType, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& dumpId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    getDumpEntryById(asyncResp, dumpId, Dump{.type = dumpType});
+    const std::string& dumpId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  getDumpEntryById(asyncResp, dumpId, Dump{.type = dumpType});
 }
 
 inline void handleLogServicesDumpEntryComputerSystemGet(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& chassisId, const std::string& dumpId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (chassisId != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
-        return;
-    }
-    getDumpEntryById(asyncResp, dumpId, Dump{.type = DumpType::SYSTEM_DUMP});
+    const std::string& chassisId, const std::string& dumpId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (chassisId != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
+    return;
+  }
+  getDumpEntryById(asyncResp, dumpId, Dump{.type = DumpType::SYSTEM_DUMP});
 }
 
 inline void handleLogServicesDumpEntryDelete(
     crow::App& app, DumpType dumpType, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& dumpId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    deleteDumpEntry(asyncResp, dumpId, Dump{.type = dumpType});
+    const std::string& dumpId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  deleteDumpEntry(asyncResp, dumpId, Dump{.type = dumpType});
 }
 
 inline void handleLogServicesDumpEntryComputerSystemDelete(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& chassisId, const std::string& dumpId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (chassisId != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
-        return;
-    }
-    deleteDumpEntry(asyncResp, dumpId, Dump{.type = DumpType::SYSTEM_DUMP});
+    const std::string& chassisId, const std::string& dumpId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (chassisId != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
+    return;
+  }
+  deleteDumpEntry(asyncResp, dumpId, Dump{.type = DumpType::SYSTEM_DUMP});
 }
 
 inline void handleLogServicesDumpEntryDownloadGet(
     crow::App& app, DumpType dumpType, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& dumpId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    downloadDumpEntry(asyncResp, dumpId, Dump{.type = dumpType});
+    const std::string& dumpId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  downloadDumpEntry(asyncResp, dumpId, Dump{.type = dumpType});
 }
 
 inline void handleLogServicesDumpCollectDiagnosticDataPost(
     crow::App& app, DumpType dumpType, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    createDump(asyncResp, req, Dump{.type = dumpType});
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  createDump(asyncResp, req, Dump{.type = dumpType});
 }
 
 inline void handleLogServicesDumpCollectDiagnosticDataComputerSystemPost(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& chassisId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (chassisId != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
-        return;
-    }
-    createDump(asyncResp, req, Dump{.type = DumpType::SYSTEM_DUMP});
+    const std::string& chassisId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (chassisId != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
+    return;
+  }
+  createDump(asyncResp, req, Dump{.type = DumpType::SYSTEM_DUMP});
 }
 
 inline void handleLogServicesDumpClearLogPost(
     crow::App& app, DumpType dumpType, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    clearDump(asyncResp, Dump{.type = dumpType});
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  clearDump(asyncResp, Dump{.type = dumpType});
 }
 
 inline void handleLogServicesDumpClearLogComputerSystemPost(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& chassisId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (chassisId != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
-        return;
-    }
-    clearDump(asyncResp, Dump{.type = DumpType::SYSTEM_DUMP});
+    const std::string& chassisId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (chassisId != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", chassisId);
+    return;
+  }
+  clearDump(asyncResp, Dump{.type = DumpType::SYSTEM_DUMP});
 }
 
 inline void handleLogServiceFaultLogEntriesGet(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    query_param::QueryCapabilities capabilities = {
-        .canDelegateExpandLevel = 2,
-        .canDelegateFilter = true,
-    };
-    query_param::Query delegatedQuery;
-    if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
-                                                  delegatedQuery, capabilities))
-    {
-        return;
-    }
-    getDumpEntryCollection(
-        app, req, asyncResp,
-        Dump{.type = DumpType::SYSTEM_FAULT_LOG, .systemName = systemName},
-        delegatedQuery);
+    const std::string& systemName) {
+  query_param::QueryCapabilities capabilities = {
+      .canDelegateExpandLevel = 2,
+      .canDelegateFilter = true,
+  };
+  query_param::Query delegatedQuery;
+  if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
+                                                delegatedQuery, capabilities)) {
+    return;
+  }
+  getDumpEntryCollection(
+      app, req, asyncResp,
+      Dump{.type = DumpType::SYSTEM_FAULT_LOG, .systemName = systemName},
+      delegatedQuery);
 }
 
-void requestRoutesBMCDumpService(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/Dump/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleLogServicesDumpServiceGet, std::ref(app),
-                            DumpType::BMC_DUMP));
+void requestRoutesBMCDumpService(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/Dump/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleLogServicesDumpServiceGet, std::ref(app), DumpType::BMC_DUMP));
 }
 
-void requestRoutesBMCDumpEntryCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleLogServicesDumpEntriesCollectionGet,
-                            std::ref(app), DumpType::BMC_DUMP));
+void requestRoutesBMCDumpEntryCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleLogServicesDumpEntriesCollectionGet,
+                          std::ref(app), DumpType::BMC_DUMP));
 }
 
-void requestRoutesBMCDumpEntry(App& app)
-{
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/<str>/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleLogServicesDumpEntryGet, std::ref(app), DumpType::BMC_DUMP));
+void requestRoutesBMCDumpEntry(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/<str>/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleLogServicesDumpEntryGet, std::ref(app), DumpType::BMC_DUMP));
 
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/<str>/")
-        .privileges(redfish::privileges::deleteLogEntry)
-        .methods(boost::beast::http::verb::delete_)(
-            std::bind_front(handleLogServicesDumpEntryDelete, std::ref(app),
-                            DumpType::BMC_DUMP));
+  BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/<str>/")
+      .privileges(redfish::privileges::deleteLogEntry)
+      .methods(boost::beast::http::verb::delete_)(std::bind_front(
+          handleLogServicesDumpEntryDelete, std::ref(app), DumpType::BMC_DUMP));
 }
 
-void requestRoutesBMCDumpEntryDownload(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/<str>/attachment")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleLogServicesDumpEntryDownloadGet,
-                            std::ref(app), DumpType::BMC_DUMP));
+void requestRoutesBMCDumpEntryDownload(App& app) {
+  BMCWEB_ROUTE(
+      app, "/redfish/v1/Managers/bmc/LogServices/Dump/Entries/<str>/attachment")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleLogServicesDumpEntryDownloadGet, std::ref(app),
+                          DumpType::BMC_DUMP));
 }
 
-void requestRoutesBMCDumpCreate(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData/")
-        .privileges(redfish::privileges::postLogService)
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handleLogServicesDumpCollectDiagnosticDataPost,
-                            std::ref(app), DumpType::BMC_DUMP));
+void requestRoutesBMCDumpCreate(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Managers/bmc/LogServices/Dump/Actions/"
+               "LogService.CollectDiagnosticData/")
+      .privileges(redfish::privileges::postLogService)
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handleLogServicesDumpCollectDiagnosticDataPost,
+                          std::ref(app), DumpType::BMC_DUMP));
 }
 
-void requestRoutesBMCDumpClear(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.ClearLog/")
-        .privileges(redfish::privileges::postLogService)
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handleLogServicesDumpClearLogPost, std::ref(app),
-                            DumpType::BMC_DUMP));
+void requestRoutesBMCDumpClear(App& app) {
+  BMCWEB_ROUTE(
+      app,
+      "/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.ClearLog/")
+      .privileges(redfish::privileges::postLogService)
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handleLogServicesDumpClearLogPost, std::ref(app),
+                          DumpType::BMC_DUMP));
 }
 
-void requestRoutesFaultLogDumpService(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/FaultLog/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleLogServicesDumpServiceGet, std::ref(app),
-                            DumpType::BMC_FAULT_LOG));
+void requestRoutesFaultLogDumpService(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/FaultLog/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleLogServicesDumpServiceGet, std::ref(app),
+                          DumpType::BMC_FAULT_LOG));
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/FaultLog/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            [&app](const crow::Request& req,
-                   const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                   const std::string& systemName) {
-        if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-        {
-            return;
-        }
-        internal::getDumpServiceInfo(
-            asyncResp,
-            Dump{.type = DumpType::SYSTEM_FAULT_LOG, .systemName = systemName});
-    });
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/FaultLog/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(
+          [&app](const crow::Request& req,
+                 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                 const std::string& systemName) {
+            if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+              return;
+            }
+            internal::getDumpServiceInfo(
+                asyncResp, Dump{.type = DumpType::SYSTEM_FAULT_LOG,
+                                .systemName = systemName});
+          });
 }
 
-void requestRoutesFaultLogDumpEntryCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleLogServicesDumpEntriesCollectionGet,
-                            std::ref(app), DumpType::BMC_FAULT_LOG));
+void requestRoutesFaultLogDumpEntryCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleLogServicesDumpEntriesCollectionGet,
+                          std::ref(app), DumpType::BMC_FAULT_LOG));
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/FaultLog/Entries/")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleLogServiceFaultLogEntriesGet, std::ref(app)));
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/FaultLog/Entries/")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleLogServiceFaultLogEntriesGet, std::ref(app)));
 }
 
-void requestRoutesFaultLogDumpEntry(App& app)
-{
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/<str>/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleLogServicesDumpEntryGet, std::ref(app),
-                            DumpType::BMC_FAULT_LOG));
+void requestRoutesFaultLogDumpEntry(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/<str>/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleLogServicesDumpEntryGet, std::ref(app),
+                          DumpType::BMC_FAULT_LOG));
 
-    BMCWEB_ROUTE(
-        app, "/redfish/v1/Systems/<str>/LogServices/FaultLog/Entries/<str>/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(
-            [&app](const crow::Request& req,
-                   const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                   const std::string& systemName, const std::string& dumpId) {
-        if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-        {
-            return;
-        }
-        getDumpEntryById(
-            asyncResp, dumpId,
-            Dump{.type = DumpType::SYSTEM_FAULT_LOG, .systemName = systemName});
-    });
-
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/<str>/")
-        .privileges(redfish::privileges::deleteLogEntry)
-        .methods(boost::beast::http::verb::delete_)(
-            std::bind_front(handleLogServicesDumpEntryDelete, std::ref(app),
-                            DumpType::BMC_FAULT_LOG));
-
-    BMCWEB_ROUTE(
-        app, "/redfish/v1/Systems/<str>/LogServices/FaultLog/Entries/<str>/")
-        .privileges(redfish::privileges::deleteLogEntry)
-        .methods(boost::beast::http::verb::delete_)(
-            [&app](const crow::Request& req,
-                   const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                   const std::string& systemName, const std::string& dumpId) {
-        if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-        {
-            return;
-        }
-        deleteDumpEntry(
-            asyncResp, dumpId,
-            Dump{.type = DumpType::SYSTEM_FAULT_LOG, .systemName = systemName});
-    });
-}
-
-void requestRoutesFaultLogDumpClear(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Managers/bmc/LogServices/FaultLog/Actions/LogService.ClearLog/")
-        .privileges(redfish::privileges::postLogService)
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handleLogServicesDumpClearLogPost, std::ref(app),
-                            DumpType::BMC_FAULT_LOG));
-
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/FaultLog/Actions/LogService.ClearLog/")
-        .privileges(redfish::privileges::postLogService)
-        .methods(boost::beast::http::verb::post)(
-            [&app](const crow::Request& req,
-                   const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                   const std::string& systemName) {
-        if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-        {
-            return;
-        }
-        clearDump(asyncResp, Dump{.type = DumpType::SYSTEM_FAULT_LOG,
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/FaultLog/Entries/<str>/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(
+          [&app](const crow::Request& req,
+                 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                 const std::string& systemName, const std::string& dumpId) {
+            if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+              return;
+            }
+            getDumpEntryById(asyncResp, dumpId,
+                             Dump{.type = DumpType::SYSTEM_FAULT_LOG,
                                   .systemName = systemName});
-    });
+          });
+
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/<str>/")
+      .privileges(redfish::privileges::deleteLogEntry)
+      .methods(boost::beast::http::verb::delete_)(
+          std::bind_front(handleLogServicesDumpEntryDelete, std::ref(app),
+                          DumpType::BMC_FAULT_LOG));
+
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/FaultLog/Entries/<str>/")
+      .privileges(redfish::privileges::deleteLogEntry)
+      .methods(boost::beast::http::verb::delete_)(
+          [&app](const crow::Request& req,
+                 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                 const std::string& systemName, const std::string& dumpId) {
+            if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+              return;
+            }
+            deleteDumpEntry(asyncResp, dumpId,
+                            Dump{.type = DumpType::SYSTEM_FAULT_LOG,
+                                 .systemName = systemName});
+          });
 }
 
-void requestRoutesSystemDumpService(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Dump/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleLogServicesDumpServiceComputerSystemGet, std::ref(app)));
+void requestRoutesFaultLogDumpClear(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Managers/bmc/LogServices/FaultLog/Actions/"
+               "LogService.ClearLog/")
+      .privileges(redfish::privileges::postLogService)
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handleLogServicesDumpClearLogPost, std::ref(app),
+                          DumpType::BMC_FAULT_LOG));
+
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/FaultLog/Actions/"
+               "LogService.ClearLog/")
+      .privileges(redfish::privileges::postLogService)
+      .methods(boost::beast::http::verb::post)(
+          [&app](const crow::Request& req,
+                 const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                 const std::string& systemName) {
+            if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+              return;
+            }
+            clearDump(asyncResp, Dump{.type = DumpType::SYSTEM_FAULT_LOG,
+                                      .systemName = systemName});
+          });
 }
 
-void requestRoutesSystemDumpEntryCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Dump/Entries/")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleLogServicesDumpEntriesCollectionComputerSystemGet,
-            std::ref(app)));
+void requestRoutesSystemDumpService(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Dump/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleLogServicesDumpServiceComputerSystemGet, std::ref(app)));
 }
 
-void requestRoutesSystemDumpEntry(App& app)
-{
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Systems/<str>/LogServices/Dump/Entries/<str>/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleLogServicesDumpEntryComputerSystemGet, std::ref(app)));
-
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Systems/<str>/LogServices/Dump/Entries/<str>/")
-        .privileges(redfish::privileges::deleteLogEntry)
-        .methods(boost::beast::http::verb::delete_)(std::bind_front(
-            handleLogServicesDumpEntryComputerSystemDelete, std::ref(app)));
+void requestRoutesSystemDumpEntryCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Dump/Entries/")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleLogServicesDumpEntriesCollectionComputerSystemGet,
+          std::ref(app)));
 }
 
-void requestRoutesSystemDumpCreate(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/Dump/Actions/LogService.CollectDiagnosticData/")
-        .privileges(redfish::privileges::postLogService)
-        .methods(boost::beast::http::verb::post)(std::bind_front(
-            handleLogServicesDumpCollectDiagnosticDataComputerSystemPost,
-            std::ref(app)));
+void requestRoutesSystemDumpEntry(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Dump/Entries/<str>/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleLogServicesDumpEntryComputerSystemGet, std::ref(app)));
+
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Dump/Entries/<str>/")
+      .privileges(redfish::privileges::deleteLogEntry)
+      .methods(boost::beast::http::verb::delete_)(std::bind_front(
+          handleLogServicesDumpEntryComputerSystemDelete, std::ref(app)));
 }
 
-void requestRoutesSystemDumpClear(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/Dump/Actions/LogService.ClearLog/")
-        .privileges(redfish::privileges::postLogService)
-        .methods(boost::beast::http::verb::post)(std::bind_front(
-            handleLogServicesDumpClearLogComputerSystemPost, std::ref(app)));
+void requestRoutesSystemDumpCreate(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/Dump/Actions/"
+               "LogService.CollectDiagnosticData/")
+      .privileges(redfish::privileges::postLogService)
+      .methods(boost::beast::http::verb::post)(std::bind_front(
+          handleLogServicesDumpCollectDiagnosticDataComputerSystemPost,
+          std::ref(app)));
+}
+
+void requestRoutesSystemDumpClear(App& app) {
+  BMCWEB_ROUTE(
+      app,
+      "/redfish/v1/Systems/<str>/LogServices/Dump/Actions/LogService.ClearLog/")
+      .privileges(redfish::privileges::postLogService)
+      .methods(boost::beast::http::verb::post)(std::bind_front(
+          handleLogServicesDumpClearLogComputerSystemPost, std::ref(app)));
 }
 
 #ifdef BMCWEB_ENABLE_RASMANAGER_EVENT_LOG
 inline void handleLogServicesRasManagerGet(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    // Copy over the static data to include the entries added by
-    // SubRoute
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/HostCper";
-    asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_2_0.LogService";
-    asyncResp->res.jsonValue["Name"] = "Open BMC Oem RasManager Service";
-    asyncResp->res.jsonValue["Description"] = "Oem RasManager Service";
-    asyncResp->res.jsonValue["Id"] = "RasManager";
-    asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
+  // Copy over the static data to include the entries added by
+  // SubRoute
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/HostCper";
+  asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_2_0.LogService";
+  asyncResp->res.jsonValue["Name"] = "Open BMC Oem RasManager Service";
+  asyncResp->res.jsonValue["Description"] = "Oem RasManager Service";
+  asyncResp->res.jsonValue["Id"] = "RasManager";
+  asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
 
-    std::pair<std::string, std::string> redfishDateTimeOffset =
-        redfish::time_utils::getDateTimeOffsetNow();
-    asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
-    asyncResp->res.jsonValue["DateTimeLocalOffset"] =
-        redfishDateTimeOffset.second;
+  std::pair<std::string, std::string> redfishDateTimeOffset =
+      redfish::time_utils::getDateTimeOffsetNow();
+  asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
+  asyncResp->res.jsonValue["DateTimeLocalOffset"] =
+      redfishDateTimeOffset.second;
 
-    asyncResp->res.jsonValue["Entries"]["@odata.id"] =
-        crow::utility::urlFromPieces("redfish", "v1", "Systems", "system",
-                                     "LogServices", "HostCper", "Entries");
-    asyncResp->res.jsonValue["Actions"]["#LogService.ClearLog"]["target"] =
-        "/redfish/v1/Systems/system/LogServices/HostCper/Actions/LogService.ClearLog";
+  asyncResp->res.jsonValue["Entries"]["@odata.id"] =
+      crow::utility::urlFromPieces("redfish", "v1", "Systems", "system",
+                                   "LogServices", "HostCper", "Entries");
+  asyncResp->res.jsonValue["Actions"]["#LogService.ClearLog"]["target"] =
+      "/redfish/v1/Systems/system/LogServices/HostCper/Actions/"
+      "LogService.ClearLog";
 }
 
-void requestRoutesRasManagerLogService(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/HostCper/")
-        .privileges({{"ConfigureManager"}})
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleLogServicesRasManagerGet, std::ref(app)));
+void requestRoutesRasManagerLogService(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/HostCper/")
+      .privileges({{"ConfigureManager"}})
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleLogServicesRasManagerGet, std::ref(app)));
 }
 
 inline void handleLogServicesRasManagerClearLogPost(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp](const boost::system::error_code& ec,
-                    const std::string&) {
-        if (ec)
-        {
-            messages::internalError(asyncResp->res);
-            return;
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp](const boost::system::error_code& ec, const std::string&) {
+        if (ec) {
+          messages::internalError(asyncResp->res);
+          return;
         }
         messages::success(asyncResp->res);
-    }, rasManagerObject, rasManagerPath, deleteAllInterface, "DeleteAll");
+      },
+      rasManagerObject, rasManagerPath, deleteAllInterface, "DeleteAll");
 }
 
-void requestRoutesRasManagerLogClear(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/HostCper/Actions/LogService.ClearLog/")
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::post)(std::bind_front(
-            handleLogServicesRasManagerClearLogPost, std::ref(app)));
+void requestRoutesRasManagerLogClear(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/HostCper/Actions/"
+               "LogService.ClearLog/")
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::post)(std::bind_front(
+          handleLogServicesRasManagerClearLogPost, std::ref(app)));
 }
 
-inline static void
-    logRasManagerEntry(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                       const std::string& logID, nlohmann::json& logEntryJson)
-{
-    auto getStoredLogCallback =
-        [asyncResp, logID,
-         &logEntryJson](const boost::system::error_code& ec,
-                        const dbus::utility::DBusPropertiesMap& params) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "failed to get log ec: " << ec.message();
-            if (ec.value() ==
-                boost::system::linux_error::bad_request_descriptor)
-            {
-                messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
-            }
-            else
-            {
-                messages::internalError(asyncResp->res);
-            }
-            return;
+inline static void logRasManagerEntry(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& logID, nlohmann::json& logEntryJson) {
+  auto getStoredLogCallback =
+      [asyncResp, logID, &logEntryJson](
+          const boost::system::error_code& ec,
+          const dbus::utility::DBusPropertiesMap& params) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "failed to get log ec: " << ec.message();
+          if (ec.value() ==
+              boost::system::linux_error::bad_request_descriptor) {
+            messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
+          } else {
+            messages::internalError(asyncResp->res);
+          }
+          return;
         }
 
         uint64_t timestampMs = 0;
@@ -3117,14 +2749,12 @@
             dbus_utils::UnpackErrorPrinter(), params, "TimestampMs",
             timestampPtr);
 
-        if (!success)
-        {
-            return;
+        if (!success) {
+          return;
         }
 
-        if (timestampPtr != nullptr)
-        {
-            timestampMs = *timestampPtr;
+        if (timestampPtr != nullptr) {
+          timestampMs = *timestampPtr;
         }
 
         nlohmann::json::object_t logEntry;
@@ -3143,10 +2773,9 @@
         // read bin data from file and then encode it to boost base64
         std::string cperFile = rasManagerLogPath + logID + ".cpr";
         std::ifstream ifs(cperFile, std::ios::in | std::ios::binary);
-        if (!ifs.is_open())
-        {
-            BMCWEB_LOG_ERROR << "Failed to open file: " << cperFile;
-            return;
+        if (!ifs.is_open()) {
+          BMCWEB_LOG_ERROR << "Failed to open file: " << cperFile;
+          return;
         }
         std::string cperData((std::istreambuf_iterator<char>(ifs)),
                              (std::istreambuf_iterator<char>()));
@@ -3161,56 +2790,45 @@
         // If logEntryJson references an array of LogEntry resources
         // ('Members' list), then push this as a new entry, otherwise set it
         // directly
-        if (logEntryJson.is_array())
-        {
-            logEntryJson.push_back(logEntry);
-            asyncResp->res.jsonValue["Members@odata.count"] =
-                logEntryJson.size();
+        if (logEntryJson.is_array()) {
+          logEntryJson.push_back(logEntry);
+          asyncResp->res.jsonValue["Members@odata.count"] = logEntryJson.size();
+        } else {
+          logEntryJson.update(logEntry);
         }
-        else
-        {
-            logEntryJson.update(logEntry);
-        }
-    };
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    managedStore::GetManagedObjectStore()->getAllProperties(
-        rasManagerObject, rasManagerPath + std::string("/") + logID,
-        "xyz.openbmc_project.Time.EpochTime", context,
-        std::move(getStoredLogCallback));
+      };
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  managedStore::GetManagedObjectStore()->getAllProperties(
+      rasManagerObject, rasManagerPath + std::string("/") + logID,
+      "xyz.openbmc_project.Time.EpochTime", context,
+      std::move(getStoredLogCallback));
 }
 
 inline void handleLogServicesRasManagerEntriesCollectionGet(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    constexpr std::array<std::string_view, 1> interfaces = {
-        "xyz.openbmc_project.Time.EpochTime"};
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    managedStore::GetManagedObjectStore()->getSubTreePaths(
-        rasManagerPath, 0, interfaces, requestContext,
-        [asyncResp](const boost::system::error_code& ec,
-                    const std::vector<std::string>& resp) {
-        if (ec)
-        {
-            if (ec.value() != boost::system::errc::no_such_file_or_directory)
-            {
-                BMCWEB_LOG_DEBUG << "failed to get entries ec: "
-                                 << ec.message();
-                messages::internalError(asyncResp->res);
-                return;
-            }
+  constexpr std::array<std::string_view, 1> interfaces = {
+      "xyz.openbmc_project.Time.EpochTime"};
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  managedStore::GetManagedObjectStore()->getSubTreePaths(
+      rasManagerPath, 0, interfaces, requestContext,
+      [asyncResp](const boost::system::error_code& ec,
+                  const std::vector<std::string>& resp) {
+        if (ec) {
+          if (ec.value() != boost::system::errc::no_such_file_or_directory) {
+            BMCWEB_LOG_DEBUG << "failed to get entries ec: " << ec.message();
+            messages::internalError(asyncResp->res);
+            return;
+          }
         }
         asyncResp->res.jsonValue["@odata.type"] =
             "#LogEntryCollection.LogEntryCollection";
@@ -3222,190 +2840,164 @@
         asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
         asyncResp->res.jsonValue["Members@odata.count"] = 0;
 
-        for (const std::string& path : resp)
-        {
-            const sdbusplus::message::object_path objPath(path);
-            // Get the log ID
-            std::string logID = objPath.filename();
-            if (logID.empty())
-            {
-                continue;
-            }
-            // Add the log entry to the array
-            logRasManagerEntry(asyncResp, logID,
-                               asyncResp->res.jsonValue["Members"]);
+        for (const std::string& path : resp) {
+          const sdbusplus::message::object_path objPath(path);
+          // Get the log ID
+          std::string logID = objPath.filename();
+          if (logID.empty()) {
+            continue;
+          }
+          // Add the log entry to the array
+          logRasManagerEntry(asyncResp, logID,
+                             asyncResp->res.jsonValue["Members"]);
         }
-    });
+      });
 }
 
-void requestRoutesRasManagerLogEntryCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/HostCper/Entries/")
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleLogServicesRasManagerEntriesCollectionGet, std::ref(app)));
+void requestRoutesRasManagerLogEntryCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/HostCper/Entries/")
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleLogServicesRasManagerEntriesCollectionGet, std::ref(app)));
 }
 
 inline void handleLogServicesRasManagerEntryGet(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName, const std::string& param)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    const std::string& logID = param;
+    const std::string& systemName, const std::string& param) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  const std::string& logID = param;
 
-    logRasManagerEntry(asyncResp, logID, asyncResp->res.jsonValue);
+  logRasManagerEntry(asyncResp, logID, asyncResp->res.jsonValue);
 }
 
-void requestRoutesRasManagerLogEntry(App& app)
-{
-    // Note: Deviated from redfish privilege registry for GET & HEAD
-    // method for security reasons.
+void requestRoutesRasManagerLogEntry(App& app) {
+  // Note: Deviated from redfish privilege registry for GET & HEAD
+  // method for security reasons.
 
-    BMCWEB_ROUTE(
-        app, "/redfish/v1/Systems/<str>/LogServices/HostCper/Entries/<str>/")
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleLogServicesRasManagerEntryGet, std::ref(app)));
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/HostCper/Entries/<str>/")
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleLogServicesRasManagerEntryGet, std::ref(app)));
 }
-#endif // BMCWEB_ENABLE_RASMANAGER_EVENT_LOG
+#endif  // BMCWEB_ENABLE_RASMANAGER_EVENT_LOG
 
 inline void handleGetCrashdumpService(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    // Copy over the static data to include the entries added by
-    // SubRoute
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/Crashdump";
-    asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_2_0.LogService";
-    asyncResp->res.jsonValue["Name"] = "Open BMC Oem Crashdump Service";
-    asyncResp->res.jsonValue["Description"] = "Oem Crashdump Service";
-    asyncResp->res.jsonValue["Id"] = "Crashdump";
-    asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
-    if constexpr (bmcwebEnableAmd)
-    {
-        asyncResp->res.jsonValue["MaxNumberOfRecords"] = 10;
-    }
-    else
-    {
-        asyncResp->res.jsonValue["MaxNumberOfRecords"] = 3;
-    }
+  // Copy over the static data to include the entries added by
+  // SubRoute
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/Crashdump";
+  asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_2_0.LogService";
+  asyncResp->res.jsonValue["Name"] = "Open BMC Oem Crashdump Service";
+  asyncResp->res.jsonValue["Description"] = "Oem Crashdump Service";
+  asyncResp->res.jsonValue["Id"] = "Crashdump";
+  asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
+  if constexpr (bmcwebEnableAmd) {
+    asyncResp->res.jsonValue["MaxNumberOfRecords"] = 10;
+  } else {
+    asyncResp->res.jsonValue["MaxNumberOfRecords"] = 3;
+  }
 
-    std::pair<std::string, std::string> redfishDateTimeOffset =
-        redfish::time_utils::getDateTimeOffsetNow();
-    asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
-    asyncResp->res.jsonValue["DateTimeLocalOffset"] =
-        redfishDateTimeOffset.second;
+  std::pair<std::string, std::string> redfishDateTimeOffset =
+      redfish::time_utils::getDateTimeOffsetNow();
+  asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
+  asyncResp->res.jsonValue["DateTimeLocalOffset"] =
+      redfishDateTimeOffset.second;
 
-    asyncResp->res.jsonValue["Entries"]["@odata.id"] =
-        crow::utility::urlFromPieces("redfish", "v1", "Systems", "system",
-                                     "LogServices", "Crashdump", "Entries");
-    asyncResp->res.jsonValue["Actions"]["#LogService.ClearLog"]["target"] =
-        "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/LogService.ClearLog";
-    asyncResp->res
-        .jsonValue["Actions"]["#LogService.CollectDiagnosticData"]["target"] =
-        "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/LogService.CollectDiagnosticData";
+  asyncResp->res.jsonValue["Entries"]["@odata.id"] =
+      crow::utility::urlFromPieces("redfish", "v1", "Systems", "system",
+                                   "LogServices", "Crashdump", "Entries");
+  asyncResp->res.jsonValue["Actions"]["#LogService.ClearLog"]["target"] =
+      "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/"
+      "LogService.ClearLog";
+  asyncResp->res
+      .jsonValue["Actions"]["#LogService.CollectDiagnosticData"]["target"] =
+      "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/"
+      "LogService.CollectDiagnosticData";
 }
 
-void requestRoutesCrashdumpService(App& app)
-{
-    // Note: Deviated from redfish privilege registry for GET & HEAD
-    // method for security reasons.
-    /**
-     * Functions triggers appropriate requests on DBus
-     */
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Crashdump/")
-        // This is incorrect, should be:
-        //.privileges(redfish::privileges::getLogService)
-        .privileges({{"ConfigureManager"}})
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetCrashdumpService, std::ref(app)));
+void requestRoutesCrashdumpService(App& app) {
+  // Note: Deviated from redfish privilege registry for GET & HEAD
+  // method for security reasons.
+  /**
+   * Functions triggers appropriate requests on DBus
+   */
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Crashdump/")
+      // This is incorrect, should be:
+      // .privileges(redfish::privileges::getLogService)
+      .privileges({{"ConfigureManager"}})
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetCrashdumpService, std::ref(app)));
 }
 
 inline void handlePostCrashdumpClear(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-        managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-            asyncResp->strand_,
-            [asyncResp](const boost::system::error_code& ec,
-                        const std::string&) {
-            if (ec)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-            messages::success(asyncResp->res);
-        },
-            crashdumpObject, crashdumpPath, deleteAllInterface, "DeleteAll");
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp](const boost::system::error_code& ec, const std::string&) {
+        if (ec) {
+          messages::internalError(asyncResp->res);
+          return;
+        }
+        messages::success(asyncResp->res);
+      },
+      crashdumpObject, crashdumpPath, deleteAllInterface, "DeleteAll");
 }
 
-void requestRoutesCrashdumpClear(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/Crashdump/Actions/LogService.ClearLog/")
-        // This is incorrect, should be:
-        //.privileges(redfish::privileges::postLogService)
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handlePostCrashdumpClear, std::ref(app)));
+void requestRoutesCrashdumpClear(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/Crashdump/Actions/"
+               "LogService.ClearLog/")
+      // This is incorrect, should be:
+      // .privileges(redfish::privileges::postLogService)
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handlePostCrashdumpClear, std::ref(app)));
 }
 
-inline static void
-    logCrashdumpEntry(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                      const std::string& logID, nlohmann::json& logEntryJson)
-{
-    auto getStoredLogCallback =
-        [asyncResp, logID,
-         &logEntryJson](const boost::system::error_code& ec,
-                        const dbus::utility::DBusPropertiesMap& params) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "failed to get log ec: " << ec.message();
-            if (ec.value() ==
-                boost::system::linux_error::bad_request_descriptor)
-            {
-                messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
-            }
-            else
-            {
-                messages::internalError(asyncResp->res);
-            }
-            return;
+inline static void logCrashdumpEntry(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& logID, nlohmann::json& logEntryJson) {
+  auto getStoredLogCallback =
+      [asyncResp, logID, &logEntryJson](
+          const boost::system::error_code& ec,
+          const dbus::utility::DBusPropertiesMap& params) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "failed to get log ec: " << ec.message();
+          if (ec.value() ==
+              boost::system::linux_error::bad_request_descriptor) {
+            messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
+          } else {
+            messages::internalError(asyncResp->res);
+          }
+          return;
         }
 
         std::string timestamp{};
@@ -3413,10 +3005,9 @@
         std::string logfile{};
         parseCrashdumpParameters(params, filename, timestamp, logfile);
 
-        if (filename.empty() || timestamp.empty())
-        {
-            messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
-            return;
+        if (filename.empty() || timestamp.empty()) {
+          messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
+          return;
         }
 
         std::string crashdumpURI =
@@ -3432,95 +3023,76 @@
         logEntry["EntryType"] = "Oem";
         logEntry["AdditionalDataURI"] = std::move(crashdumpURI);
         logEntry["DiagnosticDataType"] = "OEM";
-        if constexpr (bmcwebEnableAmd)
-        {
-            logEntry["OEMDiagnosticDataType"] = "CPER";
-        }
-        else
-        {
-            logEntry["OEMDiagnosticDataType"] = "PECICrashdump";
+        if constexpr (bmcwebEnableAmd) {
+          logEntry["OEMDiagnosticDataType"] = "CPER";
+        } else {
+          logEntry["OEMDiagnosticDataType"] = "PECICrashdump";
         }
         logEntry["Created"] = std::move(timestamp);
 
         // If logEntryJson references an array of LogEntry resources
         // ('Members' list), then push this as a new entry, otherwise set it
         // directly
-        if (logEntryJson.is_array())
-        {
-            logEntryJson.push_back(logEntry);
-            asyncResp->res.jsonValue["Members@odata.count"] =
-                logEntryJson.size();
+        if (logEntryJson.is_array()) {
+          logEntryJson.push_back(logEntry);
+          asyncResp->res.jsonValue["Members@odata.count"] = logEntryJson.size();
+        } else {
+          logEntryJson.update(logEntry);
         }
-        else
-        {
-            logEntryJson.update(logEntry);
-        }
-    };
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    managedStore::GetManagedObjectStore()->getAllProperties(
-        crashdumpObject, crashdumpPath + std::string("/") + logID,
-        crashdumpInterface, context, std::move(getStoredLogCallback));
+      };
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  managedStore::GetManagedObjectStore()->getAllProperties(
+      crashdumpObject, crashdumpPath + std::string("/") + logID,
+      crashdumpInterface, context, std::move(getStoredLogCallback));
 }
 
 inline void parseElapsedTimestampFromDbusObject(
     const dbus::utility::ManagedObjectType::value_type& object,
-    uint64_t& timestampUs, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    for (const auto& interfaceMap : object.second)
-    {
-        if (interfaceMap.first == "xyz.openbmc_project.Time.EpochTime")
-        {
-            for (const auto& propertyMap : interfaceMap.second)
-            {
-                if (propertyMap.first == "Elapsed")
-                {
-                    const uint64_t* usecsTimeStamp =
-                        std::get_if<uint64_t>(&propertyMap.second);
-                    if (usecsTimeStamp == nullptr)
-                    {
-                        messages::internalError(asyncResp->res);
-                        break;
-                    }
-                    timestampUs = *usecsTimeStamp;
-                    break;
-                }
-            }
+    uint64_t& timestampUs,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  for (const auto& interfaceMap : object.second) {
+    if (interfaceMap.first == "xyz.openbmc_project.Time.EpochTime") {
+      for (const auto& propertyMap : interfaceMap.second) {
+        if (propertyMap.first == "Elapsed") {
+          const uint64_t* usecsTimeStamp =
+              std::get_if<uint64_t>(&propertyMap.second);
+          if (usecsTimeStamp == nullptr) {
+            messages::internalError(asyncResp->res);
             break;
+          }
+          timestampUs = *usecsTimeStamp;
+          break;
         }
+      }
+      break;
     }
+  }
 }
 
 inline void handleGetCrashdumpEntryCollection(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    constexpr std::array<std::string_view, 1> interfaces = {crashdumpInterface};
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    managedStore::GetManagedObjectStore()->getSubTreePaths(
-        "/", 0, interfaces, requestContext,
-        [asyncResp](const boost::system::error_code& ec,
-                    const std::vector<std::string>& resp) {
-        if (ec)
-        {
-            if (ec.value() != boost::system::errc::no_such_file_or_directory)
-            {
-                BMCWEB_LOG_DEBUG << "failed to get entries ec: "
-                                 << ec.message();
-                messages::internalError(asyncResp->res);
-                return;
-            }
+  constexpr std::array<std::string_view, 1> interfaces = {crashdumpInterface};
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  managedStore::GetManagedObjectStore()->getSubTreePaths(
+      "/", 0, interfaces, requestContext,
+      [asyncResp](const boost::system::error_code& ec,
+                  const std::vector<std::string>& resp) {
+        if (ec) {
+          if (ec.value() != boost::system::errc::no_such_file_or_directory) {
+            BMCWEB_LOG_DEBUG << "failed to get entries ec: " << ec.message();
+            messages::internalError(asyncResp->res);
+            return;
+          }
         }
         asyncResp->res.jsonValue["@odata.type"] =
             "#LogEntryCollection.LogEntryCollection";
@@ -3532,100 +3104,85 @@
         asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
         asyncResp->res.jsonValue["Members@odata.count"] = 0;
 
-        for (const std::string& path : resp)
-        {
-            const sdbusplus::message::object_path objPath(path);
-            // Get the log ID
-            std::string logID = objPath.filename();
-            if (logID.empty())
-            {
-                continue;
-            }
-            // Add the log entry to the array
-            logCrashdumpEntry(asyncResp, logID,
-                              asyncResp->res.jsonValue["Members"]);
+        for (const std::string& path : resp) {
+          const sdbusplus::message::object_path objPath(path);
+          // Get the log ID
+          std::string logID = objPath.filename();
+          if (logID.empty()) {
+            continue;
+          }
+          // Add the log entry to the array
+          logCrashdumpEntry(asyncResp, logID,
+                            asyncResp->res.jsonValue["Members"]);
         }
-    });
+      });
 }
 
-void requestRoutesCrashdumpEntryCollection(App& app)
-{
-    // Note: Deviated from redfish privilege registry for GET & HEAD
-    // method for security reasons.
-    /**
-     * Functions triggers appropriate requests on DBus
-     */
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Systems/<str>/LogServices/Crashdump/Entries/")
-        // This is incorrect, should be.
-        //.privileges(redfish::privileges::postLogEntryCollection)
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetCrashdumpEntryCollection, std::ref(app)));
+void requestRoutesCrashdumpEntryCollection(App& app) {
+  // Note: Deviated from redfish privilege registry for GET & HEAD
+  // method for security reasons.
+  /**
+   * Functions triggers appropriate requests on DBus
+   */
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/Crashdump/Entries/")
+      // This is incorrect, should be.
+      // .privileges(redfish::privileges::postLogEntryCollection)
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetCrashdumpEntryCollection, std::ref(app)));
 }
 
-inline void
-    handleGetCrashdumpEntry(App& app, const crow::Request& req,
-                            const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                            const std::string& systemName,
-                            const std::string& param)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    const std::string& logID = param;
+inline void handleGetCrashdumpEntry(
+    App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& systemName, const std::string& param) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  const std::string& logID = param;
 
-    logCrashdumpEntry(asyncResp, logID, asyncResp->res.jsonValue);
+  logCrashdumpEntry(asyncResp, logID, asyncResp->res.jsonValue);
 }
 
-void requestRoutesCrashdumpEntry(App& app)
-{
-    // Note: Deviated from redfish privilege registry for GET & HEAD
-    // method for security reasons.
+void requestRoutesCrashdumpEntry(App& app) {
+  // Note: Deviated from redfish privilege registry for GET & HEAD
+  // method for security reasons.
 
-    BMCWEB_ROUTE(
-        app, "/redfish/v1/Systems/<str>/LogServices/Crashdump/Entries/<str>/")
-        // this is incorrect, should be
-        // .privileges(redfish::privileges::getLogEntry)
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetCrashdumpEntry, std::ref(app)));
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/Crashdump/Entries/<str>/")
+      // this is incorrect, should be
+      // .privileges(redfish::privileges::getLogEntry)
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetCrashdumpEntry, std::ref(app)));
 }
 
-inline void
-    handleGetCrashdumpFile([[maybe_unused]] App& app, const crow::Request& req,
-                           const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                           const std::string& systemName,
-                           const std::string& logID,
-                           const std::string& fileName)
-{
-    // Do not call getRedfishRoute here since the crashdump file is not a
-    // Redfish resource.
+inline void handleGetCrashdumpFile(
+    [[maybe_unused]] App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& systemName, const std::string& logID,
+    const std::string& fileName) {
+  // Do not call getRedfishRoute here since the crashdump file is not a
+  // Redfish resource.
 
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    auto getStoredLogCallback =
-        [asyncResp, logID, fileName, url(boost::urls::url(req.url()))](
-            const boost::system::error_code& ec,
-            const std::vector<
-                std::pair<std::string, dbus::utility::DbusVariantType>>& resp) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "failed to get log ec: " << ec.message();
-            messages::internalError(asyncResp->res);
-            return;
+  auto getStoredLogCallback =
+      [asyncResp, logID, fileName, url(boost::urls::url(req.url()))](
+          const boost::system::error_code& ec,
+          const std::vector<
+              std::pair<std::string, dbus::utility::DbusVariantType>>& resp) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "failed to get log ec: " << ec.message();
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         std::string dbusFilename{};
@@ -3636,23 +3193,20 @@
                                  dbusFilepath);
 
         if (dbusFilename.empty() || dbusTimestamp.empty() ||
-            dbusFilepath.empty())
-        {
-            messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
-            return;
+            dbusFilepath.empty()) {
+          messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
+          return;
         }
 
         // Verify the file name parameter is correct
-        if (fileName != dbusFilename)
-        {
-            messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
-            return;
+        if (fileName != dbusFilename) {
+          messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
+          return;
         }
 
-        if (!std::filesystem::exists(dbusFilepath))
-        {
-            messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
-            return;
+        if (!std::filesystem::exists(dbusFilepath)) {
+          messages::resourceNotFound(asyncResp->res, "LogEntry", logID);
+          return;
         }
         std::ifstream ifs(dbusFilepath, std::ios::in | std::ios::binary);
         asyncResp->res.body() =
@@ -3662,346 +3216,301 @@
         // from a browser
         asyncResp->res.addHeader(boost::beast::http::field::content_disposition,
                                  "attachment");
-    };
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    managedStore::GetManagedObjectStore()->getAllProperties(
-        crashdumpObject, crashdumpPath + std::string("/") + logID,
-        crashdumpInterface, context, std::move(getStoredLogCallback));
+      };
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  managedStore::GetManagedObjectStore()->getAllProperties(
+      crashdumpObject, crashdumpPath + std::string("/") + logID,
+      crashdumpInterface, context, std::move(getStoredLogCallback));
 }
 
-void requestRoutesCrashdumpFile(App& app)
-{
-    // Note: Deviated from redfish privilege registry for GET & HEAD
-    // method for security reasons.
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/Crashdump/Entries/<str>/<str>/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetCrashdumpFile, std::ref(app)));
+void requestRoutesCrashdumpFile(App& app) {
+  // Note: Deviated from redfish privilege registry for GET & HEAD
+  // method for security reasons.
+  BMCWEB_ROUTE(
+      app,
+      "/redfish/v1/Systems/<str>/LogServices/Crashdump/Entries/<str>/<str>/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetCrashdumpFile, std::ref(app)));
 }
 
-enum class OEMDiagnosticType : std::uint8_t
-{
-    onDemand,
-    telemetry,
-    invalid,
+enum class OEMDiagnosticType : std::uint8_t {
+  onDemand,
+  telemetry,
+  invalid,
 };
 
-inline OEMDiagnosticType getOEMDiagnosticType(std::string_view oemDiagStr)
-{
-    if (oemDiagStr == "OnDemand")
-    {
-        return OEMDiagnosticType::onDemand;
-    }
-    if (oemDiagStr == "Telemetry")
-    {
-        return OEMDiagnosticType::telemetry;
-    }
+inline OEMDiagnosticType getOEMDiagnosticType(std::string_view oemDiagStr) {
+  if (oemDiagStr == "OnDemand") {
+    return OEMDiagnosticType::onDemand;
+  }
+  if (oemDiagStr == "Telemetry") {
+    return OEMDiagnosticType::telemetry;
+  }
 
-    return OEMDiagnosticType::invalid;
+  return OEMDiagnosticType::invalid;
 }
 
 inline void handlePostCrashdumpCollect(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    std::string diagnosticDataType;
-    std::string oemDiagnosticDataType;
-    if (!redfish::json_util::readJsonAction(
-            req, asyncResp->res, "DiagnosticDataType", diagnosticDataType,
-            "OEMDiagnosticDataType", oemDiagnosticDataType))
-    {
-        return;
-    }
+  std::string diagnosticDataType;
+  std::string oemDiagnosticDataType;
+  if (!redfish::json_util::readJsonAction(
+          req, asyncResp->res, "DiagnosticDataType", diagnosticDataType,
+          "OEMDiagnosticDataType", oemDiagnosticDataType)) {
+    return;
+  }
 
-    if (diagnosticDataType != "OEM")
-    {
-        BMCWEB_LOG_ERROR
-            << "Only OEM DiagnosticDataType supported for Crashdump";
-        messages::actionParameterValueFormatError(
-            asyncResp->res, diagnosticDataType, "DiagnosticDataType",
-            "CollectDiagnosticData");
-        return;
-    }
+  if (diagnosticDataType != "OEM") {
+    BMCWEB_LOG_ERROR << "Only OEM DiagnosticDataType supported for Crashdump";
+    messages::actionParameterValueFormatError(
+        asyncResp->res, diagnosticDataType, "DiagnosticDataType",
+        "CollectDiagnosticData");
+    return;
+  }
 
-    OEMDiagnosticType oemDiagType = getOEMDiagnosticType(oemDiagnosticDataType);
+  OEMDiagnosticType oemDiagType = getOEMDiagnosticType(oemDiagnosticDataType);
 
-    std::string iface;
-    std::string method;
-    std::string taskMatchStr;
-    if (oemDiagType == OEMDiagnosticType::onDemand)
-    {
-        iface = crashdumpOnDemandInterface;
-        method = "GenerateOnDemandLog";
-        if constexpr (bmcwebEnableAmd)
-        {
-            taskMatchStr = "type='signal',"
-                           "interface='org.freedesktop.DBus.Properties',"
-                           "member='PropertiesChanged',"
-                           "arg0namespace='com.amd.crashdump'";
-        }
-        else
-        {
-            taskMatchStr = "type='signal',"
-                           "interface='org.freedesktop.DBus.Properties',"
-                           "member='PropertiesChanged',"
-                           "arg0namespace='com.intel.crashdump'";
-        }
+  std::string iface;
+  std::string method;
+  std::string taskMatchStr;
+  if (oemDiagType == OEMDiagnosticType::onDemand) {
+    iface = crashdumpOnDemandInterface;
+    method = "GenerateOnDemandLog";
+    if constexpr (bmcwebEnableAmd) {
+      taskMatchStr =
+          "type='signal',"
+          "interface='org.freedesktop.DBus.Properties',"
+          "member='PropertiesChanged',"
+          "arg0namespace='com.amd.crashdump'";
+    } else {
+      taskMatchStr =
+          "type='signal',"
+          "interface='org.freedesktop.DBus.Properties',"
+          "member='PropertiesChanged',"
+          "arg0namespace='com.intel.crashdump'";
     }
-    else if (oemDiagType == OEMDiagnosticType::telemetry)
-    {
-        iface = crashdumpTelemetryInterface;
-        method = "GenerateTelemetryLog";
-        if constexpr (bmcwebEnableAmd)
-        {
-            taskMatchStr = "type='signal',"
-                           "interface='org.freedesktop.DBus.Properties',"
-                           "member='PropertiesChanged',"
-                           "arg0namespace='com.amd.crashdump'";
-        }
-        else
-        {
-            taskMatchStr = "type='signal',"
-                           "interface='org.freedesktop.DBus.Properties',"
-                           "member='PropertiesChanged',"
-                           "arg0namespace='com.intel.crashdump'";
-        }
+  } else if (oemDiagType == OEMDiagnosticType::telemetry) {
+    iface = crashdumpTelemetryInterface;
+    method = "GenerateTelemetryLog";
+    if constexpr (bmcwebEnableAmd) {
+      taskMatchStr =
+          "type='signal',"
+          "interface='org.freedesktop.DBus.Properties',"
+          "member='PropertiesChanged',"
+          "arg0namespace='com.amd.crashdump'";
+    } else {
+      taskMatchStr =
+          "type='signal',"
+          "interface='org.freedesktop.DBus.Properties',"
+          "member='PropertiesChanged',"
+          "arg0namespace='com.intel.crashdump'";
     }
-    else
-    {
-        BMCWEB_LOG_ERROR << "Unsupported OEMDiagnosticDataType: "
-                         << oemDiagnosticDataType;
-        messages::actionParameterValueFormatError(
-            asyncResp->res, oemDiagnosticDataType, "OEMDiagnosticDataType",
-            "CollectDiagnosticData");
-        return;
-    }
+  } else {
+    BMCWEB_LOG_ERROR << "Unsupported OEMDiagnosticDataType: "
+                     << oemDiagnosticDataType;
+    messages::actionParameterValueFormatError(
+        asyncResp->res, oemDiagnosticDataType, "OEMDiagnosticDataType",
+        "CollectDiagnosticData");
+    return;
+  }
 
-    auto collectCrashdumpCallback =
-        [asyncResp, payload(task::Payload(req)), taskMatchStr](
-            const boost::system::error_code& ec, const std::string&) mutable {
-        if (ec)
-        {
-            if (ec.value() == boost::system::errc::operation_not_supported)
-            {
-                messages::resourceInStandby(asyncResp->res);
-            }
-            else if (ec.value() == boost::system::errc::device_or_resource_busy)
-            {
-                messages::serviceTemporarilyUnavailable(asyncResp->res, "60");
-            }
-            else
-            {
-                messages::internalError(asyncResp->res);
-            }
-            return;
-        }
-        std::shared_ptr<task::TaskData> task = task::TaskData::createTask(
-            [](const boost::system::error_code& err, sdbusplus::message_t&,
-               const std::shared_ptr<task::TaskData>& taskData) {
-            if (!err)
-            {
-                taskData->messages.emplace_back(
-                    messages::taskCompletedOK(std::to_string(taskData->index)));
-                taskData->state = "Completed";
-            }
-            return task::completed;
+  auto collectCrashdumpCallback = [asyncResp, payload(task::Payload(req)),
+                                   taskMatchStr](
+                                      const boost::system::error_code& ec,
+                                      const std::string&) mutable {
+    if (ec) {
+      if (ec.value() == boost::system::errc::operation_not_supported) {
+        messages::resourceInStandby(asyncResp->res);
+      } else if (ec.value() == boost::system::errc::device_or_resource_busy) {
+        messages::serviceTemporarilyUnavailable(asyncResp->res, "60");
+      } else {
+        messages::internalError(asyncResp->res);
+      }
+      return;
+    }
+    std::shared_ptr<task::TaskData> task = task::TaskData::createTask(
+        [](const boost::system::error_code& err, sdbusplus::message_t&,
+           const std::shared_ptr<task::TaskData>& taskData) {
+          if (!err) {
+            taskData->messages.emplace_back(
+                messages::taskCompletedOK(std::to_string(taskData->index)));
+            taskData->state = "Completed";
+          }
+          return task::completed;
         },
-            taskMatchStr);
+        taskMatchStr);
 
-        task->startTimer(std::chrono::minutes(5));
-        task->populateResp(asyncResp->res);
-        task->payload.emplace(std::move(payload));
-    };
+    task->startTimer(std::chrono::minutes(5));
+    task->populateResp(asyncResp->res);
+    task->payload.emplace(std::move(payload));
+  };
 
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        std::move(collectCrashdumpCallback), crashdumpObject, crashdumpPath,
-        iface, method);
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_, std::move(collectCrashdumpCallback), crashdumpObject,
+      crashdumpPath, iface, method);
 }
 
-void requestRoutesCrashdumpCollect(App& app)
-{
-    // Note: Deviated from redfish privilege registry for GET & HEAD
-    // method for security reasons.
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/Crashdump/Actions/LogService.CollectDiagnosticData/")
-        // The below is incorrect;  Should be ConfigureManager
-        //.privileges(redfish::privileges::postLogService)
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handlePostCrashdumpCollect, std::ref(app)));
+void requestRoutesCrashdumpCollect(App& app) {
+  // Note: Deviated from redfish privilege registry for GET & HEAD
+  // method for security reasons.
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/Crashdump/Actions/"
+               "LogService.CollectDiagnosticData/")
+      // The below is incorrect;  Should be ConfigureManager
+      // .privileges(redfish::privileges::postLogService)
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handlePostCrashdumpCollect, std::ref(app)));
 }
 
 inline void handlePostDBusLogServiceActionsClear(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  BMCWEB_LOG_DEBUG << "Do delete all entries.";
+
+  // Process response from Logging service.
+  auto respHandler = [asyncResp](const boost::system::error_code& ec) {
+    BMCWEB_LOG_DEBUG << "doClearLog resp_handler callback: Done";
+    if (ec) {
+      // TODO Handle for specific error code
+      BMCWEB_LOG_ERROR << "doClearLog resp_handler got error " << ec;
+      asyncResp->res.result(boost::beast::http::status::internal_server_error);
+      return;
     }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    BMCWEB_LOG_DEBUG << "Do delete all entries.";
 
-    // Process response from Logging service.
-    auto respHandler = [asyncResp](const boost::system::error_code& ec) {
-        BMCWEB_LOG_DEBUG << "doClearLog resp_handler callback: Done";
-        if (ec)
-        {
-            // TODO Handle for specific error code
-            BMCWEB_LOG_ERROR << "doClearLog resp_handler got error " << ec;
-            asyncResp->res.result(
-                boost::beast::http::status::internal_server_error);
-            return;
-        }
+    asyncResp->res.result(boost::beast::http::status::no_content);
+  };
 
-        asyncResp->res.result(boost::beast::http::status::no_content);
-    };
-
-    // Make call to Logging service to request Clear Log
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        respHandler, "xyz.openbmc_project.Logging",
-        "/xyz/openbmc_project/logging",
-        "xyz.openbmc_project.Collection.DeleteAll", "DeleteAll");
+  // Make call to Logging service to request Clear Log
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_, respHandler, "xyz.openbmc_project.Logging",
+      "/xyz/openbmc_project/logging",
+      "xyz.openbmc_project.Collection.DeleteAll", "DeleteAll");
 }
 
 /**
  * DBusLogServiceActionsClear class supports POST method for ClearLog action.
  */
-void requestRoutesDBusLogServiceActionsClear(App& app)
-{
-    /**
-     * Function handles POST method request.
-     * The Clear Log actions does not require any parameter.The action deletes
-     * all entries found in the Entries collection for this Log Service.
-     */
+void requestRoutesDBusLogServiceActionsClear(App& app) {
+  /**
+   * Function handles POST method request.
+   * The Clear Log actions does not require any parameter.The action deletes
+   * all entries found in the Entries collection for this Log Service.
+   */
 
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/EventLog/Actions/LogService.ClearLog/")
-        .privileges(redfish::privileges::postLogService)
-        .methods(boost::beast::http::verb::post)(std::bind_front(
-            handlePostDBusLogServiceActionsClear, std::ref(app)));
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/EventLog/Actions/"
+               "LogService.ClearLog/")
+      .privileges(redfish::privileges::postLogService)
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handlePostDBusLogServiceActionsClear, std::ref(app)));
 }
 
 inline void handleGetPostCodesLogService(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/PostCodes";
-    asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_1_0.LogService";
-    asyncResp->res.jsonValue["Name"] = "POST Code Log Service";
-    asyncResp->res.jsonValue["Description"] = "POST Code Log Service";
-    asyncResp->res.jsonValue["Id"] = "PostCodes";
-    asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
-    asyncResp->res.jsonValue["Entries"]["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/PostCodes/Entries";
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/PostCodes";
+  asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_1_0.LogService";
+  asyncResp->res.jsonValue["Name"] = "POST Code Log Service";
+  asyncResp->res.jsonValue["Description"] = "POST Code Log Service";
+  asyncResp->res.jsonValue["Id"] = "PostCodes";
+  asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
+  asyncResp->res.jsonValue["Entries"]["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/PostCodes/Entries";
 
-    std::pair<std::string, std::string> redfishDateTimeOffset =
-        redfish::time_utils::getDateTimeOffsetNow();
-    asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
-    asyncResp->res.jsonValue["DateTimeLocalOffset"] =
-        redfishDateTimeOffset.second;
+  std::pair<std::string, std::string> redfishDateTimeOffset =
+      redfish::time_utils::getDateTimeOffsetNow();
+  asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
+  asyncResp->res.jsonValue["DateTimeLocalOffset"] =
+      redfishDateTimeOffset.second;
 
-    asyncResp->res.jsonValue["Actions"]["#LogService.ClearLog"] = {
-        {"target",
-         "/redfish/v1/Systems/system/LogServices/PostCodes/Actions/LogService.ClearLog"}};
+  asyncResp->res.jsonValue["Actions"]["#LogService.ClearLog"] = {
+      {"target",
+       "/redfish/v1/Systems/system/LogServices/PostCodes/Actions/"
+       "LogService.ClearLog"}};
 }
 
 /****************************************************
  * Redfish PostCode interfaces
  * using DBUS interface: getPostCodesTS
  ******************************************************/
-void requestRoutesPostCodesLogService(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/PostCodes/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetPostCodesLogService, std::ref(app)));
+void requestRoutesPostCodesLogService(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/PostCodes/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetPostCodesLogService, std::ref(app)));
 }
 
 inline void handlePostPostCodesClear(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    BMCWEB_LOG_DEBUG << "Do delete all postcodes entries.";
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  BMCWEB_LOG_DEBUG << "Do delete all postcodes entries.";
 
-    // Make call to post-code service to request clear all
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            // TODO Handle for specific error code
-            BMCWEB_LOG_ERROR << "doClearPostCodes resp_handler got error "
-                             << ec;
-            asyncResp->res.result(
-                boost::beast::http::status::internal_server_error);
-            messages::internalError(asyncResp->res);
-            return;
+  // Make call to post-code service to request clear all
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp](const boost::system::error_code& ec) {
+        if (ec) {
+          // TODO Handle for specific error code
+          BMCWEB_LOG_ERROR << "doClearPostCodes resp_handler got error " << ec;
+          asyncResp->res.result(
+              boost::beast::http::status::internal_server_error);
+          messages::internalError(asyncResp->res);
+          return;
         }
         messages::success(asyncResp->res);
-    }, "xyz.openbmc_project.State.Boot.PostCode0",
-        "/xyz/openbmc_project/State/Boot/PostCode0",
-        "xyz.openbmc_project.Collection.DeleteAll", "DeleteAll");
+      },
+      "xyz.openbmc_project.State.Boot.PostCode0",
+      "/xyz/openbmc_project/State/Boot/PostCode0",
+      "xyz.openbmc_project.Collection.DeleteAll", "DeleteAll");
 }
 
-void requestRoutesPostCodesClear(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/PostCodes/Actions/LogService.ClearLog/")
-        // The following privilege is incorrect;  It should be ConfigureManager
-        //.privileges(redfish::privileges::postLogService)
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handlePostPostCodesClear, std::ref(app)));
+void requestRoutesPostCodesClear(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/PostCodes/Actions/"
+               "LogService.ClearLog/")
+      // The following privilege is incorrect;  It should be ConfigureManager
+      // .privileges(redfish::privileges::postLogService)
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handlePostPostCodesClear, std::ref(app)));
 }
 
 /**
@@ -4015,33 +3524,30 @@
  * @return bool true if the parsing is successful, false the parsing fails
  */
 inline static bool parsePostCode(const std::string& postCodeID,
-                                 uint64_t& currentValue, uint16_t& index)
-{
-    std::vector<std::string> split;
-    bmcweb::split(split, postCodeID, '-');
-    if (split.size() != 2 || split[0].length() < 2 || split[0].front() != 'B')
-    {
-        return false;
-    }
+                                 uint64_t& currentValue, uint16_t& index) {
+  std::vector<std::string> split;
+  bmcweb::split(split, postCodeID, '-');
+  if (split.size() != 2 || split[0].length() < 2 || split[0].front() != 'B') {
+    return false;
+  }
 
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
-    const char* start = split[0].data() + 1;
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
-    const char* end = split[0].data() + split[0].size();
-    auto [ptrIndex, ecIndex] = std::from_chars(start, end, index);
+  // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
+  const char* start = split[0].data() + 1;
+  // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
+  const char* end = split[0].data() + split[0].size();
+  auto [ptrIndex, ecIndex] = std::from_chars(start, end, index);
 
-    if (ptrIndex != end || ecIndex != std::errc())
-    {
-        return false;
-    }
+  if (ptrIndex != end || ecIndex != std::errc()) {
+    return false;
+  }
 
-    start = split[1].data();
+  start = split[1].data();
 
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
-    end = split[1].data() + split[1].size();
-    auto [ptrValue, ecValue] = std::from_chars(start, end, currentValue);
+  // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
+  end = split[1].data() + split[1].size();
+  auto [ptrValue, ecValue] = std::from_chars(start, end, currentValue);
 
-    return ptrValue == end && ecValue == std::errc();
+  return ptrValue == end && ecValue == std::errc();
 }
 
 static bool fillPostCodeEntry(
@@ -4049,376 +3555,329 @@
     const boost::container::flat_map<
         uint64_t, std::tuple<uint64_t, std::vector<uint8_t>>>& postcode,
     const uint16_t bootIndex, const uint64_t codeIndex = 0,
-    const uint64_t skip = 0, const uint64_t top = 0)
-{
-    // Get the Message from the MessageRegistry
-    const registries::Message* message =
-        registries::getMessage("OpenBMC.0.2.BIOSPOSTCode");
+    const uint64_t skip = 0, const uint64_t top = 0) {
+  // Get the Message from the MessageRegistry
+  const registries::Message* message =
+      registries::getMessage("OpenBMC.0.2.BIOSPOSTCode");
 
-    uint64_t currentCodeIndex = 0;
-    uint64_t firstCodeTimeUs = 0;
-    for (const std::pair<uint64_t, std::tuple<uint64_t, std::vector<uint8_t>>>&
-             code : postcode)
-    {
-        currentCodeIndex++;
-        std::string postcodeEntryID =
-            "B" + std::to_string(bootIndex) + "-" +
-            std::to_string(currentCodeIndex); // 1 based index in EntryID string
+  uint64_t currentCodeIndex = 0;
+  uint64_t firstCodeTimeUs = 0;
+  for (const std::pair<uint64_t, std::tuple<uint64_t, std::vector<uint8_t>>>&
+           code : postcode) {
+    currentCodeIndex++;
+    std::string postcodeEntryID =
+        "B" + std::to_string(bootIndex) + "-" +
+        std::to_string(currentCodeIndex);  // 1 based index in EntryID string
 
-        uint64_t usecSinceEpoch = code.first;
-        uint64_t usTimeOffset = 0;
+    uint64_t usecSinceEpoch = code.first;
+    uint64_t usTimeOffset = 0;
 
-        if (1 == currentCodeIndex)
-        { // already incremented
-            firstCodeTimeUs = code.first;
-        }
-        else
-        {
-            usTimeOffset = code.first - firstCodeTimeUs;
-        }
-
-        // skip if no specific codeIndex is specified and currentCodeIndex does
-        // not fall between top and skip
-        if ((codeIndex == 0) &&
-            (currentCodeIndex <= skip || currentCodeIndex > top))
-        {
-            continue;
-        }
-
-        // skip if a specific codeIndex is specified and does not match the
-        // currentIndex
-        if ((codeIndex > 0) && (currentCodeIndex != codeIndex))
-        {
-            // This is done for simplicity. 1st entry is needed to calculate
-            // time offset. To improve efficiency, one can get to the entry
-            // directly (possibly with flatmap's nth method)
-            continue;
-        }
-
-        // currentCodeIndex is within top and skip or equal to specified code
-        // index
-
-        // Get the Created time from the timestamp
-        std::string entryTimeStr;
-        entryTimeStr = redfish::time_utils::getDateTimeUintUs(usecSinceEpoch);
-
-        // assemble messageArgs: BootIndex, TimeOffset(100us), PostCode(hex)
-        std::ostringstream hexCode;
-        hexCode << "0x" << std::setfill('0') << std::setw(2) << std::hex
-                << std::get<0>(code.second);
-        std::ostringstream timeOffsetStr;
-        // Set Fixed -Point Notation
-        timeOffsetStr << std::fixed;
-        // Set precision to 4 digits
-        timeOffsetStr << std::setprecision(4);
-        // Add double to stream
-        timeOffsetStr << static_cast<double>(usTimeOffset) / 1000 / 1000;
-        std::vector<std::string> messageArgs = {
-            std::to_string(bootIndex), timeOffsetStr.str(), hexCode.str()};
-
-        // Get MessageArgs template from message registry
-        std::string msg;
-        if (message != nullptr)
-        {
-            msg = message->message;
-
-            // fill in this post code value
-            int i = 0;
-            for (const std::string& messageArg : messageArgs)
-            {
-                std::string argStr = "%" + std::to_string(++i);
-                size_t argPos = msg.find(argStr);
-                if (argPos != std::string::npos)
-                {
-                    msg.replace(argPos, argStr.length(), messageArg);
-                }
-            }
-        }
-
-        // Get Severity template from message registry
-        std::string severity;
-        if (message != nullptr)
-        {
-            severity = message->messageSeverity;
-        }
-
-        // Format entry
-        nlohmann::json::object_t bmcLogEntry;
-        bmcLogEntry["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
-        bmcLogEntry["@odata.id"] = crow::utility::urlFromPieces(
-            "redfish", "v1", "Systems", "system", "LogServices", "PostCodes",
-            "Entries", postcodeEntryID);
-        bmcLogEntry["Name"] = "POST Code Log Entry";
-        bmcLogEntry["Id"] = postcodeEntryID;
-        bmcLogEntry["Message"] = std::move(msg);
-        bmcLogEntry["MessageId"] = "OpenBMC.0.2.BIOSPOSTCode";
-        bmcLogEntry["MessageArgs"] = std::move(messageArgs);
-        bmcLogEntry["EntryType"] = "Event";
-        bmcLogEntry["Severity"] = std::move(severity);
-        bmcLogEntry["Created"] = entryTimeStr;
-        if (!std::get<std::vector<uint8_t>>(code.second).empty())
-        {
-            bmcLogEntry["AdditionalDataURI"] =
-                "/redfish/v1/Systems/system/LogServices/PostCodes/Entries/" +
-                postcodeEntryID + "/attachment";
-        }
-
-        // codeIndex is only specified when querying single entry, return only
-        // that entry in this case
-        if (codeIndex != 0)
-        {
-            aResp->res.jsonValue.update(bmcLogEntry);
-            return true;
-        }
-
-        nlohmann::json& logEntryArray = aResp->res.jsonValue["Members"];
-        logEntryArray.push_back(std::move(bmcLogEntry));
+    if (1 == currentCodeIndex) {  // already incremented
+      firstCodeTimeUs = code.first;
+    } else {
+      usTimeOffset = code.first - firstCodeTimeUs;
     }
 
-    // Return value is always false when querying multiple entries
-    return false;
+    // skip if no specific codeIndex is specified and currentCodeIndex does
+    // not fall between top and skip
+    if ((codeIndex == 0) &&
+        (currentCodeIndex <= skip || currentCodeIndex > top)) {
+      continue;
+    }
+
+    // skip if a specific codeIndex is specified and does not match the
+    // currentIndex
+    if ((codeIndex > 0) && (currentCodeIndex != codeIndex)) {
+      // This is done for simplicity. 1st entry is needed to calculate
+      // time offset. To improve efficiency, one can get to the entry
+      // directly (possibly with flatmap's nth method)
+      continue;
+    }
+
+    // currentCodeIndex is within top and skip or equal to specified code
+    // index
+
+    // Get the Created time from the timestamp
+    std::string entryTimeStr;
+    entryTimeStr = redfish::time_utils::getDateTimeUintUs(usecSinceEpoch);
+
+    // assemble messageArgs: BootIndex, TimeOffset(100us), PostCode(hex)
+    std::ostringstream hexCode;
+    hexCode << "0x" << std::setfill('0') << std::setw(2) << std::hex
+            << std::get<0>(code.second);
+    std::ostringstream timeOffsetStr;
+    // Set Fixed -Point Notation
+    timeOffsetStr << std::fixed;
+    // Set precision to 4 digits
+    timeOffsetStr << std::setprecision(4);
+    // Add double to stream
+    timeOffsetStr << static_cast<double>(usTimeOffset) / 1000 / 1000;
+    std::vector<std::string> messageArgs = {std::to_string(bootIndex),
+                                            timeOffsetStr.str(), hexCode.str()};
+
+    // Get MessageArgs template from message registry
+    std::string msg;
+    if (message != nullptr) {
+      msg = message->message;
+
+      // fill in this post code value
+      int i = 0;
+      for (const std::string& messageArg : messageArgs) {
+        std::string argStr = "%" + std::to_string(++i);
+        size_t argPos = msg.find(argStr);
+        if (argPos != std::string::npos) {
+          msg.replace(argPos, argStr.length(), messageArg);
+        }
+      }
+    }
+
+    // Get Severity template from message registry
+    std::string severity;
+    if (message != nullptr) {
+      severity = message->messageSeverity;
+    }
+
+    // Format entry
+    nlohmann::json::object_t bmcLogEntry;
+    bmcLogEntry["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
+    bmcLogEntry["@odata.id"] = crow::utility::urlFromPieces(
+        "redfish", "v1", "Systems", "system", "LogServices", "PostCodes",
+        "Entries", postcodeEntryID);
+    bmcLogEntry["Name"] = "POST Code Log Entry";
+    bmcLogEntry["Id"] = postcodeEntryID;
+    bmcLogEntry["Message"] = std::move(msg);
+    bmcLogEntry["MessageId"] = "OpenBMC.0.2.BIOSPOSTCode";
+    bmcLogEntry["MessageArgs"] = std::move(messageArgs);
+    bmcLogEntry["EntryType"] = "Event";
+    bmcLogEntry["Severity"] = std::move(severity);
+    bmcLogEntry["Created"] = entryTimeStr;
+    if (!std::get<std::vector<uint8_t>>(code.second).empty()) {
+      bmcLogEntry["AdditionalDataURI"] =
+          "/redfish/v1/Systems/system/LogServices/PostCodes/Entries/" +
+          postcodeEntryID + "/attachment";
+    }
+
+    // codeIndex is only specified when querying single entry, return only
+    // that entry in this case
+    if (codeIndex != 0) {
+      aResp->res.jsonValue.update(bmcLogEntry);
+      return true;
+    }
+
+    nlohmann::json& logEntryArray = aResp->res.jsonValue["Members"];
+    logEntryArray.push_back(std::move(bmcLogEntry));
+  }
+
+  // Return value is always false when querying multiple entries
+  return false;
 }
 
 static void getPostCodeForEntry(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                                const std::string& entryId)
-{
-    uint16_t bootIndex = 0;
-    uint64_t codeIndex = 0;
-    if (!parsePostCode(entryId, codeIndex, bootIndex))
-    {
-        // Requested ID was not found
-        messages::resourceNotFound(aResp->res, "LogEntry", entryId);
-        return;
-    }
+                                const std::string& entryId) {
+  uint16_t bootIndex = 0;
+  uint64_t codeIndex = 0;
+  if (!parsePostCode(entryId, codeIndex, bootIndex)) {
+    // Requested ID was not found
+    messages::resourceNotFound(aResp->res, "LogEntry", entryId);
+    return;
+  }
 
-    if (bootIndex == 0 || codeIndex == 0)
-    {
-        // 0 is an invalid index
-        messages::resourceNotFound(aResp->res, "LogEntry", entryId);
-        return;
-    }
+  if (bootIndex == 0 || codeIndex == 0) {
+    // 0 is an invalid index
+    messages::resourceNotFound(aResp->res, "LogEntry", entryId);
+    return;
+  }
 
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        aResp->strand_,
-        [aResp, entryId, bootIndex,
-         codeIndex](const boost::system::error_code& ec,
-                    const boost::container::flat_map<
-                        uint64_t, std::tuple<uint64_t, std::vector<uint8_t>>>&
-                        postcode) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS POST CODE PostCode response error";
-            messages::internalError(aResp->res);
-            return;
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      aResp->strand_,
+      [aResp, entryId, bootIndex, codeIndex](
+          const boost::system::error_code& ec,
+          const boost::container::flat_map<
+              uint64_t, std::tuple<uint64_t, std::vector<uint8_t>>>& postcode) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS POST CODE PostCode response error";
+          messages::internalError(aResp->res);
+          return;
         }
 
-        if (postcode.empty())
-        {
-            messages::resourceNotFound(aResp->res, "LogEntry", entryId);
-            return;
+        if (postcode.empty()) {
+          messages::resourceNotFound(aResp->res, "LogEntry", entryId);
+          return;
         }
 
-        if (!fillPostCodeEntry(aResp, postcode, bootIndex, codeIndex))
-        {
-            messages::resourceNotFound(aResp->res, "LogEntry", entryId);
-            return;
+        if (!fillPostCodeEntry(aResp, postcode, bootIndex, codeIndex)) {
+          messages::resourceNotFound(aResp->res, "LogEntry", entryId);
+          return;
         }
-    },
-        "xyz.openbmc_project.State.Boot.PostCode0",
-        "/xyz/openbmc_project/State/Boot/PostCode0",
-        "xyz.openbmc_project.State.Boot.PostCode", "GetPostCodesWithTimeStamp",
-        bootIndex);
+      },
+      "xyz.openbmc_project.State.Boot.PostCode0",
+      "/xyz/openbmc_project/State/Boot/PostCode0",
+      "xyz.openbmc_project.State.Boot.PostCode", "GetPostCodesWithTimeStamp",
+      bootIndex);
 }
 
 static void getPostCodeForBoot(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
                                const uint16_t bootIndex,
                                const uint16_t bootCount,
                                const uint64_t entryCount, size_t skip,
-                               size_t top)
-{
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        aResp->strand_,
-        [aResp, bootIndex, bootCount, entryCount, skip,
-         top](const boost::system::error_code& ec,
-              const boost::container::flat_map<
-                  uint64_t, std::tuple<uint64_t, std::vector<uint8_t>>>&
-                  postcode) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS POST CODE PostCode response error";
-            messages::internalError(aResp->res);
-            return;
+                               size_t top) {
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      aResp->strand_,
+      [aResp, bootIndex, bootCount, entryCount, skip, top](
+          const boost::system::error_code& ec,
+          const boost::container::flat_map<
+              uint64_t, std::tuple<uint64_t, std::vector<uint8_t>>>& postcode) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS POST CODE PostCode response error";
+          messages::internalError(aResp->res);
+          return;
         }
 
         uint64_t endCount = entryCount;
-        if (!postcode.empty())
-        {
-            endCount = entryCount + postcode.size();
-            if (skip < endCount && (top + skip) > entryCount)
-            {
-                uint64_t thisBootSkip =
-                    std::max(static_cast<uint64_t>(skip), entryCount) -
-                    entryCount;
-                uint64_t thisBootTop =
-                    std::min(static_cast<uint64_t>(top + skip), endCount) -
-                    entryCount;
+        if (!postcode.empty()) {
+          endCount = entryCount + postcode.size();
+          if (skip < endCount && (top + skip) > entryCount) {
+            uint64_t thisBootSkip =
+                std::max(static_cast<uint64_t>(skip), entryCount) - entryCount;
+            uint64_t thisBootTop =
+                std::min(static_cast<uint64_t>(top + skip), endCount) -
+                entryCount;
 
-                fillPostCodeEntry(aResp, postcode, bootIndex, 0, thisBootSkip,
-                                  thisBootTop);
-            }
-            aResp->res.jsonValue["Members@odata.count"] = endCount;
+            fillPostCodeEntry(aResp, postcode, bootIndex, 0, thisBootSkip,
+                              thisBootTop);
+          }
+          aResp->res.jsonValue["Members@odata.count"] = endCount;
         }
 
         // continue to previous bootIndex
-        if (bootIndex < bootCount)
-        {
-            getPostCodeForBoot(aResp, static_cast<uint16_t>(bootIndex + 1),
-                               bootCount, endCount, skip, top);
+        if (bootIndex < bootCount) {
+          getPostCodeForBoot(aResp, static_cast<uint16_t>(bootIndex + 1),
+                             bootCount, endCount, skip, top);
+        } else if (skip + top < endCount) {
+          aResp->res.jsonValue["Members@odata.nextLink"] =
+              "/redfish/v1/Systems/system/LogServices/PostCodes/"
+              "Entries?$skip=" +
+              std::to_string(skip + top);
         }
-        else if (skip + top < endCount)
-        {
-            aResp->res.jsonValue["Members@odata.nextLink"] =
-                "/redfish/v1/Systems/system/LogServices/PostCodes/Entries?$skip=" +
-                std::to_string(skip + top);
-        }
-    },
-        "xyz.openbmc_project.State.Boot.PostCode0",
-        "/xyz/openbmc_project/State/Boot/PostCode0",
-        "xyz.openbmc_project.State.Boot.PostCode", "GetPostCodesWithTimeStamp",
-        bootIndex);
+      },
+      "xyz.openbmc_project.State.Boot.PostCode0",
+      "/xyz/openbmc_project/State/Boot/PostCode0",
+      "xyz.openbmc_project.State.Boot.PostCode", "GetPostCodesWithTimeStamp",
+      bootIndex);
 }
 
-static void
-    getCurrentBootNumber(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                         size_t skip, size_t top)
-{
-    uint64_t entryCount = 0;
-    managedStore::ManagedObjectStoreContext requestContext(aResp);
-    dbus_utils::getProperty<uint16_t>(
-        "xyz.openbmc_project.State.Boot.PostCode0",
-        "/xyz/openbmc_project/State/Boot/PostCode0",
-        "xyz.openbmc_project.State.Boot.PostCode", "CurrentBootCycleCount",
-        requestContext,
-        [aResp, entryCount, skip, top](const boost::system::error_code& ec,
-                                       const uint16_t bootCount) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
-            messages::internalError(aResp->res);
-            return;
+static void getCurrentBootNumber(
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp, size_t skip, size_t top) {
+  uint64_t entryCount = 0;
+  managedStore::ManagedObjectStoreContext requestContext(aResp);
+  dbus_utils::getProperty<uint16_t>(
+      "xyz.openbmc_project.State.Boot.PostCode0",
+      "/xyz/openbmc_project/State/Boot/PostCode0",
+      "xyz.openbmc_project.State.Boot.PostCode", "CurrentBootCycleCount",
+      requestContext,
+      [aResp, entryCount, skip, top](const boost::system::error_code& ec,
+                                     const uint16_t bootCount) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+          messages::internalError(aResp->res);
+          return;
         }
         getPostCodeForBoot(aResp, 1, bootCount, entryCount, skip, top);
-    });
+      });
 }
 
 inline void handleGetPostCodesEntryCollection(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    query_param::QueryCapabilities capabilities = {
-        .canDelegateTop = true,
-        .canDelegateSkip = true,
-    };
-    query_param::Query delegatedQuery;
-    if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
-                                                  delegatedQuery, capabilities))
-    {
-        return;
-    }
+    const std::string& systemName) {
+  query_param::QueryCapabilities capabilities = {
+      .canDelegateTop = true,
+      .canDelegateSkip = true,
+  };
+  query_param::Query delegatedQuery;
+  if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
+                                                delegatedQuery, capabilities)) {
+    return;
+  }
 
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    asyncResp->res.jsonValue["@odata.type"] =
-        "#LogEntryCollection.LogEntryCollection";
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/PostCodes/Entries";
-    asyncResp->res.jsonValue["Name"] = "BIOS POST Code Log Entries";
-    asyncResp->res.jsonValue["Description"] =
-        "Collection of POST Code Log Entries";
-    asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
-    asyncResp->res.jsonValue["Members@odata.count"] = 0;
-    size_t skip = delegatedQuery.skip.value_or(0);
-    size_t top = delegatedQuery.top.value_or(query_param::Query::maxTop);
-    getCurrentBootNumber(asyncResp, skip, top);
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  asyncResp->res.jsonValue["@odata.type"] =
+      "#LogEntryCollection.LogEntryCollection";
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/PostCodes/Entries";
+  asyncResp->res.jsonValue["Name"] = "BIOS POST Code Log Entries";
+  asyncResp->res.jsonValue["Description"] =
+      "Collection of POST Code Log Entries";
+  asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
+  asyncResp->res.jsonValue["Members@odata.count"] = 0;
+  size_t skip = delegatedQuery.skip.value_or(0);
+  size_t top = delegatedQuery.top.value_or(query_param::Query::maxTop);
+  getCurrentBootNumber(asyncResp, skip, top);
 }
 
-void requestRoutesPostCodesEntryCollection(App& app)
-{
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Systems/<str>/LogServices/PostCodes/Entries/")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetPostCodesEntryCollection, std::ref(app)));
+void requestRoutesPostCodesEntryCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/PostCodes/Entries/")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetPostCodesEntryCollection, std::ref(app)));
 }
 
 inline void handleGetPostCodesEntryAdditionalData(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName, const std::string& postCodeID)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (http_helpers::isContentTypeAllowed(
-            req.getHeaderValue("Accept"),
-            http_helpers::ContentType::OctetStream, true))
-    {
-        asyncResp->res.result(boost::beast::http::status::bad_request);
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+    const std::string& systemName, const std::string& postCodeID) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (http_helpers::isContentTypeAllowed(req.getHeaderValue("Accept"),
+                                         http_helpers::ContentType::OctetStream,
+                                         true)) {
+    asyncResp->res.result(boost::beast::http::status::bad_request);
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    uint64_t currentValue = 0;
-    uint16_t index = 0;
-    if (!parsePostCode(postCodeID, currentValue, index))
-    {
-        messages::resourceNotFound(asyncResp->res, "LogEntry", postCodeID);
-        return;
-    }
+  uint64_t currentValue = 0;
+  uint16_t index = 0;
+  if (!parsePostCode(postCodeID, currentValue, index)) {
+    messages::resourceNotFound(asyncResp->res, "LogEntry", postCodeID);
+    return;
+  }
 
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp, postCodeID, currentValue](
-            const boost::system::error_code& ec,
-            const std::vector<std::tuple<uint64_t, std::vector<uint8_t>>>&
-                postcodes) {
-        if (ec.value() == EBADR)
-        {
-            messages::resourceNotFound(asyncResp->res, "LogEntry", postCodeID);
-            return;
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp, postCodeID, currentValue](
+          const boost::system::error_code& ec,
+          const std::vector<std::tuple<uint64_t, std::vector<uint8_t>>>&
+              postcodes) {
+        if (ec.value() == EBADR) {
+          messages::resourceNotFound(asyncResp->res, "LogEntry", postCodeID);
+          return;
         }
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
-            messages::internalError(asyncResp->res);
-            return;
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         size_t value = static_cast<size_t>(currentValue) - 1;
-        if (value == std::string::npos || postcodes.size() < currentValue)
-        {
-            BMCWEB_LOG_WARNING << "Wrong currentValue value";
-            messages::resourceNotFound(asyncResp->res, "LogEntry", postCodeID);
-            return;
+        if (value == std::string::npos || postcodes.size() < currentValue) {
+          BMCWEB_LOG_WARNING << "Wrong currentValue value";
+          messages::resourceNotFound(asyncResp->res, "LogEntry", postCodeID);
+          return;
         }
 
         const auto& [tID, c] = postcodes[value];
-        if (c.empty())
-        {
-            BMCWEB_LOG_WARNING << "No found post code data";
-            messages::resourceNotFound(asyncResp->res, "LogEntry", postCodeID);
-            return;
+        if (c.empty()) {
+          BMCWEB_LOG_WARNING << "No found post code data";
+          messages::resourceNotFound(asyncResp->res, "LogEntry", postCodeID);
+          return;
         }
         // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
         const char* d = reinterpret_cast<const char*>(c.data());
@@ -4429,149 +3888,129 @@
         asyncResp->res.addHeader(
             boost::beast::http::field::content_transfer_encoding, "Base64");
         asyncResp->res.body() = crow::utility::base64encode(strData);
-    },
-        "xyz.openbmc_project.State.Boot.PostCode0",
-        "/xyz/openbmc_project/State/Boot/PostCode0",
-        "xyz.openbmc_project.State.Boot.PostCode", "GetPostCodes", index);
+      },
+      "xyz.openbmc_project.State.Boot.PostCode0",
+      "/xyz/openbmc_project/State/Boot/PostCode0",
+      "xyz.openbmc_project.State.Boot.PostCode", "GetPostCodes", index);
 }
 
-void requestRoutesPostCodesEntryAdditionalData(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/PostCodes/Entries/<str>/attachment/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleGetPostCodesEntryAdditionalData, std::ref(app)));
+void requestRoutesPostCodesEntryAdditionalData(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/PostCodes/Entries/<str>/"
+               "attachment/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleGetPostCodesEntryAdditionalData, std::ref(app)));
 }
 
-inline void
-    handleGetPostCodesEntry(App& app, const crow::Request& req,
-                            const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                            const std::string& systemName,
-                            const std::string& targetID)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+inline void handleGetPostCodesEntry(
+    App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& systemName, const std::string& targetID) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    getPostCodeForEntry(asyncResp, targetID);
+  getPostCodeForEntry(asyncResp, targetID);
 }
 
-void requestRoutesPostCodesEntry(App& app)
-{
-    BMCWEB_ROUTE(
-        app, "/redfish/v1/Systems/<str>/LogServices/PostCodes/Entries/<str>/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetPostCodesEntry, std::ref(app)));
+void requestRoutesPostCodesEntry(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/PostCodes/Entries/<str>/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetPostCodesEntry, std::ref(app)));
 }
 
 static void handleBootTimeLogServiceGet(
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_1_0.LogService";
-    asyncResp->res.jsonValue["Name"] = "Boot Time Log Service";
-    asyncResp->res.jsonValue["Description"] = "Boot Time Log Service";
-    asyncResp->res.jsonValue["Id"] = "BootTime";
-    asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
-    asyncResp->res.jsonValue["LogEntryType"] = "Multiple";
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_1_0.LogService";
+  asyncResp->res.jsonValue["Name"] = "Boot Time Log Service";
+  asyncResp->res.jsonValue["Description"] = "Boot Time Log Service";
+  asyncResp->res.jsonValue["Id"] = "BootTime";
+  asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
+  asyncResp->res.jsonValue["LogEntryType"] = "Multiple";
 
-    std::pair<std::string, std::string> redfishDateTimeOffset =
-        redfish::time_utils::getDateTimeOffsetNow();
-    asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
-    asyncResp->res.jsonValue["DateTimeLocalOffset"] =
-        redfishDateTimeOffset.second;
+  std::pair<std::string, std::string> redfishDateTimeOffset =
+      redfish::time_utils::getDateTimeOffsetNow();
+  asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
+  asyncResp->res.jsonValue["DateTimeLocalOffset"] =
+      redfishDateTimeOffset.second;
 }
 
 void handleSystemBootTimeLogServiceGet(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    // Only for single host
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/" + systemName + "/LogServices/BootTime";
-    asyncResp->res.jsonValue["Entries"]["@odata.id"] =
-        "/redfish/v1/Systems/" + systemName + "/LogServices/BootTime/Entries";
-    handleBootTimeLogServiceGet(asyncResp);
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  // Only for single host
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/" + systemName + "/LogServices/BootTime";
+  asyncResp->res.jsonValue["Entries"]["@odata.id"] =
+      "/redfish/v1/Systems/" + systemName + "/LogServices/BootTime/Entries";
+  handleBootTimeLogServiceGet(asyncResp);
 }
 
 void handleManagerBootTimeLogServiceGet(
     App& app, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Managers/bmc/LogServices/BootTime";
-    asyncResp->res.jsonValue["Entries"]["@odata.id"] =
-        "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries";
-    handleBootTimeLogServiceGet(asyncResp);
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Managers/bmc/LogServices/BootTime";
+  asyncResp->res.jsonValue["Entries"]["@odata.id"] =
+      "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries";
+  handleBootTimeLogServiceGet(asyncResp);
 }
 
-void requestRoutesBootTimeLogService(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/BootTime/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleSystemBootTimeLogServiceGet, std::ref(app)));
+void requestRoutesBootTimeLogService(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/BootTime/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleSystemBootTimeLogServiceGet, std::ref(app)));
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/BootTime/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleManagerBootTimeLogServiceGet, std::ref(app)));
+  BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/BootTime/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleManagerBootTimeLogServiceGet, std::ref(app)));
 }
 
-inline static std::string
-    generateBootTimeLogId(BootTimeDataType diagnosticsDataType,
-                          const size_t index)
-{
-    return bootTimeDataTypeToString(diagnosticsDataType) +
-           std::to_string(index);
+inline static std::string generateBootTimeLogId(
+    BootTimeDataType diagnosticsDataType, const size_t index) {
+  return bootTimeDataTypeToString(diagnosticsDataType) + std::to_string(index);
 }
 
-static std::shared_ptr<nlohmann::json::object_t>
-    makeBootTimeLogEntry(BootTimeDataType diagnosticsDataType,
-                         const nlohmann::json::object_t& diagnosticDataJson,
-                         const size_t index, const std::string& parentODataId)
-{
-    nlohmann::json::object_t logEntry;
-    const std::string id = generateBootTimeLogId(diagnosticsDataType, index);
-    // required properties start
-    logEntry["@odata.id"] = parentODataId + "/" + id;
-    logEntry["@odata.type"] = "#LogEntry.v1_15_0.LogEntry";
-    logEntry["Name"] = "Boot Time Log Entry";
-    logEntry["Id"] = id;
-    logEntry["EntryType"] = "Oem";
-    // required properties end
-    logEntry["OEMDiagnosticDataType"] =
-        bootTimeDataTypeToString(diagnosticsDataType);
-    std::string jsonStr = nlohmann::json(diagnosticDataJson).dump();
-    logEntry["Message"] = jsonStr;
-    const std::string base64DiagnosticData =
-        crow::utility::base64encode(jsonStr);
-    logEntry["DiagnosticData"] = base64DiagnosticData;
-    return std::make_shared<nlohmann::json::object_t>(logEntry);
+static std::shared_ptr<nlohmann::json::object_t> makeBootTimeLogEntry(
+    BootTimeDataType diagnosticsDataType,
+    const nlohmann::json::object_t& diagnosticDataJson, const size_t index,
+    const std::string& parentODataId) {
+  nlohmann::json::object_t logEntry;
+  const std::string id = generateBootTimeLogId(diagnosticsDataType, index);
+  // required properties start
+  logEntry["@odata.id"] = parentODataId + "/" + id;
+  logEntry["@odata.type"] = "#LogEntry.v1_15_0.LogEntry";
+  logEntry["Name"] = "Boot Time Log Entry";
+  logEntry["Id"] = id;
+  logEntry["EntryType"] = "Oem";
+  // required properties end
+  logEntry["OEMDiagnosticDataType"] =
+      bootTimeDataTypeToString(diagnosticsDataType);
+  std::string jsonStr = nlohmann::json(diagnosticDataJson).dump();
+  logEntry["Message"] = jsonStr;
+  const std::string base64DiagnosticData = crow::utility::base64encode(jsonStr);
+  logEntry["DiagnosticData"] = base64DiagnosticData;
+  return std::make_shared<nlohmann::json::object_t>(logEntry);
 }
 
 static void getBootTimeCheckpointLogEntries(
@@ -4579,73 +4018,62 @@
     const std::shared_ptr<const std::string>& parentODataId,
     const std::shared_ptr<size_t>& specificIndex,
     const std::function<void(const nlohmann::json& logEntryArray)>&
-        successCallback)
-{
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        aResp->strand_,
-        [aResp, parentODataId, specificIndex,
-         successCb{successCallback}](
-            const boost::system::error_code& ec,
-            const std::vector<BootTimeCheckpoint>& checkpoints) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS Boot Time checkpoints response error";
-            messages::internalError(aResp->res);
-            return;
+        successCallback) {
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      aResp->strand_,
+      [aResp, parentODataId, specificIndex, successCb{successCallback}](
+          const boost::system::error_code& ec,
+          const std::vector<BootTimeCheckpoint>& checkpoints) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS Boot Time checkpoints response error";
+          messages::internalError(aResp->res);
+          return;
         }
         std::span<const BootTimeCheckpoint> filteredCheckpoints;
-        if (specificIndex != nullptr)
-        {
-            const size_t index = *specificIndex;
-            if (index >= checkpoints.size())
-            {
-                messages::resourceNotFound(
-                    aResp->res, "LogEntry",
-                    generateBootTimeLogId(BootTimeDataType::CHECKPOINT, index));
-                return;
-            }
-            filteredCheckpoints = std::span<const BootTimeCheckpoint>(
-                std::next(checkpoints.begin(), static_cast<int>(index)),
-                std::next(checkpoints.begin(), static_cast<int>(index + 1)));
-        }
-        else
-        {
-            filteredCheckpoints =
-                std::span<const BootTimeCheckpoint>(checkpoints);
+        if (specificIndex != nullptr) {
+          const size_t index = *specificIndex;
+          if (index >= checkpoints.size()) {
+            messages::resourceNotFound(
+                aResp->res, "LogEntry",
+                generateBootTimeLogId(BootTimeDataType::CHECKPOINT, index));
+            return;
+          }
+          filteredCheckpoints = std::span<const BootTimeCheckpoint>(
+              std::next(checkpoints.begin(), static_cast<int>(index)),
+              std::next(checkpoints.begin(), static_cast<int>(index + 1)));
+        } else {
+          filteredCheckpoints =
+              std::span<const BootTimeCheckpoint>(checkpoints);
         }
         nlohmann::json logEntryArray = nlohmann::json::array();
         size_t currentIndex = specificIndex == nullptr ? 0 : *specificIndex;
-        for (const BootTimeCheckpoint& checkpoint : filteredCheckpoints)
-        {
-            const auto [name, wallTime, monoTime] = checkpoint;
-            nlohmann::json::object_t diagnosticDataJson;
-            diagnosticDataJson["Name"] = name;
-            diagnosticDataJson["WallTimeMs"] = wallTime;
-            diagnosticDataJson["MonoTimeMs"] = monoTime;
-            try
-            {
-                std::shared_ptr<nlohmann::json::object_t> logEntry =
-                    makeBootTimeLogEntry(BootTimeDataType::CHECKPOINT,
-                                         diagnosticDataJson, currentIndex,
-                                         *parentODataId);
-                logEntryArray.push_back(std::move(*logEntry));
-            }
-            catch (...)
-            {
-                // May face error while parsing data to json or to base64
-                BMCWEB_LOG_DEBUG
-                    << "Error while making Boot time log entry for Checkpoint"
-                    << std::to_string(currentIndex);
-                messages::internalError(aResp->res);
-                return;
-            }
-            currentIndex++;
+        for (const BootTimeCheckpoint& checkpoint : filteredCheckpoints) {
+          const auto [name, wallTime, monoTime] = checkpoint;
+          nlohmann::json::object_t diagnosticDataJson;
+          diagnosticDataJson["Name"] = name;
+          diagnosticDataJson["WallTimeMs"] = wallTime;
+          diagnosticDataJson["MonoTimeMs"] = monoTime;
+          try {
+            std::shared_ptr<nlohmann::json::object_t> logEntry =
+                makeBootTimeLogEntry(BootTimeDataType::CHECKPOINT,
+                                     diagnosticDataJson, currentIndex,
+                                     *parentODataId);
+            logEntryArray.push_back(std::move(*logEntry));
+          } catch (...) {
+            // May face error while parsing data to json or to base64
+            BMCWEB_LOG_DEBUG
+                << "Error while making Boot time log entry for Checkpoint"
+                << std::to_string(currentIndex);
+            messages::internalError(aResp->res);
+            return;
+          }
+          currentIndex++;
         }
         successCb(logEntryArray);
-    },
-        "com.google.gbmc.boot_time_monitor",
-        "/xyz/openbmc_project/time/boot/" + host,
-        "xyz.openbmc_project.Time.Boot.Checkpoint", "GetCheckpointList");
+      },
+      "com.google.gbmc.boot_time_monitor",
+      "/xyz/openbmc_project/time/boot/" + host,
+      "xyz.openbmc_project.Time.Boot.Checkpoint", "GetCheckpointList");
 }
 
 static void getBootTimeDurationLogEntries(
@@ -4653,386 +4081,333 @@
     const std::shared_ptr<const std::string>& parentODataId,
     const std::shared_ptr<size_t>& specificIndex,
     const std::function<void(const nlohmann::json& logEntryArray)>&
-        successCallback)
-{
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        aResp->strand_,
-        [aResp, parentODataId, specificIndex,
-         successCb{successCallback}](
-            const boost::system::error_code& ec,
-            const std::vector<BootTimeDuration>& durations) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS Boot Time durations response error";
-            messages::internalError(aResp->res);
-            return;
+        successCallback) {
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      aResp->strand_,
+      [aResp, parentODataId, specificIndex, successCb{successCallback}](
+          const boost::system::error_code& ec,
+          const std::vector<BootTimeDuration>& durations) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS Boot Time durations response error";
+          messages::internalError(aResp->res);
+          return;
         }
         std::span<const BootTimeDuration> filteredDurations;
-        if (specificIndex != nullptr)
-        {
-            const size_t index = *specificIndex;
-            if (index >= durations.size())
-            {
-                messages::resourceNotFound(
-                    aResp->res, "LogEntry",
-                    generateBootTimeLogId(BootTimeDataType::DURATION, index));
-                return;
-            }
-            filteredDurations = std::span<const BootTimeDuration>(
-                std::next(durations.begin(), static_cast<int>(index)),
-                std::next(durations.begin(), static_cast<int>(index + 1)));
-        }
-        else
-        {
-            filteredDurations = std::span<const BootTimeDuration>(durations);
+        if (specificIndex != nullptr) {
+          const size_t index = *specificIndex;
+          if (index >= durations.size()) {
+            messages::resourceNotFound(
+                aResp->res, "LogEntry",
+                generateBootTimeLogId(BootTimeDataType::DURATION, index));
+            return;
+          }
+          filteredDurations = std::span<const BootTimeDuration>(
+              std::next(durations.begin(), static_cast<int>(index)),
+              std::next(durations.begin(), static_cast<int>(index + 1)));
+        } else {
+          filteredDurations = std::span<const BootTimeDuration>(durations);
         }
         nlohmann::json logEntryArray = nlohmann::json::array();
         size_t currentIndex = specificIndex == nullptr ? 0 : *specificIndex;
-        for (const BootTimeDuration& duration : filteredDurations)
-        {
-            nlohmann::json::object_t diagnosticDataJson;
-            const auto [name, durationMs] = duration;
-            diagnosticDataJson["Name"] = name;
-            diagnosticDataJson["DurationMs"] = durationMs;
-            try
-            {
-                std::shared_ptr<nlohmann::json::object_t> logEntry =
-                    makeBootTimeLogEntry(BootTimeDataType::DURATION,
-                                         diagnosticDataJson, currentIndex,
-                                         *parentODataId);
-                logEntryArray.push_back(std::move(*logEntry));
-            }
-            catch (...)
-            {
-                // May face error while parsing data to json or to base64
-                BMCWEB_LOG_DEBUG
-                    << "Error while making Boot time log entry for Duration"
-                    << std::to_string(currentIndex);
-                messages::internalError(aResp->res);
-                return;
-            }
-            currentIndex++;
+        for (const BootTimeDuration& duration : filteredDurations) {
+          nlohmann::json::object_t diagnosticDataJson;
+          const auto [name, durationMs] = duration;
+          diagnosticDataJson["Name"] = name;
+          diagnosticDataJson["DurationMs"] = durationMs;
+          try {
+            std::shared_ptr<nlohmann::json::object_t> logEntry =
+                makeBootTimeLogEntry(BootTimeDataType::DURATION,
+                                     diagnosticDataJson, currentIndex,
+                                     *parentODataId);
+            logEntryArray.push_back(std::move(*logEntry));
+          } catch (...) {
+            // May face error while parsing data to json or to base64
+            BMCWEB_LOG_DEBUG
+                << "Error while making Boot time log entry for Duration"
+                << std::to_string(currentIndex);
+            messages::internalError(aResp->res);
+            return;
+          }
+          currentIndex++;
         }
         successCb(logEntryArray);
-    },
-        "com.google.gbmc.boot_time_monitor",
-        "/xyz/openbmc_project/time/boot/" + host,
-        "xyz.openbmc_project.Time.Boot.Duration", "GetAdditionalDurations");
+      },
+      "com.google.gbmc.boot_time_monitor",
+      "/xyz/openbmc_project/time/boot/" + host,
+      "xyz.openbmc_project.Time.Boot.Duration", "GetAdditionalDurations");
 }
 
 static void getBootTimeStatisticLogEntry(
     const std::shared_ptr<bmcweb::AsyncResp>& aResp, const std::string& host,
     const std::shared_ptr<const std::string>& parentODataId,
     const std::function<void(const nlohmann::json& logEntryArray)>&
-        successCallback)
-{
-    managedStore::ManagedObjectStoreContext requestContext(aResp);
-    dbus_utils::getProperty<bool>(
-        "com.google.gbmc.boot_time_monitor",
-        "/xyz/openbmc_project/time/boot/" + host,
-        "xyz.openbmc_project.Time.Boot.Statistic", "IsRebooting",
-        requestContext,
-        [aResp, parentODataId, successCb{successCallback}](
-            const boost::system::error_code& ec, const bool rebooting) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS Boot Time rebooting response error" << ec;
-            messages::internalError(aResp->res);
-            return;
+        successCallback) {
+  managedStore::ManagedObjectStoreContext requestContext(aResp);
+  dbus_utils::getProperty<bool>(
+      "com.google.gbmc.boot_time_monitor",
+      "/xyz/openbmc_project/time/boot/" + host,
+      "xyz.openbmc_project.Time.Boot.Statistic", "IsRebooting", requestContext,
+      [aResp, parentODataId, successCb{successCallback}](
+          const boost::system::error_code& ec, const bool rebooting) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS Boot Time rebooting response error" << ec;
+          messages::internalError(aResp->res);
+          return;
         }
         nlohmann::json logEntryArray = nlohmann::json::array();
         nlohmann::json::object_t diagnosticDataJson;
         diagnosticDataJson["IsRebooting"] = rebooting;
-        try
-        {
-            std::shared_ptr<nlohmann::json::object_t> logEntry =
-                makeBootTimeLogEntry(BootTimeDataType::STATISTIC,
-                                     diagnosticDataJson, 0, *parentODataId);
-            logEntryArray.push_back(std::move(*logEntry));
-        }
-        catch (...)
-        {
-            // May face error while parsing data to json or to base64
-            BMCWEB_LOG_DEBUG
-                << "Error while making Boot time log entry for Statistic0";
-            messages::internalError(aResp->res);
-            return;
+        try {
+          std::shared_ptr<nlohmann::json::object_t> logEntry =
+              makeBootTimeLogEntry(BootTimeDataType::STATISTIC,
+                                   diagnosticDataJson, 0, *parentODataId);
+          logEntryArray.push_back(std::move(*logEntry));
+        } catch (...) {
+          // May face error while parsing data to json or to base64
+          BMCWEB_LOG_DEBUG
+              << "Error while making Boot time log entry for Statistic0";
+          messages::internalError(aResp->res);
+          return;
         }
         successCb(logEntryArray);
-    });
+      });
 }
 
 inline void addBootLogEntriesToRespAndCount(
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const nlohmann::json& logEntryArray)
-{
-    for (auto entry : logEntryArray)
-    {
-        asyncResp->res.jsonValue["Members"].push_back(std::move(entry));
-    }
-    asyncResp->res.jsonValue["Members@odata.count"] =
-        asyncResp->res.jsonValue["Members"].size();
+    const nlohmann::json& logEntryArray) {
+  for (auto entry : logEntryArray) {
+    asyncResp->res.jsonValue["Members"].push_back(std::move(entry));
+  }
+  asyncResp->res.jsonValue["Members@odata.count"] =
+      asyncResp->res.jsonValue["Members"].size();
 }
 
 inline void handleBootTimeLogsEntryCollectionGet(
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& host)
-{
-    asyncResp->res.jsonValue["@odata.type"] =
-        "#LogEntryCollection.LogEntryCollection";
-    asyncResp->res.jsonValue["Name"] = "Boot Time Log Entries";
-    asyncResp->res.jsonValue["Description"] =
-        "Collection of Boot time Log Entries with checkpoints and duration";
+    const std::string& host) {
+  asyncResp->res.jsonValue["@odata.type"] =
+      "#LogEntryCollection.LogEntryCollection";
+  asyncResp->res.jsonValue["Name"] = "Boot Time Log Entries";
+  asyncResp->res.jsonValue["Description"] =
+      "Collection of Boot time Log Entries with checkpoints and duration";
 
-    std::shared_ptr<const std::string> parentId =
-        std::make_shared<const std::string>(
-            asyncResp->res.jsonValue["@odata.id"]);
-    asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
-    getBootTimeCheckpointLogEntries(
-        asyncResp, host, parentId, nullptr,
-        std::bind_front(addBootLogEntriesToRespAndCount, asyncResp));
-    getBootTimeDurationLogEntries(
-        asyncResp, host, parentId, nullptr,
-        std::bind_front(addBootLogEntriesToRespAndCount, asyncResp));
-    getBootTimeStatisticLogEntry(
-        asyncResp, host, parentId,
-        std::bind_front(addBootLogEntriesToRespAndCount, asyncResp));
+  std::shared_ptr<const std::string> parentId =
+      std::make_shared<const std::string>(
+          asyncResp->res.jsonValue["@odata.id"]);
+  asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
+  getBootTimeCheckpointLogEntries(
+      asyncResp, host, parentId, nullptr,
+      std::bind_front(addBootLogEntriesToRespAndCount, asyncResp));
+  getBootTimeDurationLogEntries(
+      asyncResp, host, parentId, nullptr,
+      std::bind_front(addBootLogEntriesToRespAndCount, asyncResp));
+  getBootTimeStatisticLogEntry(
+      asyncResp, host, parentId,
+      std::bind_front(addBootLogEntriesToRespAndCount, asyncResp));
 }
 
 void handleSystemBootTimeLogsEntryCollectionGet(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    // only for single host
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+  // only for single host
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/" + systemName + "/LogServices/BootTime/Entries";
-    handleBootTimeLogsEntryCollectionGet(asyncResp, "host0");
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/" + systemName + "/LogServices/BootTime/Entries";
+  handleBootTimeLogsEntryCollectionGet(asyncResp, "host0");
 }
 
 void handleManagerBootTimeLogsEntryCollectionGet(
     App& app, const crow::Request& req,
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries";
-    handleBootTimeLogsEntryCollectionGet(asyncResp, "bmc");
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries";
+  handleBootTimeLogsEntryCollectionGet(asyncResp, "bmc");
 }
 
-void requestRoutesBootTimeLogEntryCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/BootTime/Entries/")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleSystemBootTimeLogsEntryCollectionGet, std::ref(app)));
+void requestRoutesBootTimeLogEntryCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/BootTime/Entries/")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleSystemBootTimeLogsEntryCollectionGet, std::ref(app)));
 
-    BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleManagerBootTimeLogsEntryCollectionGet, std::ref(app)));
+  BMCWEB_ROUTE(app, "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleManagerBootTimeLogsEntryCollectionGet, std::ref(app)));
 }
 
 static bool parseBootTimeLogEntryId(const std::string& entryId,
-                                    BootTimeDataType& dataType, size_t& index)
-{
-    size_t typeIndex = 0;
-    for (const std::string_view type : bootTimeDataTypeString)
-    {
-        if (entryId.starts_with(type.data()))
-        {
-            // NOLINTBEGIN(cppcoreguidelines-pro-bounds-pointer-arithmetic)
-            auto [_, ec] =
-                std::from_chars(entryId.c_str() + type.length(),
-                                entryId.c_str() + entryId.length(), index);
-            // NOLINTEND(cppcoreguidelines-pro-bounds-pointer-arithmetic)
-            // calling std::errc without any argument means successful parse
-            if (ec != std::errc())
-            {
-                return false;
-            }
-            dataType = static_cast<BootTimeDataType>(typeIndex);
-            return (dataType != BootTimeDataType::STATISTIC || index == 0);
-        }
-        typeIndex++;
+                                    BootTimeDataType& dataType, size_t& index) {
+  size_t typeIndex = 0;
+  for (const std::string_view type : bootTimeDataTypeString) {
+    if (entryId.starts_with(type.data())) {
+      // NOLINTBEGIN(cppcoreguidelines-pro-bounds-pointer-arithmetic)
+      auto [_, ec] = std::from_chars(entryId.c_str() + type.length(),
+                                     entryId.c_str() + entryId.length(), index);
+      // NOLINTEND(cppcoreguidelines-pro-bounds-pointer-arithmetic)
+      // calling std::errc without any argument means successful parse
+      if (ec != std::errc()) {
+        return false;
+      }
+      dataType = static_cast<BootTimeDataType>(typeIndex);
+      return (dataType != BootTimeDataType::STATISTIC || index == 0);
     }
-    return false;
+    typeIndex++;
+  }
+  return false;
 }
 
-inline void
-    mergeBootLogEntryToResp(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                            const std::shared_ptr<const std::string>& entryId,
-                            const nlohmann::json& logEntryArray)
-{
-    if (asyncResp->res.jsonValue.contains("error"))
-    {
-        return;
-    }
-    if (logEntryArray.empty())
-    {
-        messages::resourceNotFound(asyncResp->res, "LogEntry", *entryId);
-        return;
-    }
-    asyncResp->res.jsonValue.merge_patch(logEntryArray[0]);
+inline void mergeBootLogEntryToResp(
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::shared_ptr<const std::string>& entryId,
+    const nlohmann::json& logEntryArray) {
+  if (asyncResp->res.jsonValue.contains("error")) {
+    return;
+  }
+  if (logEntryArray.empty()) {
+    messages::resourceNotFound(asyncResp->res, "LogEntry", *entryId);
+    return;
+  }
+  asyncResp->res.jsonValue.merge_patch(logEntryArray[0]);
 }
 
 inline void handleBootTimeLogsEntryGet(
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
     const std::string& host, const std::string& entryId,
-    const std::string& parentODataId)
-{
-    BootTimeDataType dataType = BootTimeDataType::CHECKPOINT;
-    size_t index = 0;
-    if (!parseBootTimeLogEntryId(entryId, dataType, index))
-    {
-        messages::resourceNotFound(asyncResp->res, "LogEntry", entryId);
-        return;
-    }
-    std::shared_ptr<const std::string> parentId =
-        std::make_shared<const std::string>(parentODataId);
-    std::shared_ptr<const std::string> entryIdPtr =
-        std::make_shared<const std::string>(entryId);
-    std::shared_ptr<size_t> indexPt = std::make_shared<size_t>(index);
-    if (dataType == BootTimeDataType::CHECKPOINT)
-    {
-        getBootTimeCheckpointLogEntries(
-            asyncResp, host, parentId, indexPt,
-            std::bind_front(mergeBootLogEntryToResp, asyncResp, entryIdPtr));
-    }
-    else if (dataType == BootTimeDataType::DURATION)
-    {
-        getBootTimeDurationLogEntries(
-            asyncResp, host, parentId, indexPt,
-            std::bind_front(mergeBootLogEntryToResp, asyncResp, entryIdPtr));
-    }
-    else
-    {
-        getBootTimeStatisticLogEntry(
-            asyncResp, host, parentId,
-            std::bind_front(mergeBootLogEntryToResp, asyncResp, entryIdPtr));
-    }
+    const std::string& parentODataId) {
+  BootTimeDataType dataType = BootTimeDataType::CHECKPOINT;
+  size_t index = 0;
+  if (!parseBootTimeLogEntryId(entryId, dataType, index)) {
+    messages::resourceNotFound(asyncResp->res, "LogEntry", entryId);
+    return;
+  }
+  std::shared_ptr<const std::string> parentId =
+      std::make_shared<const std::string>(parentODataId);
+  std::shared_ptr<const std::string> entryIdPtr =
+      std::make_shared<const std::string>(entryId);
+  std::shared_ptr<size_t> indexPt = std::make_shared<size_t>(index);
+  if (dataType == BootTimeDataType::CHECKPOINT) {
+    getBootTimeCheckpointLogEntries(
+        asyncResp, host, parentId, indexPt,
+        std::bind_front(mergeBootLogEntryToResp, asyncResp, entryIdPtr));
+  } else if (dataType == BootTimeDataType::DURATION) {
+    getBootTimeDurationLogEntries(
+        asyncResp, host, parentId, indexPt,
+        std::bind_front(mergeBootLogEntryToResp, asyncResp, entryIdPtr));
+  } else {
+    getBootTimeStatisticLogEntry(
+        asyncResp, host, parentId,
+        std::bind_front(mergeBootLogEntryToResp, asyncResp, entryIdPtr));
+  }
 }
 
 void handleSystemBootTimeLogsEntryGet(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName, const std::string& entryId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+    const std::string& systemName, const std::string& entryId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    // only for single host
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    handleBootTimeLogsEntryGet(asyncResp, "host0", entryId,
-                               "/redfish/v1/Systems/" + systemName +
-                                   "/LogServices/BootTime/Entries");
+  // only for single host
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  handleBootTimeLogsEntryGet(
+      asyncResp, "host0", entryId,
+      "/redfish/v1/Systems/" + systemName + "/LogServices/BootTime/Entries");
 }
 void handleManagerBootTimeLogsEntryGet(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& entryId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+    const std::string& entryId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    handleBootTimeLogsEntryGet(
-        asyncResp, "bmc", entryId,
-        "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries");
+  handleBootTimeLogsEntryGet(
+      asyncResp, "bmc", entryId,
+      "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries");
 }
 
-void requestRoutesBootTimeLogEntry(App& app)
-{
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Systems/<str>/LogServices/BootTime/Entries/<str>")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleSystemBootTimeLogsEntryGet, std::ref(app)));
+void requestRoutesBootTimeLogEntry(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/BootTime/Entries/<str>")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleSystemBootTimeLogsEntryGet, std::ref(app)));
 
-    BMCWEB_ROUTE(app,
-                 "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/<str>")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleManagerBootTimeLogsEntryGet, std::ref(app)));
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/<str>")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleManagerBootTimeLogsEntryGet, std::ref(app)));
 }
 
 void handlePPRServiceGet(App& app, const crow::Request& req,
-                         const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    // Copy over the static data to include the entries added by SubRoute
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair";
-    asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_2_0.LogService";
-    asyncResp->res.jsonValue["Name"] = "Open BMC Oem PPR Service";
-    asyncResp->res.jsonValue["Description"] = "Oem Post Package Repair Service";
-    asyncResp->res.jsonValue["Id"] = "Oem ppr";
-    asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
-    asyncResp->res.jsonValue["Members"] = {
-        {{"@odata.id",
-          "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
-          "Config"}},
-        {{"@odata.id",
-          "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
-          "Status"}},
-    };
-    asyncResp->res.jsonValue["Members@odata.count"] =
-        asyncResp->res.jsonValue["Members"].size();
-    asyncResp->res.jsonValue["Actions"] = {
-        {"#PostPackageRepair.SetRepairConfig",
-         {{"target",
-           "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
-           "Actions/PostPackageRepair.SetRepairConfig"}}},
-        {"#PostPackageRepair.SetRepairData",
-         {{"target",
-           "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
-           "Actions/PostPackageRepair.SetRepairData"}}}};
+                         const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  // Copy over the static data to include the entries added by SubRoute
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair";
+  asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_2_0.LogService";
+  asyncResp->res.jsonValue["Name"] = "Open BMC Oem PPR Service";
+  asyncResp->res.jsonValue["Description"] = "Oem Post Package Repair Service";
+  asyncResp->res.jsonValue["Id"] = "Oem ppr";
+  asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
+  asyncResp->res.jsonValue["Members"] = {
+      {{"@odata.id",
+        "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
+        "Config"}},
+      {{"@odata.id",
+        "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
+        "Status"}},
+  };
+  asyncResp->res.jsonValue["Members@odata.count"] =
+      asyncResp->res.jsonValue["Members"].size();
+  asyncResp->res.jsonValue["Actions"] = {
+      {"#PostPackageRepair.SetRepairConfig",
+       {{"target",
+         "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
+         "Actions/PostPackageRepair.SetRepairConfig"}}},
+      {"#PostPackageRepair.SetRepairData",
+       {{"target",
+         "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
+         "Actions/PostPackageRepair.SetRepairData"}}}};
 }
 
 void getPostPackageRepairStatus(
-    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        requestContext.GetStrand(),
-        [asyncResp](
-            const boost::system::error_code& ec,
-            const std::vector<std::tuple<uint16_t, uint16_t, uint16_t, uint16_t,
-                                         std::vector<uint16_t>>>&
-                postpackagerepairstatus) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR
-                << "DBUS response error in getPostPackageRepairStatus"
-                << ec.message();
-            messages::internalError(asyncResp->res);
-            return;
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      requestContext.GetStrand(),
+      [asyncResp](
+          const boost::system::error_code& ec,
+          const std::vector<std::tuple<uint16_t, uint16_t, uint16_t, uint16_t,
+                                       std::vector<uint16_t>>>&
+              postpackagerepairstatus) {
+        if (ec) {
+          BMCWEB_LOG_ERROR
+              << "DBUS response error in getPostPackageRepairStatus"
+              << ec.message();
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         BMCWEB_LOG_DEBUG << "D-Bus getPostPackageRepairStatus success size : "
@@ -5040,67 +4415,62 @@
 
         nlohmann::json pprDataOut = nlohmann::json::array();
         int count = 0;
-        for (const auto& resolveList : postpackagerepairstatus)
-        {
-            BMCWEB_LOG_INFO << "Testing : " << std::get<0>(resolveList);
-            uint16_t repairEntryNum = std::get<0>(resolveList);
-            uint16_t repairType = std::get<1>(resolveList);
-            uint16_t socNum = std::get<2>(resolveList);
-            uint16_t repairResult = std::get<3>(resolveList);
-            std::vector<uint16_t> payload = std::get<4>(resolveList);
+        for (const auto& resolveList : postpackagerepairstatus) {
+          BMCWEB_LOG_INFO << "Testing : " << std::get<0>(resolveList);
+          uint16_t repairEntryNum = std::get<0>(resolveList);
+          uint16_t repairType = std::get<1>(resolveList);
+          uint16_t socNum = std::get<2>(resolveList);
+          uint16_t repairResult = std::get<3>(resolveList);
+          std::vector<uint16_t> payload = std::get<4>(resolveList);
 
-            nlohmann::json jsonPpr = {{"repairEntryNum", repairEntryNum},
-                                      {"repairType", repairType},
-                                      {"socNum", socNum},
-                                      {"repairResult", repairResult},
-                                      {"payload", payload}};
-            pprDataOut.push_back(jsonPpr);
-            count++;
+          nlohmann::json jsonPpr = {{"repairEntryNum", repairEntryNum},
+                                    {"repairType", repairType},
+                                    {"socNum", socNum},
+                                    {"repairResult", repairResult},
+                                    {"payload", payload}};
+          pprDataOut.push_back(jsonPpr);
+          count++;
         }
 
         asyncResp->res.jsonValue["Members"] = pprDataOut;
         asyncResp->res.jsonValue["Members@odata.count"] = count;
-    },
-        pprFileObject, pprFilePath, pprFileInterface,
-        "getPostPackageRepairStatus");
+      },
+      pprFileObject, pprFilePath, pprFileInterface,
+      "getPostPackageRepairStatus");
 }
 
 void handlePPRStatusGet(App& app, const crow::Request& req,
-                        const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    asyncResp->res.jsonValue["@odata.type"] = "#LogEntry.v1_4_0.LogEntry";
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
-        "Status";
-    asyncResp->res.jsonValue["Name"] = "Post Package Repair Entries";
-    asyncResp->res.jsonValue["Description"] =
-        "Collection of Post Package Repair Entries";
-    asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
-    asyncResp->res.jsonValue["Members@odata.count"] = 0;
+                        const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  asyncResp->res.jsonValue["@odata.type"] = "#LogEntry.v1_4_0.LogEntry";
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
+      "Status";
+  asyncResp->res.jsonValue["Name"] = "Post Package Repair Entries";
+  asyncResp->res.jsonValue["Description"] =
+      "Collection of Post Package Repair Entries";
+  asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
+  asyncResp->res.jsonValue["Members@odata.count"] = 0;
 
-    getPostPackageRepairStatus(asyncResp);
+  getPostPackageRepairStatus(asyncResp);
 }
 
 void setPostPackageRepairData(
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, const uint16_t Index,
     const uint16_t repairEntryNum, const uint16_t repairType,
-    const uint16_t socNum, std::vector<uint16_t>& payload)
-{
-    std::optional<bool> RecordAdd = true;
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        requestContext.GetStrand(),
-        [asyncResp, RecordAdd, Index, requestContext](
-            const boost::system::error_code& ec, const bool& recordAdd) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "DBUS POST Package Repair Record Add error";
-            messages::internalError(asyncResp->res);
-            return;
+    const uint16_t socNum, std::vector<uint16_t>& payload) {
+  std::optional<bool> RecordAdd = true;
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      requestContext.GetStrand(),
+      [asyncResp, RecordAdd, Index, requestContext](
+          const boost::system::error_code& ec, const bool& recordAdd) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "DBUS POST Package Repair Record Add error";
+          messages::internalError(asyncResp->res);
+          return;
         }
         BMCWEB_LOG_DEBUG << "DBUS POST Package Repair Record Added : "
                          << int(recordAdd);
@@ -5110,142 +4480,128 @@
             *RecordAdd,
             [asyncResp, Index,
              requestContext](const boost::system::error_code& ec) {
-            if (ec)
-            {
+              if (ec) {
                 BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec;
                 messages::internalError(asyncResp->res);
                 return;
-            }
-            BMCWEB_LOG_INFO << "D-Bus Record Add success";
+              }
+              BMCWEB_LOG_INFO << "D-Bus Record Add success";
 
-            managedStore::GetManagedObjectStore()
-                ->PostDbusCallToIoContextThreadSafe(
-                    requestContext.GetStrand(),
-                    [asyncResp](const boost::system::error_code& ec,
-                                const uint32_t& startRuntimeRepair) {
-                if (ec)
-                {
-                    BMCWEB_LOG_ERROR << "DBUS start Runtime Repair error";
-                    messages::internalError(asyncResp->res);
-                    return;
-                }
-                BMCWEB_LOG_INFO << "DBUS success start Runtime Repair : "
-                                << startRuntimeRepair;
-            },
-                    pprFileObject, pprFilePath, pprFileInterface,
-                    "startRuntimeRepair", Index);
-        });
-    },
-        pprFileObject, pprFilePath, pprFileInterface,
-        "setPostPackageRepairData", repairEntryNum, repairType, socNum,
-        payload);
+              managedStore::GetManagedObjectStore()
+                  ->PostDbusCallToIoContextThreadSafe(
+                      requestContext.GetStrand(),
+                      [asyncResp](const boost::system::error_code& ec,
+                                  const uint32_t& startRuntimeRepair) {
+                        if (ec) {
+                          BMCWEB_LOG_ERROR << "DBUS start Runtime Repair error";
+                          messages::internalError(asyncResp->res);
+                          return;
+                        }
+                        BMCWEB_LOG_INFO
+                            << "DBUS success start Runtime Repair : "
+                            << startRuntimeRepair;
+                      },
+                      pprFileObject, pprFilePath, pprFileInterface,
+                      "startRuntimeRepair", Index);
+            });
+      },
+      pprFileObject, pprFilePath, pprFileInterface, "setPostPackageRepairData",
+      repairEntryNum, repairType, socNum, payload);
 }
 
-static bool& getOobPprEnable()
-{
-    static bool oobPprEnable = false;
-    return oobPprEnable;
+static bool& getOobPprEnable() {
+  static bool oobPprEnable = false;
+  return oobPprEnable;
 }
 
 void handlePPRFilePost(App& app, const crow::Request& req,
-                       const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    uint16_t RepairType = 0;
-    uint16_t RepairEntryNum = 0;
-    uint16_t SocNum = 0;
-    uint16_t Index = 0;
-    uint16_t RuntimeIndex = 0;
-    nlohmann::json jsonRequest;
-    bool& oobPprEnable = getOobPprEnable();
+                       const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  uint16_t RepairType = 0;
+  uint16_t RepairEntryNum = 0;
+  uint16_t SocNum = 0;
+  uint16_t Index = 0;
+  uint16_t RuntimeIndex = 0;
+  nlohmann::json jsonRequest;
+  bool& oobPprEnable = getOobPprEnable();
 
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
 
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    dbus_utils::getProperty<bool>(
-        pprFileObject, pprFilePath, pprFileInterface, "oobPprEnable",
-        requestContext,
-        [asyncResp, &oobPprEnable](const boost::system::error_code& ec,
-                                   const bool oobPpr) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "D-Bus responses error for OOB PPR Enable: "
-                             << ec;
-            messages::internalError(asyncResp->res);
-            return;
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  dbus_utils::getProperty<bool>(
+      pprFileObject, pprFilePath, pprFileInterface, "oobPprEnable",
+      requestContext,
+      [asyncResp, &oobPprEnable](const boost::system::error_code& ec,
+                                 const bool oobPpr) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "D-Bus responses error for OOB PPR Enable: "
+                           << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
         oobPprEnable = oobPpr;
-    });
+      });
 
-    if (!oobPprEnable)
-    {
-        BMCWEB_LOG_ERROR << "Error: OOB PPR is Not Enabled";
-        messages::internalError(asyncResp->res);
+  if (!oobPprEnable) {
+    BMCWEB_LOG_ERROR << "Error: OOB PPR is Not Enabled";
+    messages::internalError(asyncResp->res);
+    return;
+  }
+
+  if (!json_util::processJsonFromRequest(asyncResp->res, req, jsonRequest)) {
+    BMCWEB_LOG_ERROR << "Error: Json value not readable";
+    messages::malformedJSON(asyncResp->res);
+    return;
+  }
+
+  for (const auto& el : jsonRequest["pprDataIn"].items()) {
+    std::vector<uint16_t> Payload;
+
+    BMCWEB_LOG_DEBUG << "Key " << el.key();
+    BMCWEB_LOG_DEBUG << "value " << el.value();
+
+    if (!json_util::readJson(el.value(), asyncResp->res, "RepairType",
+                             RepairType, "RepairEntryNum", RepairEntryNum,
+                             "SocNum", SocNum, "Payload", Payload)) {
+      BMCWEB_LOG_ERROR << "Error: Issue with Json value read";
+      messages::malformedJSON(asyncResp->res);
+      return;
+    }
+
+    if ((RepairType & kPPRTypeBoottimeMask) == 0) {
+      RuntimeIndex++;
+      if (RuntimeIndex > kMaxRuntimePPRCount) {
+        BMCWEB_LOG_ERROR << "Error: Exceed Runtime PPR Max Entry of "
+                         << kMaxRuntimePPRCount;
+        messages::invalidObject(asyncResp->res,
+                                "Runtime PPR entries exceed PPR Max Entry of " +
+                                    std::to_string(kMaxRuntimePPRCount));
         return;
+      }
     }
 
-    if (!json_util::processJsonFromRequest(asyncResp->res, req, jsonRequest))
-    {
-        BMCWEB_LOG_ERROR << "Error: Json value not readable";
-        messages::malformedJSON(asyncResp->res);
-        return;
-    }
+    setPostPackageRepairData(asyncResp, Index, RepairEntryNum, RepairType,
+                             SocNum, Payload);
+    Index++;
+  }
 
-    for (const auto& el : jsonRequest["pprDataIn"].items())
-    {
-        std::vector<uint16_t> Payload;
-
-        BMCWEB_LOG_DEBUG << "Key " << el.key();
-        BMCWEB_LOG_DEBUG << "value " << el.value();
-
-        if (!json_util::readJson(el.value(), asyncResp->res, "RepairType",
-                                 RepairType, "RepairEntryNum", RepairEntryNum,
-                                 "SocNum", SocNum, "Payload", Payload))
-        {
-            BMCWEB_LOG_ERROR << "Error: Issue with Json value read";
-            messages::malformedJSON(asyncResp->res);
-            return;
-        }
-
-        if ((RepairType & kPPRTypeBoottimeMask) == 0)
-        {
-            RuntimeIndex++;
-            if (RuntimeIndex > kMaxRuntimePPRCount)
-            {
-                BMCWEB_LOG_ERROR << "Error: Exceed Runtime PPR Max Entry of "
-                                 << kMaxRuntimePPRCount;
-                messages::invalidObject(
-                    asyncResp->res,
-                    "Runtime PPR entries exceed PPR Max Entry of " +
-                        std::to_string(kMaxRuntimePPRCount));
-                return;
-            }
-        }
-
-        setPostPackageRepairData(asyncResp, Index, RepairEntryNum, RepairType,
-                                 SocNum, Payload);
-        Index++;
-    }
-
-    messages::success(asyncResp->res);
+  messages::success(asyncResp->res);
 }
 
-void getPostPackageRepairConfig(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
-{
-    managedStore::ManagedObjectStoreContext requestContext(aResp);
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        requestContext.GetStrand(),
-        [aResp](const boost::system::error_code& ec,
-                const std::vector<uint16_t>& postpackagerepairconfig) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR
-                << "DBUS response error in getPostPackageRepairConfig"
-                << ec.message();
-            messages::internalError(aResp->res);
-            return;
+void getPostPackageRepairConfig(
+    const std::shared_ptr<bmcweb::AsyncResp>& aResp) {
+  managedStore::ManagedObjectStoreContext requestContext(aResp);
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      requestContext.GetStrand(),
+      [aResp](const boost::system::error_code& ec,
+              const std::vector<uint16_t>& postpackagerepairconfig) {
+        if (ec) {
+          BMCWEB_LOG_ERROR
+              << "DBUS response error in getPostPackageRepairConfig"
+              << ec.message();
+          messages::internalError(aResp->res);
+          return;
         }
 
         nlohmann::json pprConfig = nlohmann::json::array();
@@ -5265,143 +4621,125 @@
 
         aResp->res.jsonValue["Members"] = pprConfig;
         aResp->res.jsonValue["Members@odata.count"] = 1;
-    },
-        pprFileObject, pprFilePath, pprFileInterface,
-        "getPostPackageRepairConfig");
+      },
+      pprFileObject, pprFilePath, pprFileInterface,
+      "getPostPackageRepairConfig");
 }
 
 void setPostPackageRepairConfig(
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, const uint16_t& flag,
-    const bool& data)
-{
-
-    managedStore::ManagedObjectStoreContext requestContext(asyncResp);
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        requestContext.GetStrand(),
-        [asyncResp](const boost::system::error_code& ec, const bool& result) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR
-                << "DBUS response error in setPostPackageRepairConfig"
-                << ec.message();
-            messages::internalError(asyncResp->res);
-            return;
+    const bool& data) {
+  managedStore::ManagedObjectStoreContext requestContext(asyncResp);
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      requestContext.GetStrand(),
+      [asyncResp](const boost::system::error_code& ec, const bool& result) {
+        if (ec) {
+          BMCWEB_LOG_ERROR
+              << "DBUS response error in setPostPackageRepairConfig"
+              << ec.message();
+          messages::internalError(asyncResp->res);
+          return;
         }
         BMCWEB_LOG_DEBUG << "DBUS POST Package Repair Config Changed : "
                          << int(result);
-    }, pprFileObject, pprFilePath, pprFileInterface,
-        "setPostPackageRepairConfig", flag, data);
+      },
+      pprFileObject, pprFilePath, pprFileInterface,
+      "setPostPackageRepairConfig", flag, data);
 }
 
 void handlePPRConfigGet(App& app, const crow::Request& req,
-                        const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    asyncResp->res.jsonValue["@odata.type"] = "#LogEntry.v1_4_0.LogEntry";
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
-        "Config";
-    asyncResp->res.jsonValue["Name"] = "Post Package Repair Config";
-    asyncResp->res.jsonValue["Description"] =
-        "Post Package Repair Configuration";
-    asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
-    asyncResp->res.jsonValue["Members@odata.count"] = 0;
+                        const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  asyncResp->res.jsonValue["@odata.type"] = "#LogEntry.v1_4_0.LogEntry";
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/"
+      "Config";
+  asyncResp->res.jsonValue["Name"] = "Post Package Repair Config";
+  asyncResp->res.jsonValue["Description"] = "Post Package Repair Configuration";
+  asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
+  asyncResp->res.jsonValue["Members@odata.count"] = 0;
 
-    getPostPackageRepairConfig(asyncResp);
+  getPostPackageRepairConfig(asyncResp);
 }
 
 void handlePPRConfigPost(App& app, const crow::Request& req,
-                         const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    std::optional<bool> BtSetToHard;
-    std::optional<bool> RtToBt;
-    uint16_t flag = 0;
-    bool data = false;
-    nlohmann::json jsonRequest;
+                         const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  std::optional<bool> BtSetToHard;
+  std::optional<bool> RtToBt;
+  uint16_t flag = 0;
+  bool data = false;
+  nlohmann::json jsonRequest;
 
-    if (!json_util::processJsonFromRequest(asyncResp->res, req, jsonRequest))
-    {
-        BMCWEB_LOG_ERROR << "Error: Json value not readable";
-        messages::malformedJSON(asyncResp->res);
-        return;
-    }
+  if (!json_util::processJsonFromRequest(asyncResp->res, req, jsonRequest)) {
+    BMCWEB_LOG_ERROR << "Error: Json value not readable";
+    messages::malformedJSON(asyncResp->res);
+    return;
+  }
 
-    if (!json_util::readJson(jsonRequest, asyncResp->res,
-                             "autoScheduleBtAsHard", BtSetToHard,
-                             "autoScheduleRtAsBtPpr", RtToBt))
-    {
-        return;
-    }
-    if (BtSetToHard)
-    {
-        flag = kBtSetToHardMask;
-        data = BtSetToHard.value();
-    }
-    if (RtToBt)
-    {
-        flag = kRtToBtMask;
-        data = RtToBt.value();
-    }
-    if (flag == 0)
-    {
-        std::cout << "PPR Config Error: post command, Param not found\n";
-        return;
-    }
-    setPostPackageRepairConfig(asyncResp, flag, data);
-    messages::success(asyncResp->res);
+  if (!json_util::readJson(jsonRequest, asyncResp->res, "autoScheduleBtAsHard",
+                           BtSetToHard, "autoScheduleRtAsBtPpr", RtToBt)) {
+    return;
+  }
+  if (BtSetToHard) {
+    flag = kBtSetToHardMask;
+    data = BtSetToHard.value();
+  }
+  if (RtToBt) {
+    flag = kRtToBtMask;
+    data = RtToBt.value();
+  }
+  if (flag == 0) {
+    std::cout << "PPR Config Error: post command, Param not found\n";
+    return;
+  }
+  setPostPackageRepairConfig(asyncResp, flag, data);
+  messages::success(asyncResp->res);
 }
 
-void requestRoutesPPRService(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/")
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handlePPRServiceGet, std::ref(app)));
+void requestRoutesPPRService(App& app) {
+  BMCWEB_ROUTE(
+      app, "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/")
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handlePPRServiceGet, std::ref(app)));
 }
 
-void requestRoutesPPRStatus(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/Status")
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handlePPRStatusGet, std::ref(app)));
+void requestRoutesPPRStatus(App& app) {
+  BMCWEB_ROUTE(
+      app,
+      "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/Status")
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handlePPRStatusGet, std::ref(app)));
 }
 
-void requestRoutesPPRFile(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/Actions/PostPackageRepair.SetRepairData")
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handlePPRFilePost, std::ref(app)));
+void requestRoutesPPRFile(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/system/LogServices/Oem/Amd/"
+               "PostPackageRepair/Actions/PostPackageRepair.SetRepairData")
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handlePPRFilePost, std::ref(app)));
 }
 
-void requestRoutesPPRConfig(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/Config")
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handlePPRConfigGet, std::ref(app)));
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/Actions/PostPackageRepair.SetRepairConfig")
-        .privileges({{"ConfigureManager"}})
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handlePPRConfigPost, std::ref(app)));
+void requestRoutesPPRConfig(App& app) {
+  BMCWEB_ROUTE(
+      app,
+      "/redfish/v1/Systems/system/LogServices/Oem/Amd/PostPackageRepair/Config")
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handlePPRConfigGet, std::ref(app)));
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/system/LogServices/Oem/Amd/"
+               "PostPackageRepair/Actions/PostPackageRepair.SetRepairConfig")
+      .privileges({{"ConfigureManager"}})
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handlePPRConfigPost, std::ref(app)));
 }
 
-} // namespace redfish
+}  // namespace redfish
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 2b10530..1f534a8 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -1,3 +1,6 @@
+#ifndef THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_LOG_SERVICES_H_
+#define THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_LOG_SERVICES_H_
+
 /*
 // Copyright (c) 2018 Intel Corporation
 //
@@ -13,50 +16,54 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 */
-#pragma once
+
+#include <array>
+#include <cstddef>
+#include <cstdint>
+#include <filesystem>  // NOLINT
+#include <memory>
+#include <optional>
+#include <string>
+#include <string_view>
+#include <tuple>
+#include <unordered_map>
+#include <vector>
 
 #include "app.hpp"
+#include "app_singleton.hpp"
+#include "http_request.hpp"
+#include "async_resp.hpp"
 #include "query.hpp"
+#include <nlohmann/json.hpp>
 
-#include <cstdint>
-
-namespace redfish
-{
+namespace redfish {
 
 using BootTimeCheckpoint = std::tuple<std::string, int64_t, int64_t>;
 using BootTimeDuration = std::tuple<std::string, int64_t>;
 
-enum class DumpType : std::uint8_t
-{
-    BMC_DUMP = 0,
-    SYSTEM_DUMP,
-    BMC_FAULT_LOG,
-    SYSTEM_FAULT_LOG,
+enum class DumpType : std::uint8_t {
+  BMC_DUMP = 0,
+  SYSTEM_DUMP,
+  BMC_FAULT_LOG,
+  SYSTEM_FAULT_LOG,
 };
 
-enum class LogParseError : std::uint8_t
-{
-    success,
-    parseFailed,
-    messageIdNotInRegistry,
+enum class LogParseError : std::uint8_t {
+  success,
+  parseFailed,
+  messageIdNotInRegistry,
 };
 
 // The index of the string is the integer value of the DumpType enum
 constexpr std::array<std::string_view, 4> dumpTypeStrings{
     {"BMC", "System", "FaultLog", "FaultLog"}};
 
-struct Dump
-{
-    DumpType type = DumpType::BMC_DUMP;
-    std::optional<std::string> systemName = std::nullopt;
+struct Dump {
+  DumpType type = DumpType::BMC_DUMP;
+  std::optional<std::string> systemName = std::nullopt;
 };
 
-enum class BootTimeDataType : std::uint8_t
-{
-    CHECKPOINT,
-    DURATION,
-    STATISTIC
-};
+enum class BootTimeDataType : std::uint8_t { CHECKPOINT, DURATION, STATISTIC };
 
 constexpr std::array<std::string_view, 3> bootTimeDataTypeString{
     {"Checkpoint", "Duration", "Statistic"}};
@@ -65,25 +72,22 @@
 
 inline std::string bootTimeDataTypeToString(BootTimeDataType dataType);
 
-namespace internal
-{
+namespace internal {
 void getDumpServiceInfo(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                         const Dump& dump);
-} // namespace internal
+}  // namespace internal
 
 void getDumpEntryCollection(App& app, const crow::Request& req,
                             const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
                             const Dump& dump,
                             const query_param::Query& delegatedQuery);
 
-inline void
-    getDumpEntryCollection(const crow::Request& req,
-                           const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                           const Dump& dump,
-                           const query_param::Query& delegatedQuery)
-{
-    getDumpEntryCollection(*crow::globalBmcWebApp, req, asyncResp, dump,
-                           delegatedQuery);
+inline void getDumpEntryCollection(
+    const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, const Dump& dump,
+    const query_param::Query& delegatedQuery) {
+  getDumpEntryCollection(*crow::globalBmcWebApp, req, asyncResp, dump,
+                         delegatedQuery);
 }
 
 void queryFaultCollection(
@@ -100,10 +104,9 @@
     const std::string& collectionUri,
     std::unordered_map<std::string, nlohmann::json::json_pointer>&
         faultLogEntries,
-    nlohmann::json& originalMembers)
-{
-    queryFaultCollection(*crow::globalBmcWebApp, origReq, asyncResp,
-                         collectionUri, faultLogEntries, originalMembers);
+    nlohmann::json& originalMembers) {
+  queryFaultCollection(*crow::globalBmcWebApp, origReq, asyncResp,
+                       collectionUri, faultLogEntries, originalMembers);
 }
 
 inline bool getHostLoggerEntries(
@@ -226,4 +229,6 @@
                         const std::shared_ptr<bmcweb::AsyncResp>& asyncResp);
 void handlePPRConfigPost(App& app, const crow::Request& req,
                          const std::shared_ptr<bmcweb::AsyncResp>& asyncResp);
-} // namespace redfish
+}  // namespace redfish
+
+#endif  // THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_LOG_SERVICES_H_
diff --git a/redfish-core/lib/log_services_eventlog.cpp b/redfish-core/lib/log_services_eventlog.cpp
index 479e53f..c4a8a29 100644
--- a/redfish-core/lib/log_services_eventlog.cpp
+++ b/redfish-core/lib/log_services_eventlog.cpp
@@ -1,827 +1,712 @@
-#include "bmcweb_config.h"
+#include <algorithm>
+#include <cstdint>
+#include <cstdio>
+#include <ctime>
+#include <filesystem>  // NOLINT
+#include <fstream>
+#include <functional>
+#include <iomanip>
+#include <memory>
+#include <optional>
+#include <span>  // NOLINT
+#include <sstream>
+#include <string>
+#include <string_view>
+#include <system_error>  // NOLINT
+#include <utility>
+#include <variant>
+#include <vector>
 
 #include "app.hpp"
+#include "http_request.hpp"
+#include "logging.hpp"
+#include "utility.hpp"
+#include "async_resp.hpp"
 #include "dbus_utility.hpp"
-#include "error_messages.hpp"
-#include "external_storer.hpp"
-#include "generated/enums/log_entry.hpp"
-#include "gzfile.hpp"
 #include "http_utility.hpp"
-#include "human_sort.hpp"
+#include "str_utility.hpp"
+#include "error_messages.hpp"
+#include "query.hpp"
+#include "registries.hpp"
+#include "registries/privilege_registry.hpp"
+#include "dbus_utils.hpp"
+#include "json_utils.hpp"
+#include "time_utils.hpp"
 #include "log_services.hpp"
+#include <nlohmann/json.hpp>
 #include "managed_store.hpp"
 #include "managed_store_types.hpp"
-#include "query.hpp"
-#include "redfish_util.hpp"
-#include "registries.hpp"
-#include "registries/base_message_registry.hpp"
-#include "registries/openbmc_message_registry.hpp"
-#include "registries/privilege_registry.hpp"
-#include "task.hpp"
-#include "dbus_utils.hpp"
-#include "system_utils.hpp"
-#include "time_utils.hpp"
+#include "sdbusplus/message/native_types.hpp"
+#include "sdbusplus/unpack_properties.hpp"
 
 #ifdef UNIT_TEST_BUILD
-#include "test/g3/mock_managed_store.hpp" // NOLINT
+#include "test/g3/mock_managed_store.hpp"  // NOLINT
 #endif
 
-namespace redfish
-{
+namespace redfish {
 
 inline void handleGetEventLogService(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/EventLog";
-    asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_1_0.LogService";
-    asyncResp->res.jsonValue["Name"] = "Event Log Service";
-    asyncResp->res.jsonValue["Description"] = "System Event Log Service";
-    asyncResp->res.jsonValue["Id"] = "EventLog";
-    asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/EventLog";
+  asyncResp->res.jsonValue["@odata.type"] = "#LogService.v1_1_0.LogService";
+  asyncResp->res.jsonValue["Name"] = "Event Log Service";
+  asyncResp->res.jsonValue["Description"] = "System Event Log Service";
+  asyncResp->res.jsonValue["Id"] = "EventLog";
+  asyncResp->res.jsonValue["OverWritePolicy"] = "WrapsWhenFull";
 
-    std::pair<std::string, std::string> redfishDateTimeOffset =
-        redfish::time_utils::getDateTimeOffsetNow();
+  std::pair<std::string, std::string> redfishDateTimeOffset =
+      redfish::time_utils::getDateTimeOffsetNow();
 
-    asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
-    asyncResp->res.jsonValue["DateTimeLocalOffset"] =
-        redfishDateTimeOffset.second;
+  asyncResp->res.jsonValue["DateTime"] = redfishDateTimeOffset.first;
+  asyncResp->res.jsonValue["DateTimeLocalOffset"] =
+      redfishDateTimeOffset.second;
 
-    asyncResp->res.jsonValue["Entries"]["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/EventLog/Entries";
-    asyncResp->res.jsonValue["Actions"]["#LogService.ClearLog"] = {
-
-        {"target",
-         "/redfish/v1/Systems/system/LogServices/EventLog/Actions/LogService.ClearLog"}};
+  asyncResp->res.jsonValue["Entries"]["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/EventLog/Entries";
+  asyncResp->res.jsonValue["Actions"]["#LogService.ClearLog"] = {
+      {"target",
+       "/redfish/v1/Systems/system/LogServices/EventLog/Actions/"
+       "LogService.ClearLog"}};
 }
 
-void requestRoutesEventLogService(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/EventLog/")
-        .privileges(redfish::privileges::getLogService)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetEventLogService, std::ref(app)));
+void requestRoutesEventLogService(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/EventLog/")
+      .privileges(redfish::privileges::getLogService)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetEventLogService, std::ref(app)));
 }
 
-static bool
-    getRedfishLogFiles(std::vector<std::filesystem::path>& redfishLogFiles)
-{
-    static const std::filesystem::path redfishLogDir = "/var/log";
-    static const std::string redfishLogFilename = "redfish";
+static bool getRedfishLogFiles(
+    std::vector<std::filesystem::path>& redfishLogFiles) {
+  static const std::filesystem::path redfishLogDir = "/var/log";
+  static const std::string redfishLogFilename = "redfish";
 
-    // Loop through the directory looking for redfish log files
-    for (const std::filesystem::directory_entry& dirEnt :
-         std::filesystem::directory_iterator(redfishLogDir))
-    {
-        // If we find a redfish log file, save the path
-        std::string filename = dirEnt.path().filename();
-        if (filename.starts_with(redfishLogFilename))
-        {
-            redfishLogFiles.emplace_back(redfishLogDir / filename);
-        }
+  // Loop through the directory looking for redfish log files
+  for (const std::filesystem::directory_entry& dirEnt :
+       std::filesystem::directory_iterator(redfishLogDir)) {
+    // If we find a redfish log file, save the path
+    std::string filename = dirEnt.path().filename();
+    if (filename.starts_with(redfishLogFilename)) {
+      redfishLogFiles.emplace_back(redfishLogDir / filename);
     }
-    // As the log files rotate, they are appended with a ".#" that is higher for
-    // the older logs. Since we don't expect more than 10 log files, we
-    // can just sort the list to get them in order from newest to oldest
-    std::sort(redfishLogFiles.begin(), redfishLogFiles.end());
+  }
+  // As the log files rotate, they are appended with a ".#" that is higher for
+  // the older logs. Since we don't expect more than 10 log files, we
+  // can just sort the list to get them in order from newest to oldest
+  std::sort(redfishLogFiles.begin(), redfishLogFiles.end());
 
-    return !redfishLogFiles.empty();
+  return !redfishLogFiles.empty();
 }
 
 inline void handlePostJournalEventLogClear(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  // Clear the EventLog by deleting the log files
+  std::vector<std::filesystem::path> redfishLogFiles;
+  if (getRedfishLogFiles(redfishLogFiles)) {
+    for (const std::filesystem::path& file : redfishLogFiles) {
+      std::error_code ec;
+      std::filesystem::remove(file, ec);
     }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    // Clear the EventLog by deleting the log files
-    std::vector<std::filesystem::path> redfishLogFiles;
-    if (getRedfishLogFiles(redfishLogFiles))
-    {
-        for (const std::filesystem::path& file : redfishLogFiles)
-        {
-            std::error_code ec;
-            std::filesystem::remove(file, ec);
-        }
-    }
+  }
 
-    // Reload rsyslog so it knows to start new log files
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "Failed to reload rsyslog: " << ec;
-            messages::internalError(asyncResp->res);
-            return;
+  // Reload rsyslog so it knows to start new log files
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp](const boost::system::error_code& ec) {
+        if (ec) {
+          BMCWEB_LOG_ERROR << "Failed to reload rsyslog: " << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         messages::success(asyncResp->res);
-    }, "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
-        "org.freedesktop.systemd1.Manager", "ReloadUnit", "rsyslog.service",
-        "replace");
+      },
+      "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
+      "org.freedesktop.systemd1.Manager", "ReloadUnit", "rsyslog.service",
+      "replace");
 }
 
-void requestRoutesJournalEventLogClear(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/EventLog/Actions/LogService.ClearLog/")
-        .privileges({{"ConfigureComponents"}})
-        .methods(boost::beast::http::verb::post)(
-            std::bind_front(handlePostJournalEventLogClear, std::ref(app)));
+void requestRoutesJournalEventLogClear(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/EventLog/Actions/"
+               "LogService.ClearLog/")
+      .privileges({{"ConfigureComponents"}})
+      .methods(boost::beast::http::verb::post)(
+          std::bind_front(handlePostJournalEventLogClear, std::ref(app)));
 }
 
-static LogParseError
-    fillEventLogEntryJson(const std::string& logEntryID,
-                          const std::string& logEntry,
-                          nlohmann::json::object_t& logEntryJson)
-{
-    // The redfish log format is "<Timestamp> <MessageId>,<MessageArgs>"
-    // First get the Timestamp
-    size_t space = logEntry.find_first_of(' ');
-    if (space == std::string::npos)
-    {
-        return LogParseError::parseFailed;
-    }
-    std::string timestamp = logEntry.substr(0, space);
-    // Then get the log contents
-    size_t entryStart = logEntry.find_first_not_of(' ', space);
-    if (entryStart == std::string::npos)
-    {
-        return LogParseError::parseFailed;
-    }
-    std::string_view entry(logEntry);
-    entry.remove_prefix(entryStart);
-    // Use split to separate the entry into its fields
-    std::vector<std::string> logEntryFields;
-    bmcweb::split(logEntryFields, entry, ',');
-    // We need at least a MessageId to be valid
-    if (logEntryFields.empty())
-    {
-        return LogParseError::parseFailed;
-    }
-    std::string& messageID = logEntryFields[0];
+static LogParseError fillEventLogEntryJson(
+    const std::string& logEntryID, const std::string& logEntry,
+    nlohmann::json::object_t& logEntryJson) {
+  // The redfish log format is "<Timestamp> <MessageId>,<MessageArgs>"
+  // First get the Timestamp
+  size_t space = logEntry.find_first_of(' ');
+  if (space == std::string::npos) {
+    return LogParseError::parseFailed;
+  }
+  std::string timestamp = logEntry.substr(0, space);
+  // Then get the log contents
+  size_t entryStart = logEntry.find_first_not_of(' ', space);
+  if (entryStart == std::string::npos) {
+    return LogParseError::parseFailed;
+  }
+  std::string_view entry(logEntry);
+  entry.remove_prefix(entryStart);
+  // Use split to separate the entry into its fields
+  std::vector<std::string> logEntryFields;
+  bmcweb::split(logEntryFields, entry, ',');
+  // We need at least a MessageId to be valid
+  if (logEntryFields.empty()) {
+    return LogParseError::parseFailed;
+  }
+  std::string& messageID = logEntryFields[0];
 
-    // Get the Message from the MessageRegistry
-    const registries::Message* message = registries::getMessage(messageID);
+  // Get the Message from the MessageRegistry
+  const registries::Message* message = registries::getMessage(messageID);
 
-    if (message == nullptr)
-    {
-        BMCWEB_LOG_WARNING << "Log entry not found in registry: " << logEntry;
-        return LogParseError::messageIdNotInRegistry;
+  if (message == nullptr) {
+    BMCWEB_LOG_WARNING << "Log entry not found in registry: " << logEntry;
+    return LogParseError::messageIdNotInRegistry;
+  }
+
+  std::string msg = message->message;
+
+  // Get the MessageArgs from the log if there are any
+  std::span<std::string> messageArgs;
+  if (logEntryFields.size() > 1) {
+    std::string& messageArgsStart = logEntryFields[1];
+    // If the first string is empty, assume there are no MessageArgs
+    std::size_t messageArgsSize = 0;
+    if (!messageArgsStart.empty()) {
+      messageArgsSize = logEntryFields.size() - 1;
     }
 
-    std::string msg = message->message;
+    messageArgs = {&messageArgsStart, messageArgsSize};
 
-    // Get the MessageArgs from the log if there are any
-    std::span<std::string> messageArgs;
-    if (logEntryFields.size() > 1)
-    {
-        std::string& messageArgsStart = logEntryFields[1];
-        // If the first string is empty, assume there are no MessageArgs
-        std::size_t messageArgsSize = 0;
-        if (!messageArgsStart.empty())
-        {
-            messageArgsSize = logEntryFields.size() - 1;
-        }
-
-        messageArgs = {&messageArgsStart, messageArgsSize};
-
-        // Fill the MessageArgs into the Message
-        int i = 0;
-        for (const std::string& messageArg : messageArgs)
-        {
-            std::string argStr = "%" + std::to_string(++i);
-            size_t argPos = msg.find(argStr);
-            if (argPos != std::string::npos)
-            {
-                msg.replace(argPos, argStr.length(), messageArg);
-            }
-        }
+    // Fill the MessageArgs into the Message
+    int i = 0;
+    for (const std::string& messageArg : messageArgs) {
+      std::string argStr = "%" + std::to_string(++i);
+      size_t argPos = msg.find(argStr);
+      if (argPos != std::string::npos) {
+        msg.replace(argPos, argStr.length(), messageArg);
+      }
     }
+  }
 
-    // Get the Created time from the timestamp. The log timestamp is in RFC3339
-    // format which matches the Redfish format except for the fractional seconds
-    // between the '.' and the '+', so just remove them.
-    std::size_t dot = timestamp.find_first_of('.');
-    std::size_t plus = timestamp.find_first_of('+');
-    if (dot != std::string::npos && plus != std::string::npos)
-    {
-        timestamp.erase(dot, plus - dot);
-    }
+  // Get the Created time from the timestamp. The log timestamp is in RFC3339
+  // format which matches the Redfish format except for the fractional seconds
+  // between the '.' and the '+', so just remove them.
+  std::size_t dot = timestamp.find_first_of('.');
+  std::size_t plus = timestamp.find_first_of('+');
+  if (dot != std::string::npos && plus != std::string::npos) {
+    timestamp.erase(dot, plus - dot);
+  }
 
-    // Fill in the log entry with the gathered data
-    logEntryJson["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
-    logEntryJson["@odata.id"] = crow::utility::urlFromPieces(
-        "redfish", "v1", "Systems", "system", "LogServices", "EventLog",
-        "Entries", logEntryID);
-    logEntryJson["Name"] = "System Event Log Entry";
-    logEntryJson["Id"] = logEntryID;
-    logEntryJson["Message"] = std::move(msg);
-    logEntryJson["MessageId"] = std::move(messageID);
-    logEntryJson["MessageArgs"] = messageArgs;
-    logEntryJson["EntryType"] = "Event";
-    logEntryJson["Severity"] = message->messageSeverity;
-    logEntryJson["Created"] = std::move(timestamp);
-    return LogParseError::success;
+  // Fill in the log entry with the gathered data
+  logEntryJson["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
+  logEntryJson["@odata.id"] = crow::utility::urlFromPieces(
+      "redfish", "v1", "Systems", "system", "LogServices", "EventLog",
+      "Entries", logEntryID);
+  logEntryJson["Name"] = "System Event Log Entry";
+  logEntryJson["Id"] = logEntryID;
+  logEntryJson["Message"] = std::move(msg);
+  logEntryJson["MessageId"] = std::move(messageID);
+  logEntryJson["MessageArgs"] = messageArgs;
+  logEntryJson["EntryType"] = "Event";
+  logEntryJson["Severity"] = message->messageSeverity;
+  logEntryJson["Created"] = std::move(timestamp);
+  return LogParseError::success;
 }
 
 static bool getUniqueEntryID(const std::string& logEntry, std::string& entryID,
-                             const bool firstEntry = true)
-{
-    static time_t prevTs = 0;
-    static int index = 0;
-    if (firstEntry)
-    {
-        prevTs = 0;
-    }
+                             const bool firstEntry = true) {
+  static time_t prevTs = 0;
+  static int index = 0;
+  if (firstEntry) {
+    prevTs = 0;
+  }
 
-    // Get the entry timestamp
-    std::time_t curTs = 0;
-    std::tm timeStruct = {};
-    std::istringstream entryStream(logEntry);
-    if (entryStream >> std::get_time(&timeStruct, "%Y-%m-%dT%H:%M:%S"))
-    {
-        curTs = std::mktime(&timeStruct);
-    }
-    // If the timestamp isn't unique, increment the index
-    if (curTs == prevTs)
-    {
-        index++;
-    }
-    else
-    {
-        // Otherwise, reset it
-        index = 0;
-    }
-    // Save the timestamp
-    prevTs = curTs;
+  // Get the entry timestamp
+  std::time_t curTs = 0;
+  std::tm timeStruct = {};
+  std::istringstream entryStream(logEntry);
+  if (entryStream >> std::get_time(&timeStruct, "%Y-%m-%dT%H:%M:%S")) {
+    curTs = std::mktime(&timeStruct);
+  }
+  // If the timestamp isn't unique, increment the index
+  if (curTs == prevTs) {
+    index++;
+  } else {
+    // Otherwise, reset it
+    index = 0;
+  }
+  // Save the timestamp
+  prevTs = curTs;
 
-    entryID = std::to_string(curTs);
-    if (index > 0)
-    {
-        entryID += "_" + std::to_string(index);
-    }
-    return true;
+  entryID = std::to_string(curTs);
+  if (index > 0) {
+    entryID += "_" + std::to_string(index);
+  }
+  return true;
 }
 
 inline void handleGetJournalEventLogEntryCollection(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    query_param::QueryCapabilities capabilities = {
-        .canDelegateTop = true,
-        .canDelegateSkip = true,
-    };
-    query_param::Query delegatedQuery;
-    if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
-                                                  delegatedQuery, capabilities))
-    {
+    const std::string& systemName) {
+  query_param::QueryCapabilities capabilities = {
+      .canDelegateTop = true,
+      .canDelegateSkip = true,
+  };
+  query_param::Query delegatedQuery;
+  if (!redfish::setUpRedfishRouteWithDelegation(app, req, asyncResp,
+                                                delegatedQuery, capabilities)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+
+  size_t top = delegatedQuery.top.value_or(query_param::Query::maxTop);
+  size_t skip = delegatedQuery.skip.value_or(0);
+
+  // Collections don't include the static data added by SubRoute
+  // because it has a duplicate entry for members
+  asyncResp->res.jsonValue["@odata.type"] =
+      "#LogEntryCollection.LogEntryCollection";
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/EventLog/Entries";
+  asyncResp->res.jsonValue["Name"] = "System Event Log Entries";
+  asyncResp->res.jsonValue["Description"] =
+      "Collection of System Event Log Entries";
+
+  nlohmann::json& logEntryArray = asyncResp->res.jsonValue["Members"];
+  logEntryArray = nlohmann::json::array();
+  // Go through the log files and create a unique ID for each
+  // entry
+  std::vector<std::filesystem::path> redfishLogFiles;
+  getRedfishLogFiles(redfishLogFiles);
+  uint64_t entryCount = 0;
+  std::string logEntry;
+
+  // Oldest logs are in the last file, so start there and loop
+  // backwards
+  for (auto it = redfishLogFiles.rbegin(); it < redfishLogFiles.rend(); it++) {
+    std::ifstream logStream(*it);
+    if (!logStream.is_open()) {
+      continue;
+    }
+
+    // Reset the unique ID on the first entry
+    bool firstEntry = true;
+    while (std::getline(logStream, logEntry)) {
+      std::string idStr;
+      if (!getUniqueEntryID(logEntry, idStr, firstEntry)) {
+        continue;
+      }
+      firstEntry = false;
+
+      nlohmann::json::object_t bmcLogEntry;
+      LogParseError status =
+          fillEventLogEntryJson(idStr, logEntry, bmcLogEntry);
+      if (status == LogParseError::messageIdNotInRegistry) {
+        continue;
+      }
+      if (status != LogParseError::success) {
+        messages::internalError(asyncResp->res);
         return;
+      }
+
+      entryCount++;
+      // Handle paging using skip (number of entries to skip from the
+      // start) and top (number of entries to display)
+      if (entryCount <= skip || entryCount > skip + top) {
+        continue;
+      }
+
+      logEntryArray.push_back(std::move(bmcLogEntry));
     }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-
-    size_t top = delegatedQuery.top.value_or(query_param::Query::maxTop);
-    size_t skip = delegatedQuery.skip.value_or(0);
-
-    // Collections don't include the static data added by SubRoute
-    // because it has a duplicate entry for members
-    asyncResp->res.jsonValue["@odata.type"] =
-        "#LogEntryCollection.LogEntryCollection";
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/EventLog/Entries";
-    asyncResp->res.jsonValue["Name"] = "System Event Log Entries";
-    asyncResp->res.jsonValue["Description"] =
-        "Collection of System Event Log Entries";
-
-    nlohmann::json& logEntryArray = asyncResp->res.jsonValue["Members"];
-    logEntryArray = nlohmann::json::array();
-    // Go through the log files and create a unique ID for each
-    // entry
-    std::vector<std::filesystem::path> redfishLogFiles;
-    getRedfishLogFiles(redfishLogFiles);
-    uint64_t entryCount = 0;
-    std::string logEntry;
-
-    // Oldest logs are in the last file, so start there and loop
-    // backwards
-    for (auto it = redfishLogFiles.rbegin(); it < redfishLogFiles.rend(); it++)
-    {
-        std::ifstream logStream(*it);
-        if (!logStream.is_open())
-        {
-            continue;
-        }
-
-        // Reset the unique ID on the first entry
-        bool firstEntry = true;
-        while (std::getline(logStream, logEntry))
-        {
-            std::string idStr;
-            if (!getUniqueEntryID(logEntry, idStr, firstEntry))
-            {
-                continue;
-            }
-            firstEntry = false;
-
-            nlohmann::json::object_t bmcLogEntry;
-            LogParseError status =
-                fillEventLogEntryJson(idStr, logEntry, bmcLogEntry);
-            if (status == LogParseError::messageIdNotInRegistry)
-            {
-                continue;
-            }
-            if (status != LogParseError::success)
-            {
-                messages::internalError(asyncResp->res);
-                return;
-            }
-
-            entryCount++;
-            // Handle paging using skip (number of entries to skip from the
-            // start) and top (number of entries to display)
-            if (entryCount <= skip || entryCount > skip + top)
-            {
-                continue;
-            }
-
-            logEntryArray.push_back(std::move(bmcLogEntry));
-        }
-    }
-    asyncResp->res.jsonValue["Members@odata.count"] = entryCount;
-    if (skip + top < entryCount)
-    {
-        asyncResp->res.jsonValue["Members@odata.nextLink"] =
-            "/redfish/v1/Systems/system/LogServices/EventLog/Entries?$skip=" +
-            std::to_string(skip + top);
-    }
+  }
+  asyncResp->res.jsonValue["Members@odata.count"] = entryCount;
+  if (skip + top < entryCount) {
+    asyncResp->res.jsonValue["Members@odata.nextLink"] =
+        "/redfish/v1/Systems/system/LogServices/EventLog/Entries?$skip=" +
+        std::to_string(skip + top);
+  }
 }
 
-void requestRoutesJournalEventLogEntryCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleGetJournalEventLogEntryCollection, std::ref(app)));
+void requestRoutesJournalEventLogEntryCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(std::bind_front(
+          handleGetJournalEventLogEntryCollection, std::ref(app)));
 }
 
 inline void handleGetJournalEventLogEntry(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName, const std::string& param)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
+    const std::string& systemName, const std::string& param) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+
+  const std::string& targetID = param;
+
+  // Go through the log files and check the unique ID for each
+  // entry to find the target entry
+  std::vector<std::filesystem::path> redfishLogFiles;
+  getRedfishLogFiles(redfishLogFiles);
+  std::string logEntry;
+
+  // Oldest logs are in the last file, so start there and loop
+  // backwards
+  for (auto it = redfishLogFiles.rbegin(); it < redfishLogFiles.rend(); it++) {
+    std::ifstream logStream(*it);
+    if (!logStream.is_open()) {
+      continue;
     }
 
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+    // Reset the unique ID on the first entry
+    bool firstEntry = true;
+    while (std::getline(logStream, logEntry)) {
+      std::string idStr;
+      if (!getUniqueEntryID(logEntry, idStr, firstEntry)) {
+        continue;
+      }
+      firstEntry = false;
 
-    const std::string& targetID = param;
-
-    // Go through the log files and check the unique ID for each
-    // entry to find the target entry
-    std::vector<std::filesystem::path> redfishLogFiles;
-    getRedfishLogFiles(redfishLogFiles);
-    std::string logEntry;
-
-    // Oldest logs are in the last file, so start there and loop
-    // backwards
-    for (auto it = redfishLogFiles.rbegin(); it < redfishLogFiles.rend(); it++)
-    {
-        std::ifstream logStream(*it);
-        if (!logStream.is_open())
-        {
-            continue;
+      if (idStr == targetID) {
+        nlohmann::json::object_t bmcLogEntry;
+        LogParseError status =
+            fillEventLogEntryJson(idStr, logEntry, bmcLogEntry);
+        if (status != LogParseError::success) {
+          messages::internalError(asyncResp->res);
+          return;
         }
-
-        // Reset the unique ID on the first entry
-        bool firstEntry = true;
-        while (std::getline(logStream, logEntry))
-        {
-            std::string idStr;
-            if (!getUniqueEntryID(logEntry, idStr, firstEntry))
-            {
-                continue;
-            }
-            firstEntry = false;
-
-            if (idStr == targetID)
-            {
-                nlohmann::json::object_t bmcLogEntry;
-                LogParseError status =
-                    fillEventLogEntryJson(idStr, logEntry, bmcLogEntry);
-                if (status != LogParseError::success)
-                {
-                    messages::internalError(asyncResp->res);
-                    return;
-                }
-                asyncResp->res.jsonValue.update(bmcLogEntry);
-                return;
-            }
-        }
+        asyncResp->res.jsonValue.update(bmcLogEntry);
+        return;
+      }
     }
-    // Requested ID was not found
-    messages::resourceNotFound(asyncResp->res, "LogEntry", targetID);
+  }
+  // Requested ID was not found
+  messages::resourceNotFound(asyncResp->res, "LogEntry", targetID);
 }
 
-void requestRoutesJournalEventLogEntry(App& app)
-{
-    BMCWEB_ROUTE(
-        app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetJournalEventLogEntry, std::ref(app)));
+void requestRoutesJournalEventLogEntry(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetJournalEventLogEntry, std::ref(app)));
 }
 
-inline std::optional<bool> getProviderNotifyAction(const std::string& notify)
-{
-    std::optional<bool> notifyAction;
-    if (notify == "xyz.openbmc_project.Logging.Entry.Notify.Notify")
-    {
-        notifyAction = true;
-    }
-    else if (notify == "xyz.openbmc_project.Logging.Entry.Notify.Inhibit")
-    {
-        notifyAction = false;
-    }
+inline std::optional<bool> getProviderNotifyAction(const std::string& notify) {
+  std::optional<bool> notifyAction;
+  if (notify == "xyz.openbmc_project.Logging.Entry.Notify.Notify") {
+    notifyAction = true;
+  } else if (notify == "xyz.openbmc_project.Logging.Entry.Notify.Inhibit") {
+    notifyAction = false;
+  }
 
-    return notifyAction;
+  return notifyAction;
 }
 
-inline std::string translateSeverityDbusToRedfish(const std::string& s)
-{
-    if ((s == "xyz.openbmc_project.Logging.Entry.Level.Alert") ||
-        (s == "xyz.openbmc_project.Logging.Entry.Level.Critical") ||
-        (s == "xyz.openbmc_project.Logging.Entry.Level.Emergency") ||
-        (s == "xyz.openbmc_project.Logging.Entry.Level.Error"))
-    {
-        return "Critical";
-    }
-    if ((s == "xyz.openbmc_project.Logging.Entry.Level.Debug") ||
-        (s == "xyz.openbmc_project.Logging.Entry.Level.Informational") ||
-        (s == "xyz.openbmc_project.Logging.Entry.Level.Notice"))
-    {
-        return "OK";
-    }
-    if (s == "xyz.openbmc_project.Logging.Entry.Level.Warning")
-    {
-        return "Warning";
-    }
-    return "";
+inline std::string translateSeverityDbusToRedfish(const std::string& s) {
+  if ((s == "xyz.openbmc_project.Logging.Entry.Level.Alert") ||
+      (s == "xyz.openbmc_project.Logging.Entry.Level.Critical") ||
+      (s == "xyz.openbmc_project.Logging.Entry.Level.Emergency") ||
+      (s == "xyz.openbmc_project.Logging.Entry.Level.Error")) {
+    return "Critical";
+  }
+  if ((s == "xyz.openbmc_project.Logging.Entry.Level.Debug") ||
+      (s == "xyz.openbmc_project.Logging.Entry.Level.Informational") ||
+      (s == "xyz.openbmc_project.Logging.Entry.Level.Notice")) {
+    return "OK";
+  }
+  if (s == "xyz.openbmc_project.Logging.Entry.Level.Warning") {
+    return "Warning";
+  }
+  return "";
 }
 
 inline void handleGetDBusEventLogEntryCollection(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+    const std::string& systemName) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    // Collections don't include the static data added by SubRoute
-    // because it has a duplicate entry for members
-    asyncResp->res.jsonValue["@odata.type"] =
-        "#LogEntryCollection.LogEntryCollection";
-    asyncResp->res.jsonValue["@odata.id"] =
-        "/redfish/v1/Systems/system/LogServices/EventLog/Entries";
-    asyncResp->res.jsonValue["Name"] = "System Event Log Entries";
-    asyncResp->res.jsonValue["Description"] =
-        "Collection of System Event Log Entries";
+  // Collections don't include the static data added by SubRoute
+  // because it has a duplicate entry for members
+  asyncResp->res.jsonValue["@odata.type"] =
+      "#LogEntryCollection.LogEntryCollection";
+  asyncResp->res.jsonValue["@odata.id"] =
+      "/redfish/v1/Systems/system/LogServices/EventLog/Entries";
+  asyncResp->res.jsonValue["Name"] = "System Event Log Entries";
+  asyncResp->res.jsonValue["Description"] =
+      "Collection of System Event Log Entries";
 
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    // DBus implementation of EventLog/Entries
-    // Make call to Logging Service to find all log entry objects
-    managedStore::GetManagedObjectStore()->getManagedObjectsWithContext(
-        "xyz.openbmc_project.Logging", {"/xyz/openbmc_project/logging"},
-        context,
-        [asyncResp](const boost::system::error_code& ec,
-                    const dbus::utility::ManagedObjectType& resp) {
-        if (ec)
-        {
-            // TODO Handle for specific error code
-            BMCWEB_LOG_ERROR << "getLogEntriesIfaceData resp_handler got error "
-                             << ec;
-            messages::internalError(asyncResp->res);
-            return;
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  // DBus implementation of EventLog/Entries
+  // Make call to Logging Service to find all log entry objects
+  managedStore::GetManagedObjectStore()->getManagedObjectsWithContext(
+      "xyz.openbmc_project.Logging", {"/xyz/openbmc_project/logging"}, context,
+      [asyncResp](const boost::system::error_code& ec,
+                  const dbus::utility::ManagedObjectType& resp) {
+        if (ec) {
+          // TODO Handle for specific error code
+          BMCWEB_LOG_ERROR << "getLogEntriesIfaceData resp_handler got error "
+                           << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
         nlohmann::json& entriesArray = asyncResp->res.jsonValue["Members"];
         entriesArray = nlohmann::json::array();
-        for (const auto& objectPath : resp)
-        {
-            const uint32_t* id = nullptr;
-            const uint64_t* timestamp = nullptr;
-            const uint64_t* updateTimestamp = nullptr;
-            const std::string* severity = nullptr;
-            const std::string* message = nullptr;
-            const std::string* filePath = nullptr;
-            const std::string* resolution = nullptr;
-            bool resolved = false;
-            const std::string* notify = nullptr;
+        for (const auto& objectPath : resp) {
+          const uint32_t* id = nullptr;
+          const uint64_t* timestamp = nullptr;
+          const uint64_t* updateTimestamp = nullptr;
+          const std::string* severity = nullptr;
+          const std::string* message = nullptr;
+          const std::string* filePath = nullptr;
+          const std::string* resolution = nullptr;
+          bool resolved = false;
+          const std::string* notify = nullptr;
 
-            for (const auto& interfaceMap : objectPath.second)
-            {
-                if (interfaceMap.first == "xyz.openbmc_project.Logging.Entry")
-                {
-                    for (const auto& propertyMap : interfaceMap.second)
-                    {
-                        if (propertyMap.first == "Id")
-                        {
-                            id = std::get_if<uint32_t>(&propertyMap.second);
-                        }
-                        else if (propertyMap.first == "Timestamp")
-                        {
-                            timestamp =
-                                std::get_if<uint64_t>(&propertyMap.second);
-                        }
-                        else if (propertyMap.first == "UpdateTimestamp")
-                        {
-                            updateTimestamp =
-                                std::get_if<uint64_t>(&propertyMap.second);
-                        }
-                        else if (propertyMap.first == "Severity")
-                        {
-                            severity =
-                                std::get_if<std::string>(&propertyMap.second);
-                        }
-                        else if (propertyMap.first == "Resolution")
-                        {
-                            resolution =
-                                std::get_if<std::string>(&propertyMap.second);
-                        }
-                        else if (propertyMap.first == "Message")
-                        {
-                            message =
-                                std::get_if<std::string>(&propertyMap.second);
-                        }
-                        else if (propertyMap.first == "Resolved")
-                        {
-                            const bool* resolveptr =
-                                std::get_if<bool>(&propertyMap.second);
-                            if (resolveptr == nullptr)
-                            {
-                                messages::internalError(asyncResp->res);
-                                return;
-                            }
-                            resolved = *resolveptr;
-                        }
-                        else if (propertyMap.first == "ServiceProviderNotify")
-                        {
-                            notify =
-                                std::get_if<std::string>(&propertyMap.second);
-                            if (notify == nullptr)
-                            {
-                                messages::internalError(asyncResp->res);
-                                return;
-                            }
-                        }
-                    }
-                    if (id == nullptr || message == nullptr ||
-                        severity == nullptr)
-                    {
-                        messages::internalError(asyncResp->res);
-                        return;
-                    }
+          for (const auto& interfaceMap : objectPath.second) {
+            if (interfaceMap.first == "xyz.openbmc_project.Logging.Entry") {
+              for (const auto& propertyMap : interfaceMap.second) {
+                if (propertyMap.first == "Id") {
+                  id = std::get_if<uint32_t>(&propertyMap.second);
+                } else if (propertyMap.first == "Timestamp") {
+                  timestamp = std::get_if<uint64_t>(&propertyMap.second);
+                } else if (propertyMap.first == "UpdateTimestamp") {
+                  updateTimestamp = std::get_if<uint64_t>(&propertyMap.second);
+                } else if (propertyMap.first == "Severity") {
+                  severity = std::get_if<std::string>(&propertyMap.second);
+                } else if (propertyMap.first == "Resolution") {
+                  resolution = std::get_if<std::string>(&propertyMap.second);
+                } else if (propertyMap.first == "Message") {
+                  message = std::get_if<std::string>(&propertyMap.second);
+                } else if (propertyMap.first == "Resolved") {
+                  const bool* resolveptr =
+                      std::get_if<bool>(&propertyMap.second);
+                  if (resolveptr == nullptr) {
+                    messages::internalError(asyncResp->res);
+                    return;
+                  }
+                  resolved = *resolveptr;
+                } else if (propertyMap.first == "ServiceProviderNotify") {
+                  notify = std::get_if<std::string>(&propertyMap.second);
+                  if (notify == nullptr) {
+                    messages::internalError(asyncResp->res);
+                    return;
+                  }
                 }
-                else if (interfaceMap.first ==
-                         "xyz.openbmc_project.Common.FilePath")
-                {
-                    for (const auto& propertyMap : interfaceMap.second)
-                    {
-                        if (propertyMap.first == "Path")
-                        {
-                            filePath =
-                                std::get_if<std::string>(&propertyMap.second);
-                        }
-                    }
+              }
+              if (id == nullptr || message == nullptr || severity == nullptr) {
+                messages::internalError(asyncResp->res);
+                return;
+              }
+            } else if (interfaceMap.first ==
+                       "xyz.openbmc_project.Common.FilePath") {
+              for (const auto& propertyMap : interfaceMap.second) {
+                if (propertyMap.first == "Path") {
+                  filePath = std::get_if<std::string>(&propertyMap.second);
                 }
+              }
             }
-            // Object path without the
-            // xyz.openbmc_project.Logging.Entry interface, ignore
-            // and continue.
-            if (id == nullptr || message == nullptr || severity == nullptr ||
-                timestamp == nullptr || updateTimestamp == nullptr)
-            {
-                continue;
-            }
-            entriesArray.push_back({});
-            nlohmann::json& thisEntry = entriesArray.back();
-            thisEntry["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
-            thisEntry["@odata.id"] = crow::utility::urlFromPieces(
-                "redfish", "v1", "Systems", "system", "LogServices", "EventLog",
-                "Entries", std::to_string(*id));
-            thisEntry["Name"] = "System Event Log Entry";
-            thisEntry["Id"] = std::to_string(*id);
-            thisEntry["Message"] = *message;
-            thisEntry["Resolved"] = resolved;
-            if ((resolution != nullptr) && (!(*resolution).empty()))
-            {
-                thisEntry["Resolution"] = *resolution;
-            }
-            std::optional<bool> notifyAction = getProviderNotifyAction(*notify);
-            if (notifyAction)
-            {
-                thisEntry["ServiceProviderNotified"] = *notifyAction;
-            }
-            thisEntry["EntryType"] = "Event";
-            thisEntry["Severity"] = translateSeverityDbusToRedfish(*severity);
-            thisEntry["Created"] =
-                redfish::time_utils::getDateTimeUintMs(*timestamp);
-            thisEntry["Modified"] =
-                redfish::time_utils::getDateTimeUintMs(*updateTimestamp);
-            if (filePath != nullptr)
-            {
-                thisEntry["AdditionalDataURI"] =
-                    "/redfish/v1/Systems/system/LogServices/EventLog/Entries/" +
-                    std::to_string(*id) + "/attachment";
-            }
+          }
+          // Object path without the
+          // xyz.openbmc_project.Logging.Entry interface, ignore
+          // and continue.
+          if (id == nullptr || message == nullptr || severity == nullptr ||
+              timestamp == nullptr || updateTimestamp == nullptr) {
+            continue;
+          }
+          entriesArray.push_back({});
+          nlohmann::json& thisEntry = entriesArray.back();
+          thisEntry["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
+          thisEntry["@odata.id"] = crow::utility::urlFromPieces(
+              "redfish", "v1", "Systems", "system", "LogServices", "EventLog",
+              "Entries", std::to_string(*id));
+          thisEntry["Name"] = "System Event Log Entry";
+          thisEntry["Id"] = std::to_string(*id);
+          thisEntry["Message"] = *message;
+          thisEntry["Resolved"] = resolved;
+          if ((resolution != nullptr) && (!(*resolution).empty())) {
+            thisEntry["Resolution"] = *resolution;
+          }
+          std::optional<bool> notifyAction = getProviderNotifyAction(*notify);
+          if (notifyAction) {
+            thisEntry["ServiceProviderNotified"] = *notifyAction;
+          }
+          thisEntry["EntryType"] = "Event";
+          thisEntry["Severity"] = translateSeverityDbusToRedfish(*severity);
+          thisEntry["Created"] =
+              redfish::time_utils::getDateTimeUintMs(*timestamp);
+          thisEntry["Modified"] =
+              redfish::time_utils::getDateTimeUintMs(*updateTimestamp);
+          if (filePath != nullptr) {
+            thisEntry["AdditionalDataURI"] =
+                "/redfish/v1/Systems/system/LogServices/EventLog/Entries/" +
+                std::to_string(*id) + "/attachment";
+          }
         }
         std::sort(entriesArray.begin(), entriesArray.end(),
                   [](const nlohmann::json& left, const nlohmann::json& right) {
-            return (left["Id"] <= right["Id"]);
-        });
+                    return (left["Id"] <= right["Id"]);
+                  });
         asyncResp->res.jsonValue["Members@odata.count"] = entriesArray.size();
-    });
+      });
 }
 
-void requestRoutesDBusEventLogEntryCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/")
-        .privileges(redfish::privileges::getLogEntryCollection)
-        .methods(boost::beast::http::verb::get)(std::bind_front(
-            handleGetDBusEventLogEntryCollection, std::ref(app)));
+void requestRoutesDBusEventLogEntryCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/")
+      .privileges(redfish::privileges::getLogEntryCollection)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetDBusEventLogEntryCollection, std::ref(app)));
 }
 
 void handleDeleteEventLogEntry(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName, const std::string& param)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
+    const std::string& systemName, const std::string& param) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  BMCWEB_LOG_DEBUG << "Do delete single event entries.";
+
+  std::string entryID = param;
+
+  dbus::utility::escapePathForDbus(entryID);
+
+  // Process response from Logging service.
+  auto respHandler = [asyncResp, entryID](const boost::system::error_code& ec) {
+    BMCWEB_LOG_DEBUG << "EventLogEntry (DBus) doDelete callback: Done";
+    if (ec) {
+      if (ec.value() == EBADR) {
+        messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
         return;
+      }
+      // TODO Handle for specific error code
+      BMCWEB_LOG_ERROR << "EventLogEntry (DBus) doDelete respHandler got error "
+                       << ec;
+      asyncResp->res.result(boost::beast::http::status::internal_server_error);
+      return;
     }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    BMCWEB_LOG_DEBUG << "Do delete single event entries.";
 
-    std::string entryID = param;
+    asyncResp->res.result(boost::beast::http::status::ok);
+  };
 
-    dbus::utility::escapePathForDbus(entryID);
-
-    // Process response from Logging service.
-    auto respHandler = [asyncResp,
-                        entryID](const boost::system::error_code& ec) {
-        BMCWEB_LOG_DEBUG << "EventLogEntry (DBus) doDelete callback: Done";
-        if (ec)
-        {
-            if (ec.value() == EBADR)
-            {
-                messages::resourceNotFound(asyncResp->res, "LogEntry", entryID);
-                return;
-            }
-            // TODO Handle for specific error code
-            BMCWEB_LOG_ERROR
-                << "EventLogEntry (DBus) doDelete respHandler got error " << ec;
-            asyncResp->res.result(
-                boost::beast::http::status::internal_server_error);
-            return;
-        }
-
-        asyncResp->res.result(boost::beast::http::status::ok);
-    };
-
-    // Make call to Logging service to request Delete Log
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        respHandler, "xyz.openbmc_project.Logging",
-        "/xyz/openbmc_project/logging/entry/" + entryID,
-        "xyz.openbmc_project.Object.Delete", "Delete");
+  // Make call to Logging service to request Delete Log
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_, respHandler, "xyz.openbmc_project.Logging",
+      "/xyz/openbmc_project/logging/entry/" + entryID,
+      "xyz.openbmc_project.Object.Delete", "Delete");
 }
 
 void handlePatchEventLogEntry(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName, const std::string& entryId)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
-    std::optional<bool> resolved;
+    const std::string& systemName, const std::string& entryId) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
+  std::optional<bool> resolved;
 
-    if (!json_util::readJsonPatch(req, asyncResp->res, "Resolved", resolved))
-    {
-        return;
-    }
-    BMCWEB_LOG_DEBUG << "Set Resolved";
+  if (!json_util::readJsonPatch(req, asyncResp->res, "Resolved", resolved)) {
+    return;
+  }
+  BMCWEB_LOG_DEBUG << "Set Resolved";
 
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp, entryId](const boost::system::error_code& ec) {
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
-            messages::internalError(asyncResp->res);
-            return;
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp, entryId](const boost::system::error_code& ec) {
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
-    }, "xyz.openbmc_project.Logging",
-        "/xyz/openbmc_project/logging/entry/" + entryId,
-        "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Logging.Entry", "Resolved",
-        dbus::utility::DbusVariantType(*resolved));
+      },
+      "xyz.openbmc_project.Logging",
+      "/xyz/openbmc_project/logging/entry/" + entryId,
+      "org.freedesktop.DBus.Properties", "Set",
+      "xyz.openbmc_project.Logging.Entry", "Resolved",
+      dbus::utility::DbusVariantType(*resolved));
 }
 
 inline void handleGetDBusEventLogEntry(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName, const std::string& param)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+    const std::string& systemName, const std::string& param) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    std::string entryID = param;
-    dbus::utility::escapePathForDbus(entryID);
+  std::string entryID = param;
+  dbus::utility::escapePathForDbus(entryID);
 
-    // DBus implementation of EventLog/Entries
-    // Make call to Logging Service to find all log entry objects
-    managedStore::ManagedObjectStoreContext context(asyncResp);
-    managedStore::GetManagedObjectStore()->getAllProperties(
-        "xyz.openbmc_project.Logging",
-        "/xyz/openbmc_project/logging/entry/" + entryID, "", context,
-        [asyncResp, entryID](const boost::system::error_code& ec,
-                             const dbus::utility::DBusPropertiesMap& resp) {
-        if (ec.value() == EBADR)
-        {
-            messages::resourceNotFound(asyncResp->res, "EventLogEntry",
-                                       entryID);
-            return;
+  // DBus implementation of EventLog/Entries
+  // Make call to Logging Service to find all log entry objects
+  managedStore::ManagedObjectStoreContext context(asyncResp);
+  managedStore::GetManagedObjectStore()->getAllProperties(
+      "xyz.openbmc_project.Logging",
+      "/xyz/openbmc_project/logging/entry/" + entryID, "", context,
+      [asyncResp, entryID](const boost::system::error_code& ec,
+                           const dbus::utility::DBusPropertiesMap& resp) {
+        if (ec.value() == EBADR) {
+          messages::resourceNotFound(asyncResp->res, "EventLogEntry", entryID);
+          return;
         }
-        if (ec)
-        {
-            BMCWEB_LOG_ERROR << "EventLogEntry (DBus) resp_handler got error "
-                             << ec;
-            messages::internalError(asyncResp->res);
-            return;
+        if (ec) {
+          BMCWEB_LOG_ERROR << "EventLogEntry (DBus) resp_handler got error "
+                           << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
         const uint32_t* id = nullptr;
         const uint64_t* timestamp = nullptr;
@@ -839,18 +724,16 @@
             "Message", message, "Resolved", resolved, "Resolution", resolution,
             "Path", filePath, "ServiceProviderNotify", notify);
 
-        if (!success)
-        {
-            messages::internalError(asyncResp->res);
-            return;
+        if (!success) {
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         if (id == nullptr || message == nullptr || severity == nullptr ||
             timestamp == nullptr || updateTimestamp == nullptr ||
-            notify == nullptr)
-        {
-            messages::internalError(asyncResp->res);
-            return;
+            notify == nullptr) {
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         asyncResp->res.jsonValue["@odata.type"] = "#LogEntry.v1_9_0.LogEntry";
@@ -862,13 +745,11 @@
         asyncResp->res.jsonValue["Message"] = *message;
         asyncResp->res.jsonValue["Resolved"] = resolved;
         std::optional<bool> notifyAction = getProviderNotifyAction(*notify);
-        if (notifyAction)
-        {
-            asyncResp->res.jsonValue["ServiceProviderNotified"] = *notifyAction;
+        if (notifyAction) {
+          asyncResp->res.jsonValue["ServiceProviderNotified"] = *notifyAction;
         }
-        if ((resolution != nullptr) && (!(*resolution).empty()))
-        {
-            asyncResp->res.jsonValue["Resolution"] = *resolution;
+        if ((resolution != nullptr) && (!(*resolution).empty())) {
+          asyncResp->res.jsonValue["Resolution"] = *resolution;
         }
         asyncResp->res.jsonValue["EntryType"] = "Event";
         asyncResp->res.jsonValue["Severity"] =
@@ -877,116 +758,102 @@
             redfish::time_utils::getDateTimeUintMs(*timestamp);
         asyncResp->res.jsonValue["Modified"] =
             redfish::time_utils::getDateTimeUintMs(*updateTimestamp);
-        if (filePath != nullptr)
-        {
-            asyncResp->res.jsonValue["AdditionalDataURI"] =
-                "/redfish/v1/Systems/system/LogServices/EventLog/Entries/" +
-                std::to_string(*id) + "/attachment";
+        if (filePath != nullptr) {
+          asyncResp->res.jsonValue["AdditionalDataURI"] =
+              "/redfish/v1/Systems/system/LogServices/EventLog/Entries/" +
+              std::to_string(*id) + "/attachment";
         }
-    });
+      });
 }
 
-void requestRoutesDBusEventLogEntry(App& app)
-{
-    BMCWEB_ROUTE(
-        app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetDBusEventLogEntry, std::ref(app)));
+void requestRoutesDBusEventLogEntry(App& app) {
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetDBusEventLogEntry, std::ref(app)));
 
-    BMCWEB_ROUTE(
-        app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
-        .privileges(redfish::privileges::patchLogEntry)
-        .methods(boost::beast::http::verb::patch)(
-            std::bind_front(handlePatchEventLogEntry, std::ref(app)));
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
+      .privileges(redfish::privileges::patchLogEntry)
+      .methods(boost::beast::http::verb::patch)(
+          std::bind_front(handlePatchEventLogEntry, std::ref(app)));
 
-    BMCWEB_ROUTE(
-        app, "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
-        .privileges(redfish::privileges::deleteLogEntry)
+  BMCWEB_ROUTE(app,
+               "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/")
+      .privileges(redfish::privileges::deleteLogEntry)
 
-        .methods(boost::beast::http::verb::delete_)(
-            std::bind_front(handleDeleteEventLogEntry, std::ref(app)));
+      .methods(boost::beast::http::verb::delete_)(
+          std::bind_front(handleDeleteEventLogEntry, std::ref(app)));
 }
 
 inline void handleGetDBusEventLogEntryDownload(
     App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-    const std::string& systemName, const std::string& param)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    if (http_helpers::isContentTypeAllowed(
-            req.getHeaderValue("Accept"),
-            http_helpers::ContentType::OctetStream, true))
-    {
-        asyncResp->res.result(boost::beast::http::status::bad_request);
-        return;
-    }
-    if (systemName != "system")
-    {
-        messages::resourceNotFound(asyncResp->res, "ComputerSystem",
-                                   systemName);
-        return;
-    }
+    const std::string& systemName, const std::string& param) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  if (http_helpers::isContentTypeAllowed(req.getHeaderValue("Accept"),
+                                         http_helpers::ContentType::OctetStream,
+                                         true)) {
+    asyncResp->res.result(boost::beast::http::status::bad_request);
+    return;
+  }
+  if (systemName != "system") {
+    messages::resourceNotFound(asyncResp->res, "ComputerSystem", systemName);
+    return;
+  }
 
-    std::string entryID = param;
-    dbus::utility::escapePathForDbus(entryID);
+  std::string entryID = param;
+  dbus::utility::escapePathForDbus(entryID);
 
-    managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
-        asyncResp->strand_,
-        [asyncResp, entryID](const boost::system::error_code& ec,
-                             const sdbusplus::message::unix_fd& unixfd) {
-        if (ec.value() == EBADR)
-        {
-            messages::resourceNotFound(asyncResp->res, "EventLogAttachment",
-                                       entryID);
-            return;
+  managedStore::GetManagedObjectStore()->PostDbusCallToIoContextThreadSafe(
+      asyncResp->strand_,
+      [asyncResp, entryID](const boost::system::error_code& ec,
+                           const sdbusplus::message::unix_fd& unixfd) {
+        if (ec.value() == EBADR) {
+          messages::resourceNotFound(asyncResp->res, "EventLogAttachment",
+                                     entryID);
+          return;
         }
-        if (ec)
-        {
-            BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
-            messages::internalError(asyncResp->res);
-            return;
+        if (ec) {
+          BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         int fd = -1;
         fd = dup(unixfd);
-        if (fd == -1)
-        {
-            messages::internalError(asyncResp->res);
-            return;
+        if (fd == -1) {
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         int64_t size = lseek(fd, 0, SEEK_END);
-        if (size == -1)
-        {
-            messages::internalError(asyncResp->res);
-            return;
+        if (size == -1) {
+          messages::internalError(asyncResp->res);
+          return;
         }
 
         // Arbitrary max size of 64kb
         constexpr int maxFileSize = 65536;
-        if (size > maxFileSize)
-        {
-            BMCWEB_LOG_ERROR << "File size exceeds maximum allowed size of "
-                             << maxFileSize;
-            messages::internalError(asyncResp->res);
-            return;
+        if (size > maxFileSize) {
+          BMCWEB_LOG_ERROR << "File size exceeds maximum allowed size of "
+                           << maxFileSize;
+          messages::internalError(asyncResp->res);
+          return;
         }
         std::vector<char> data(static_cast<size_t>(size));
         int64_t rc = lseek(fd, 0, SEEK_SET);
-        if (rc == -1)
-        {
-            messages::internalError(asyncResp->res);
-            return;
+        if (rc == -1) {
+          messages::internalError(asyncResp->res);
+          return;
         }
         rc = read(fd, data.data(), data.size());
-        if ((rc == -1) || (rc != size))
-        {
-            messages::internalError(asyncResp->res);
-            return;
+        if ((rc == -1) || (rc != size)) {
+          messages::internalError(asyncResp->res);
+          return;
         }
         close(fd);
 
@@ -998,20 +865,19 @@
         asyncResp->res.addHeader(
             boost::beast::http::field::content_transfer_encoding, "Base64");
         asyncResp->res.body() = std::move(output);
-    },
-        "xyz.openbmc_project.Logging",
-        "/xyz/openbmc_project/logging/entry/" + entryID,
-        "xyz.openbmc_project.Logging.Entry", "GetEntry");
+      },
+      "xyz.openbmc_project.Logging",
+      "/xyz/openbmc_project/logging/entry/" + entryID,
+      "xyz.openbmc_project.Logging.Entry", "GetEntry");
 }
 
-void requestRoutesDBusEventLogEntryDownload(App& app)
-{
-    BMCWEB_ROUTE(
-        app,
-        "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/attachment")
-        .privileges(redfish::privileges::getLogEntry)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetDBusEventLogEntryDownload, std::ref(app)));
+void requestRoutesDBusEventLogEntryDownload(App& app) {
+  BMCWEB_ROUTE(
+      app,
+      "/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/attachment")
+      .privileges(redfish::privileges::getLogEntry)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetDBusEventLogEntryDownload, std::ref(app)));
 }
 
-} // namespace redfish
+}  // namespace redfish
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index efc6254..3df433b 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -1,3 +1,6 @@
+#ifndef THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_TASK_H_
+#define THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_TASK_H_
+
 /*
 // Copyright (c) 2020 Intel Corporation
 //
@@ -13,539 +16,485 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 */
-#pragma once
 
+#include <algorithm>
+#include <array>
+#include <chrono>  // NOLINT
+#include <cstddef>
+#include <ctime>
+#include <deque>
+#include <functional>
+#include <memory>
+#include <optional>
+#include <string>
+#include <string_view>
+#include <utility>
+
+#include "boost/asio/post.hpp"  // NOLINT
+#include "boost/asio/steady_timer.hpp"  // NOLINT
 #include "app.hpp"
-#include "dbus_utility.hpp"
+#include "http_request.hpp"
+#include "http_response.hpp"
+#include "logging.hpp"
+#include "parsing.hpp"
+#include "utility.hpp"
+#include "async_resp.hpp"
+#include "error_messages.hpp"
 #include "event_service_manager.hpp"
-#include "health.hpp"
-#include "http/parsing.hpp"
 #include "query.hpp"
 #include "registries/privilege_registry.hpp"
 #include "task_messages.hpp"
-
-#include <boost/asio/post.hpp>
-#include <boost/asio/steady_timer.hpp>
-#include <sdbusplus/bus/match.hpp>
-
-#include <chrono>
-#include <memory>
-#include <variant>
-
+#include "time_utils.hpp"
+#include "health.hpp"
+#include <nlohmann/json.hpp>
 #include "managed_store.hpp"
+#include "sdbusplus/bus.hpp"
+#include "sdbusplus/bus/match.hpp"
+#include "sdbusplus/message.hpp"
 
 #ifdef UNIT_TEST_BUILD
-#include "test/g3/mock_managed_store.hpp" // NOLINT
+#include "test/g3/mock_managed_store.hpp"  // NOLINT
 #endif
 
-namespace redfish
-{
+namespace redfish {
 
-namespace task
-{
-constexpr size_t maxTaskCount = 100; // arbitrary limit
+namespace task {
+constexpr size_t maxTaskCount = 100;  // arbitrary limit
 
 // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
 static std::deque<std::shared_ptr<struct TaskData>> tasks;
 
 constexpr bool completed = true;
 
-struct Payload
-{
-    explicit Payload(const crow::Request& req) :
-        targetUri(req.url().encoded_path()), httpOperation(req.methodString()),
-        httpHeaders(nlohmann::json::array())
-    {
-        using field_ns = boost::beast::http::field;
-        constexpr const std::array<boost::beast::http::field, 7>
-            headerWhitelist = {field_ns::accept,     field_ns::accept_encoding,
-                               field_ns::user_agent, field_ns::host,
-                               field_ns::connection, field_ns::content_length,
-                               field_ns::upgrade};
+struct Payload {
+  explicit Payload(const crow::Request& req)
+      : targetUri(req.url().encoded_path()),
+        httpOperation(req.methodString()),
+        httpHeaders(nlohmann::json::array()) {
+    using field_ns = boost::beast::http::field;
+    constexpr const std::array<boost::beast::http::field, 7> headerWhitelist = {
+        field_ns::accept, field_ns::accept_encoding, field_ns::user_agent,
+        field_ns::host,   field_ns::connection,      field_ns::content_length,
+        field_ns::upgrade};
 
-        JsonParseResult ret = parseRequestAsJson(req, jsonBody);
-        if (ret != JsonParseResult::Success)
-        {
-            return;
-        }
-
-        for (const auto& field : req.fields())
-        {
-            if (std::find(headerWhitelist.begin(), headerWhitelist.end(),
-                          field.name()) == headerWhitelist.end())
-            {
-                continue;
-            }
-            std::string header;
-            header.reserve(field.name_string().size() + 2 +
-                           field.value().size());
-            header += field.name_string();
-            header += ": ";
-            header += field.value();
-            httpHeaders.emplace_back(std::move(header));
-        }
+    JsonParseResult ret = parseRequestAsJson(req, jsonBody);
+    if (ret != JsonParseResult::Success) {
+      return;
     }
-    Payload() = delete;
 
-    std::string targetUri;
-    std::string httpOperation;
-    nlohmann::json httpHeaders;
-    nlohmann::json jsonBody;
+    for (const auto& field : req.fields()) {
+      if (std::find(headerWhitelist.begin(), headerWhitelist.end(),
+                    field.name()) == headerWhitelist.end()) {
+        continue;
+      }
+      std::string header;
+      header.reserve(field.name_string().size() + 2 + field.value().size());
+      header += field.name_string();
+      header += ": ";
+      header += field.value();
+      httpHeaders.emplace_back(std::move(header));
+    }
+  }
+  Payload() = delete;
+
+  std::string targetUri;
+  std::string httpOperation;
+  nlohmann::json httpHeaders;
+  nlohmann::json jsonBody;
 };
 
-struct TaskData : std::enable_shared_from_this<TaskData>
-{
-  private:
-    TaskData(
-        std::function<bool(boost::system::error_code, sdbusplus::message_t&,
-                           const std::shared_ptr<TaskData>&)>&& handler,
-        const std::string& matchIn, size_t idx) :
-        callback(std::move(handler)),
-        matchStr(matchIn), index(idx),
+struct TaskData : std::enable_shared_from_this<TaskData> {
+ private:
+  TaskData(std::function<bool(boost::system::error_code, sdbusplus::message_t&,
+                              const std::shared_ptr<TaskData>&)>&& handler,
+           const std::string& matchIn, size_t idx)
+      : callback(std::move(handler)),
+        matchStr(matchIn),
+        index(idx),
         startTime(std::chrono::system_clock::to_time_t(
             std::chrono::system_clock::now())),
-        status("OK"), state("Running"), messages(nlohmann::json::array()),
+        status("OK"),
+        state("Running"),
+        messages(nlohmann::json::array()),
         timer(managedStore::GetManagedObjectStore()->GetIoContext())
 
-    {}
+  {}
 
-  public:
-    TaskData() = delete;
+ public:
+  TaskData() = delete;
 
-    static std::shared_ptr<TaskData>& createTask(
-        std::function<bool(boost::system::error_code, sdbusplus::message_t&,
-                           const std::shared_ptr<TaskData>&)>&& handler,
-        const std::string& match)
-    {
-        static size_t lastTask = 0;
-        struct MakeSharedHelper : public TaskData
-        {
-            MakeSharedHelper(
-                std::function<bool(boost::system::error_code,
-                                   sdbusplus::message_t&,
-                                   const std::shared_ptr<TaskData>&)>&& handler,
-                const std::string& match2, size_t idx) :
-                TaskData(std::move(handler), match2, idx)
-            {}
-        };
+  static std::shared_ptr<TaskData>& createTask(
+      std::function<bool(boost::system::error_code, sdbusplus::message_t&,
+                         const std::shared_ptr<TaskData>&)>&& handler,
+      const std::string& match) {
+    static size_t lastTask = 0;
+    struct MakeSharedHelper : public TaskData {
+      MakeSharedHelper(
+          std::function<bool(boost::system::error_code, sdbusplus::message_t&,
+                             const std::shared_ptr<TaskData>&)>&& handler,
+          const std::string& match2, size_t idx)
+          : TaskData(std::move(handler), match2, idx) {}
+    };
 
-        if (tasks.size() >= maxTaskCount)
-        {
-            const auto& last = tasks.front();
+    if (tasks.size() >= maxTaskCount) {
+      const auto& last = tasks.front();
 
-            // destroy all references
-            last->timer.cancel();
-            last->match.reset();
-            tasks.pop_front();
-        }
-
-        return tasks.emplace_back(std::make_shared<MakeSharedHelper>(
-            std::move(handler), match, lastTask++));
+      // destroy all references
+      last->timer.cancel();
+      last->match.reset();
+      tasks.pop_front();
     }
 
-    void populateResp(crow::Response& res, size_t retryAfterSeconds = 30)
-    {
-        if (!endTime)
-        {
-            res.result(boost::beast::http::status::accepted);
-            std::string strIdx = std::to_string(index);
-            std::string uri = "/redfish/v1/TaskService/Tasks/" + strIdx;
+    return tasks.emplace_back(std::make_shared<MakeSharedHelper>(
+        std::move(handler), match, lastTask++));
+  }
 
-            res.jsonValue["@odata.id"] = uri;
-            res.jsonValue["@odata.type"] = "#Task.v1_4_3.Task";
-            res.jsonValue["Id"] = strIdx;
-            res.jsonValue["TaskState"] = state;
-            res.jsonValue["TaskStatus"] = status;
+  void populateResp(crow::Response& res, size_t retryAfterSeconds = 30) {
+    if (!endTime) {
+      res.result(boost::beast::http::status::accepted);
+      std::string strIdx = std::to_string(index);
+      std::string uri = "/redfish/v1/TaskService/Tasks/" + strIdx;
 
-            res.addHeader(boost::beast::http::field::location,
-                          uri + "/Monitor");
-            res.addHeader(boost::beast::http::field::retry_after,
-                          std::to_string(retryAfterSeconds));
-        }
-        else if (!gaveResult)
-        {
-            if (result)
-            {
-                res.jsonValue = *result;
-            }
-            res.result(resultHttpStatus);
-            gaveResult = true;
-        }
+      res.jsonValue["@odata.id"] = uri;
+      res.jsonValue["@odata.type"] = "#Task.v1_4_3.Task";
+      res.jsonValue["Id"] = strIdx;
+      res.jsonValue["TaskState"] = state;
+      res.jsonValue["TaskStatus"] = status;
+
+      res.addHeader(boost::beast::http::field::location, uri + "/Monitor");
+      res.addHeader(boost::beast::http::field::retry_after,
+                    std::to_string(retryAfterSeconds));
+    } else if (!gaveResult) {
+      if (result) {
+        res.jsonValue = *result;
+      }
+      res.result(resultHttpStatus);
+      gaveResult = true;
     }
+  }
 
-    void finishTask()
-    {
-        endTime = std::chrono::system_clock::to_time_t(
-            std::chrono::system_clock::now());
+  void finishTask() {
+    endTime =
+        std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
+  }
+
+  void extendTimer(const std::chrono::seconds& timeout) {
+    timer.expires_after(timeout);
+    timer.async_wait([self = shared_from_this()](boost::system::error_code ec) {
+      if (ec == boost::asio::error::operation_aborted) {
+        return;  // completed successfully
+      }
+      if (!ec) {
+        // change ec to error as timer expired
+        ec = boost::asio::error::operation_aborted;
+      }
+      self->match.reset();
+      sdbusplus::message_t msg;
+      self->finishTask();
+      self->state = "Cancelled";
+      self->status = "Warning";
+      self->messages.emplace_back(
+          messages::taskAborted(std::to_string(self->index)));
+      // Send event :TaskAborted
+      self->sendTaskEvent(self->state, self->index);
+      self->callback(ec, msg, self);
+    });
+  }
+
+  static void sendTaskEvent(std::string_view state, size_t index) {
+    std::string origin =
+        "/redfish/v1/TaskService/Tasks/" + std::to_string(index);
+    std::string resType = "Task";
+    // TaskState enums which should send out an event are:
+    // "Starting" = taskResumed
+    // "Running" = taskStarted
+    // "Suspended" = taskPaused
+    // "Interrupted" = taskPaused
+    // "Pending" = taskPaused
+    // "Stopping" = taskAborted
+    // "Completed" = taskCompletedOK
+    // "Killed" = taskRemoved
+    // "Exception" = taskCompletedWarning
+    // "Cancelled" = taskCancelled
+    if (state == "Starting") {
+      redfish::EventServiceManager::getInstance().sendEvent(
+          redfish::messages::taskResumed(std::to_string(index)), origin,
+          resType);
+    } else if (state == "Running") {
+      redfish::EventServiceManager::getInstance().sendEvent(
+          redfish::messages::taskStarted(std::to_string(index)), origin,
+          resType);
+    } else if ((state == "Suspended") || (state == "Interrupted") ||
+               (state == "Pending")) {
+      redfish::EventServiceManager::getInstance().sendEvent(
+          redfish::messages::taskPaused(std::to_string(index)), origin,
+          resType);
+    } else if (state == "Stopping") {
+      redfish::EventServiceManager::getInstance().sendEvent(
+          redfish::messages::taskAborted(std::to_string(index)), origin,
+          resType);
+    } else if (state == "Completed") {
+      redfish::EventServiceManager::getInstance().sendEvent(
+          redfish::messages::taskCompletedOK(std::to_string(index)), origin,
+          resType);
+    } else if (state == "Killed") {
+      redfish::EventServiceManager::getInstance().sendEvent(
+          redfish::messages::taskRemoved(std::to_string(index)), origin,
+          resType);
+    } else if (state == "Exception") {
+      redfish::EventServiceManager::getInstance().sendEvent(
+          redfish::messages::taskCompletedWarning(std::to_string(index)),
+          origin, resType);
+    } else if (state == "Cancelled") {
+      redfish::EventServiceManager::getInstance().sendEvent(
+          redfish::messages::taskCancelled(std::to_string(index)), origin,
+          resType);
+    } else {
+      BMCWEB_LOG_INFO << "sendTaskEvent: No events to send";
     }
+  }
 
-    void extendTimer(const std::chrono::seconds& timeout)
-    {
-        timer.expires_after(timeout);
-        timer.async_wait(
-            [self = shared_from_this()](boost::system::error_code ec) {
-            if (ec == boost::asio::error::operation_aborted)
-            {
-                return; // completed successfully
-            }
-            if (!ec)
-            {
-                // change ec to error as timer expired
-                ec = boost::asio::error::operation_aborted;
-            }
-            self->match.reset();
-            sdbusplus::message_t msg;
-            self->finishTask();
-            self->state = "Cancelled";
-            self->status = "Warning";
-            self->messages.emplace_back(
-                messages::taskAborted(std::to_string(self->index)));
-            // Send event :TaskAborted
-            self->sendTaskEvent(self->state, self->index);
-            self->callback(ec, msg, self);
+  // Can be called manually by task handlers implementing asynchronous
+  // completion. They must also call stopMonitor().
+  void complete() {
+    timer.cancel();
+    finishTask();
+
+    // Send event
+    sendTaskEvent(state, index);
+  }
+
+  void complete(nlohmann::json&& outputResult,
+                boost::beast::http::status httpStatus) {
+    result = std::move(outputResult);
+    resultHttpStatus = httpStatus;
+    complete();
+  }
+
+  // Stop watching for property changes. Only required to be called by users
+  // when handling calling complete() manually too.
+  void stopMonitor() {
+    boost::asio::post(managedStore::GetManagedObjectStore()->GetIoContext(),
+                      [self = shared_from_this()] { self->match.reset(); });
+  }
+
+  void startTimer(const std::chrono::seconds& timeout) {
+    if (match) {
+      return;
+    }
+    match = std::make_unique<sdbusplus::bus::match_t>(
+        static_cast<sdbusplus::bus_t&>(
+            *(managedStore::GetManagedObjectStore()
+                  ->GetDeprecatedThreadUnsafeSystemBus())),
+        matchStr, [self = shared_from_this()](sdbusplus::message_t& message) {
+          boost::system::error_code ec;
+
+          // callback to return True if callback is done, callback needs
+          // to update status itself if needed
+          if (self->callback(ec, message, self) == task::completed) {
+            self->complete();
+            self->stopMonitor();
+          }
         });
-    }
 
-    static void sendTaskEvent(std::string_view state, size_t index)
-    {
-        std::string origin =
-            "/redfish/v1/TaskService/Tasks/" + std::to_string(index);
-        std::string resType = "Task";
-        // TaskState enums which should send out an event are:
-        // "Starting" = taskResumed
-        // "Running" = taskStarted
-        // "Suspended" = taskPaused
-        // "Interrupted" = taskPaused
-        // "Pending" = taskPaused
-        // "Stopping" = taskAborted
-        // "Completed" = taskCompletedOK
-        // "Killed" = taskRemoved
-        // "Exception" = taskCompletedWarning
-        // "Cancelled" = taskCancelled
-        if (state == "Starting")
-        {
-            redfish::EventServiceManager::getInstance().sendEvent(
-                redfish::messages::taskResumed(std::to_string(index)), origin,
-                resType);
-        }
-        else if (state == "Running")
-        {
-            redfish::EventServiceManager::getInstance().sendEvent(
-                redfish::messages::taskStarted(std::to_string(index)), origin,
-                resType);
-        }
-        else if ((state == "Suspended") || (state == "Interrupted") ||
-                 (state == "Pending"))
-        {
-            redfish::EventServiceManager::getInstance().sendEvent(
-                redfish::messages::taskPaused(std::to_string(index)), origin,
-                resType);
-        }
-        else if (state == "Stopping")
-        {
-            redfish::EventServiceManager::getInstance().sendEvent(
-                redfish::messages::taskAborted(std::to_string(index)), origin,
-                resType);
-        }
-        else if (state == "Completed")
-        {
-            redfish::EventServiceManager::getInstance().sendEvent(
-                redfish::messages::taskCompletedOK(std::to_string(index)),
-                origin, resType);
-        }
-        else if (state == "Killed")
-        {
-            redfish::EventServiceManager::getInstance().sendEvent(
-                redfish::messages::taskRemoved(std::to_string(index)), origin,
-                resType);
-        }
-        else if (state == "Exception")
-        {
-            redfish::EventServiceManager::getInstance().sendEvent(
-                redfish::messages::taskCompletedWarning(std::to_string(index)),
-                origin, resType);
-        }
-        else if (state == "Cancelled")
-        {
-            redfish::EventServiceManager::getInstance().sendEvent(
-                redfish::messages::taskCancelled(std::to_string(index)), origin,
-                resType);
-        }
-        else
-        {
-            BMCWEB_LOG_INFO << "sendTaskEvent: No events to send";
-        }
-    }
+    extendTimer(timeout);
+    messages.emplace_back(messages::taskStarted(std::to_string(index)));
+    // Send event : TaskStarted
+    sendTaskEvent(state, index);
+  }
 
-    // Can be called manually by task handlers implementing asynchronous
-    // completion. They must also call stopMonitor().
-    void complete()
-    {
-        timer.cancel();
-        finishTask();
-
-        // Send event
-        sendTaskEvent(state, index);
-    }
-
-    void complete(nlohmann::json&& outputResult,
-                  boost::beast::http::status httpStatus)
-    {
-        result = std::move(outputResult);
-        resultHttpStatus = httpStatus;
-        complete();
-    }
-
-    // Stop watching for property changes. Only required to be called by users
-    // when handling calling complete() manually too.
-    void stopMonitor()
-    {
-        boost::asio::post(
-            managedStore::GetManagedObjectStore()->GetIoContext(),
-            [self = shared_from_this()] { self->match.reset(); });
-    }
-
-    void startTimer(const std::chrono::seconds& timeout)
-    {
-        if (match)
-        {
-            return;
-        }
-        match = std::make_unique<sdbusplus::bus::match_t>(
-            static_cast<sdbusplus::bus_t&>(*(managedStore::GetManagedObjectStore()->GetDeprecatedThreadUnsafeSystemBus())),
-            matchStr,
-            [self = shared_from_this()](sdbusplus::message_t& message) {
-            boost::system::error_code ec;
-
-            // callback to return True if callback is done, callback needs
-            // to update status itself if needed
-            if (self->callback(ec, message, self) == task::completed)
-            {
-                self->complete();
-                self->stopMonitor();
-            }
-            });
-
-        extendTimer(timeout);
-        messages.emplace_back(messages::taskStarted(std::to_string(index)));
-        // Send event : TaskStarted
-        sendTaskEvent(state, index);
-    }
-
-    std::function<bool(boost::system::error_code, sdbusplus::message_t&,
-                       const std::shared_ptr<TaskData>&)>
-        callback;
-    std::string matchStr;
-    size_t index;
-    time_t startTime;
-    std::string status;
-    std::string state;
-    nlohmann::json messages;
-    boost::asio::steady_timer timer;
-    std::unique_ptr<sdbusplus::bus::match_t> match;
-    std::optional<time_t> endTime;
-    std::optional<Payload> payload;
-    std::optional<nlohmann::json> result;
-    boost::beast::http::status resultHttpStatus =
-        boost::beast::http::status::no_content;
-    bool gaveResult = false;
-    int percentComplete = 0;
+  std::function<bool(boost::system::error_code, sdbusplus::message_t&,
+                     const std::shared_ptr<TaskData>&)>
+      callback;
+  std::string matchStr;
+  size_t index;
+  time_t startTime;
+  std::string status;
+  std::string state;
+  nlohmann::json messages;
+  boost::asio::steady_timer timer;
+  std::unique_ptr<sdbusplus::bus::match_t> match;
+  std::optional<time_t> endTime;
+  std::optional<Payload> payload;
+  std::optional<nlohmann::json> result;
+  boost::beast::http::status resultHttpStatus =
+      boost::beast::http::status::no_content;
+  bool gaveResult = false;
+  int percentComplete = 0;
 };
 
-} // namespace task
+}  // namespace task
 
-inline void
-    handleGetTaskMonitor(App& app, const crow::Request& req,
-                         const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                         const std::string& strParam)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    auto find =
-        std::find_if(task::tasks.begin(), task::tasks.end(),
-                     [&strParam](const std::shared_ptr<task::TaskData>& task) {
-        if (!task)
-        {
-            return false;
-        }
+inline void handleGetTaskMonitor(
+    App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+    const std::string& strParam) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  auto find =
+      std::find_if(task::tasks.begin(), task::tasks.end(),
+                   [&strParam](const std::shared_ptr<task::TaskData>& task) {
+                     if (!task) {
+                       return false;
+                     }
 
-        // we compare against the string version as on failure
-        // strtoul returns 0
-        return std::to_string(task->index) == strParam;
-    });
+                     // we compare against the string version as on failure
+                     // strtoul returns 0
+                     return std::to_string(task->index) == strParam;
+                   });
 
-    if (find == task::tasks.end())
-    {
-        messages::resourceNotFound(asyncResp->res, "Task", strParam);
-        return;
-    }
-    std::shared_ptr<task::TaskData>& ptr = *find;
-    // monitor expires after result
-    if (ptr->gaveResult)
-    {
-        messages::resourceNotFound(asyncResp->res, "Task", strParam);
-        return;
-    }
-    ptr->populateResp(asyncResp->res);
+  if (find == task::tasks.end()) {
+    messages::resourceNotFound(asyncResp->res, "Task", strParam);
+    return;
+  }
+  std::shared_ptr<task::TaskData>& ptr = *find;
+  // monitor expires after result
+  if (ptr->gaveResult) {
+    messages::resourceNotFound(asyncResp->res, "Task", strParam);
+    return;
+  }
+  ptr->populateResp(asyncResp->res);
 }
 
-inline void requestRoutesTaskMonitor(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/TaskService/Tasks/<str>/Monitor/")
-        .privileges(redfish::privileges::getTask)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetTaskMonitor, std::ref(app)));
+inline void requestRoutesTaskMonitor(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/TaskService/Tasks/<str>/Monitor/")
+      .privileges(redfish::privileges::getTask)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetTaskMonitor, std::ref(app)));
 }
 
 inline void handleGetTask(App& app, const crow::Request& req,
                           const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                          const std::string& strParam)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    auto find =
-        std::find_if(task::tasks.begin(), task::tasks.end(),
-                     [&strParam](const std::shared_ptr<task::TaskData>& task) {
-        if (!task)
-        {
-            return false;
-        }
+                          const std::string& strParam) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  auto find =
+      std::find_if(task::tasks.begin(), task::tasks.end(),
+                   [&strParam](const std::shared_ptr<task::TaskData>& task) {
+                     if (!task) {
+                       return false;
+                     }
 
-        // we compare against the string version as on failure
-        // strtoul returns 0
-        return std::to_string(task->index) == strParam;
-    });
+                     // we compare against the string version as on failure
+                     // strtoul returns 0
+                     return std::to_string(task->index) == strParam;
+                   });
 
-    if (find == task::tasks.end())
-    {
-        messages::resourceNotFound(asyncResp->res, "Task", strParam);
-        return;
-    }
+  if (find == task::tasks.end()) {
+    messages::resourceNotFound(asyncResp->res, "Task", strParam);
+    return;
+  }
 
-    const std::shared_ptr<task::TaskData>& ptr = *find;
+  const std::shared_ptr<task::TaskData>& ptr = *find;
 
-    asyncResp->res.jsonValue["@odata.type"] = "#Task.v1_4_3.Task";
-    asyncResp->res.jsonValue["Id"] = strParam;
-    asyncResp->res.jsonValue["Name"] = "Task " + strParam;
-    asyncResp->res.jsonValue["TaskState"] = ptr->state;
-    asyncResp->res.jsonValue["StartTime"] =
-        redfish::time_utils::getDateTimeStdtime(ptr->startTime);
-    if (ptr->endTime)
-    {
-        asyncResp->res.jsonValue["EndTime"] =
-            redfish::time_utils::getDateTimeStdtime(*(ptr->endTime));
-    }
-    asyncResp->res.jsonValue["TaskStatus"] = ptr->status;
-    asyncResp->res.jsonValue["Messages"] = ptr->messages;
-    asyncResp->res.jsonValue["@odata.id"] = crow::utility::urlFromPieces(
-        "redfish", "v1", "TaskService", "Tasks", strParam);
-    if (!ptr->gaveResult)
-    {
-        asyncResp->res.jsonValue["TaskMonitor"] =
-            "/redfish/v1/TaskService/Tasks/" + strParam + "/Monitor";
-    }
-    if (ptr->payload)
-    {
-        const task::Payload& p = *(ptr->payload);
-        asyncResp->res.jsonValue["Payload"]["TargetUri"] = p.targetUri;
-        asyncResp->res.jsonValue["Payload"]["HttpOperation"] = p.httpOperation;
-        asyncResp->res.jsonValue["Payload"]["HttpHeaders"] = p.httpHeaders;
-        asyncResp->res.jsonValue["Payload"]["JsonBody"] = p.jsonBody.dump(
-            2, ' ', true, nlohmann::json::error_handler_t::replace);
-    }
-    asyncResp->res.jsonValue["PercentComplete"] = ptr->percentComplete;
+  asyncResp->res.jsonValue["@odata.type"] = "#Task.v1_4_3.Task";
+  asyncResp->res.jsonValue["Id"] = strParam;
+  asyncResp->res.jsonValue["Name"] = "Task " + strParam;
+  asyncResp->res.jsonValue["TaskState"] = ptr->state;
+  asyncResp->res.jsonValue["StartTime"] =
+      redfish::time_utils::getDateTimeStdtime(ptr->startTime);
+  if (ptr->endTime) {
+    asyncResp->res.jsonValue["EndTime"] =
+        redfish::time_utils::getDateTimeStdtime(*(ptr->endTime));
+  }
+  asyncResp->res.jsonValue["TaskStatus"] = ptr->status;
+  asyncResp->res.jsonValue["Messages"] = ptr->messages;
+  asyncResp->res.jsonValue["@odata.id"] = crow::utility::urlFromPieces(
+      "redfish", "v1", "TaskService", "Tasks", strParam);
+  if (!ptr->gaveResult) {
+    asyncResp->res.jsonValue["TaskMonitor"] =
+        "/redfish/v1/TaskService/Tasks/" + strParam + "/Monitor";
+  }
+  if (ptr->payload) {
+    const task::Payload& p = *(ptr->payload);
+    asyncResp->res.jsonValue["Payload"]["TargetUri"] = p.targetUri;
+    asyncResp->res.jsonValue["Payload"]["HttpOperation"] = p.httpOperation;
+    asyncResp->res.jsonValue["Payload"]["HttpHeaders"] = p.httpHeaders;
+    asyncResp->res.jsonValue["Payload"]["JsonBody"] =
+        p.jsonBody.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
+  }
+  asyncResp->res.jsonValue["PercentComplete"] = ptr->percentComplete;
 }
 
-inline void requestRoutesTask(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/TaskService/Tasks/<str>/")
-        .privileges(redfish::privileges::getTask)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetTask, std::ref(app)));
+inline void requestRoutesTask(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/TaskService/Tasks/<str>/")
+      .privileges(redfish::privileges::getTask)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetTask, std::ref(app)));
 }
 
-inline void
-    handleGetTaskCollection(App& app, const crow::Request& req,
-                            const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    asyncResp->res.jsonValue["@odata.type"] = "#TaskCollection.TaskCollection";
-    asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/TaskService/Tasks";
-    asyncResp->res.jsonValue["Name"] = "Task Collection";
-    nlohmann::json& members = asyncResp->res.jsonValue["Members"];
-    if (!members.is_array())
-    {
-        // With Redfish aggregation, top level collections can have their
-        // Members array already created if a satellite response has been
-        // processed first.  In that case we don't want to clobber the
-        // aggregated data
-        members = nlohmann::json::array();
-    }
+inline void handleGetTaskCollection(
+    App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  asyncResp->res.jsonValue["@odata.type"] = "#TaskCollection.TaskCollection";
+  asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/TaskService/Tasks";
+  asyncResp->res.jsonValue["Name"] = "Task Collection";
+  nlohmann::json& members = asyncResp->res.jsonValue["Members"];
+  if (!members.is_array()) {
+    // With Redfish aggregation, top level collections can have their
+    // Members array already created if a satellite response has been
+    // processed first.  In that case we don't want to clobber the
+    // aggregated data
+    members = nlohmann::json::array();
+  }
 
-    for (const std::shared_ptr<task::TaskData>& task : task::tasks)
-    {
-        if (task == nullptr)
-        {
-            continue; // shouldn't be possible
-        }
-        nlohmann::json::object_t member;
-        member["@odata.id"] =
-            crow::utility::urlFromPieces("redfish", "v1", "TaskService",
-                                         "Tasks", std::to_string(task->index));
-        members.emplace_back(std::move(member));
+  for (const std::shared_ptr<task::TaskData>& task : task::tasks) {
+    if (task == nullptr) {
+      continue;  // shouldn't be possible
     }
-    asyncResp->res.jsonValue["Members@odata.count"] = members.size();
+    nlohmann::json::object_t member;
+    member["@odata.id"] = crow::utility::urlFromPieces(
+        "redfish", "v1", "TaskService", "Tasks", std::to_string(task->index));
+    members.emplace_back(std::move(member));
+  }
+  asyncResp->res.jsonValue["Members@odata.count"] = members.size();
 }
 
-inline void requestRoutesTaskCollection(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/TaskService/Tasks/")
-        .privileges(redfish::privileges::getTaskCollection)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetTaskCollection, std::ref(app)));
+inline void requestRoutesTaskCollection(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/TaskService/Tasks/")
+      .privileges(redfish::privileges::getTaskCollection)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetTaskCollection, std::ref(app)));
 }
 
-inline void
-    handleGetTaskService(App& app, const crow::Request& req,
-                         const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
-{
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
-    asyncResp->res.jsonValue["@odata.type"] = "#TaskService.v1_1_4.TaskService";
-    asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/TaskService";
-    asyncResp->res.jsonValue["Name"] = "Task Service";
-    asyncResp->res.jsonValue["Id"] = "TaskService";
-    asyncResp->res.jsonValue["DateTime"] =
-        redfish::time_utils::getDateTimeOffsetNow().first;
-    asyncResp->res.jsonValue["CompletedTaskOverWritePolicy"] = "Oldest";
+inline void handleGetTaskService(
+    App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
+  if (!redfish::setUpRedfishRoute(app, req, asyncResp)) {
+    return;
+  }
+  asyncResp->res.jsonValue["@odata.type"] = "#TaskService.v1_1_4.TaskService";
+  asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/TaskService";
+  asyncResp->res.jsonValue["Name"] = "Task Service";
+  asyncResp->res.jsonValue["Id"] = "TaskService";
+  asyncResp->res.jsonValue["DateTime"] =
+      redfish::time_utils::getDateTimeOffsetNow().first;
+  asyncResp->res.jsonValue["CompletedTaskOverWritePolicy"] = "Oldest";
 
-    asyncResp->res.jsonValue["LifeCycleEventOnTaskStateChange"] = true;
+  asyncResp->res.jsonValue["LifeCycleEventOnTaskStateChange"] = true;
 
 #ifdef HEALTH_POPULATE
-    auto health = std::make_shared<HealthPopulate>(asyncResp);
-    health->populate();
+  auto health = std::make_shared<HealthPopulate>(asyncResp);
+  health->populate();
 #endif
-    asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
-    asyncResp->res.jsonValue["ServiceEnabled"] = true;
-    asyncResp->res.jsonValue["Tasks"]["@odata.id"] =
-        "/redfish/v1/TaskService/Tasks";
+  asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
+  asyncResp->res.jsonValue["ServiceEnabled"] = true;
+  asyncResp->res.jsonValue["Tasks"]["@odata.id"] =
+      "/redfish/v1/TaskService/Tasks";
 }
 
-inline void requestRoutesTaskService(App& app)
-{
-    BMCWEB_ROUTE(app, "/redfish/v1/TaskService/")
-        .privileges(redfish::privileges::getTaskService)
-        .methods(boost::beast::http::verb::get)(
-            std::bind_front(handleGetTaskService, std::ref(app)));
+inline void requestRoutesTaskService(App& app) {
+  BMCWEB_ROUTE(app, "/redfish/v1/TaskService/")
+      .privileges(redfish::privileges::getTaskService)
+      .methods(boost::beast::http::verb::get)(
+          std::bind_front(handleGetTaskService, std::ref(app)));
 }
 
-} // namespace redfish
+}  // namespace redfish
+
+#endif  // THIRD_PARTY_GBMCWEB_REDFISH_CORE_LIB_TASK_H_