Remove Redfish Node class

Reduces the total number of lines and will allow for easier testing of
the redfish responses.

A main purpose of the node class was to set app.routeDynamic(). However
now app.routeDynamic can handle the complexity that was once in critical
to node. The macro app.routeDynamic() provides a shorter cleaner
interface to the unerlying app.routeDyanic call. The old pattern set
permissions for 6 interfaces (get, head, patch, put, delete_, and post)
even if only one interface is created. That pattern creates unneeded
code that can be safely removed with no effect.
Unit test for the responses would have to mock the node the class in
order to fully test responses.

see https://github.com/openbmc/bmcweb/issues/181

The following files still need node to be extracted.

virtual_media.hpp
account_service.hpp
redfish_sessions.hpp
ethernet.hpp

The files above use a pattern that is not trivial to address. Often their
responses call an async lambda capturing the inherited class. ie
(https://github.com/openbmc/bmcweb/blob/ffed87b5ad1797ca966d030e7f979770
28d258fa/redfish-core/lib/account_service.hpp#L1393)
At a later point I plan to remove node from the files above.

Tested:
I ran the docker unit test with the following command.
WORKSPACE=$(pwd) UNIT_TEST_PKG=bmcweb
 ./openbmc-build-scripts/run-unit-test-docker.sh

I ran the validator and this change did not create any issues.
python3 RedfishServiceValidator.py -c config.ini

Signed-off-by: John Edward Broadbent <jebr@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I147a0289c52cb4198345b1ad9bfe6fdddf57f3df
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
index db58d60..7429b77 100644
--- a/redfish-core/include/redfish.hpp
+++ b/redfish-core/include/redfish.hpp
@@ -67,96 +67,94 @@
         nodes.emplace_back(std::make_unique<AccountsCollection>(app));
         nodes.emplace_back(std::make_unique<ManagerAccount>(app));
         nodes.emplace_back(std::make_unique<SessionCollection>(app));
-        nodes.emplace_back(std::make_unique<Roles>(app));
-        nodes.emplace_back(std::make_unique<RoleCollection>(app));
-        nodes.emplace_back(std::make_unique<ServiceRoot>(app));
-        nodes.emplace_back(std::make_unique<NetworkProtocol>(app));
+        requestRoutesRoles(app);
+        requestRoutesRoleCollection(app);
+        requestRoutesServiceRoot(app);
+        requestRoutesNetworkProtocol(app);
         nodes.emplace_back(std::make_unique<SessionService>(app));
         nodes.emplace_back(std::make_unique<EthernetCollection>(app));
         nodes.emplace_back(std::make_unique<EthernetInterface>(app));
-        nodes.emplace_back(std::make_unique<Thermal>(app));
-        nodes.emplace_back(std::make_unique<ManagerCollection>(app));
-        nodes.emplace_back(std::make_unique<Manager>(app));
-        nodes.emplace_back(std::make_unique<ManagerResetAction>(app));
-        nodes.emplace_back(std::make_unique<ManagerResetActionInfo>(app));
-        nodes.emplace_back(std::make_unique<ManagerResetToDefaultsAction>(app));
-        nodes.emplace_back(std::make_unique<Power>(app));
-        nodes.emplace_back(std::make_unique<ChassisCollection>(app));
-        nodes.emplace_back(std::make_unique<Chassis>(app));
-        nodes.emplace_back(std::make_unique<ChassisResetAction>(app));
-        nodes.emplace_back(std::make_unique<ChassisResetActionInfo>(app));
-        nodes.emplace_back(std::make_unique<UpdateService>(app));
-        nodes.emplace_back(std::make_unique<StorageCollection>(app));
-        nodes.emplace_back(std::make_unique<Storage>(app));
-        nodes.emplace_back(std::make_unique<Drive>(app));
+        requestRoutesThermal(app);
+        requestRoutesManagerCollection(app);
+        requestRoutesManager(app);
+        requestRoutesManagerResetAction(app);
+        requestRoutesManagerResetActionInfo(app);
+        requestRoutesManagerResetToDefaultsAction(app);
+        requestRoutesPower(app);
+        requestRoutesChassisCollection(app);
+        requestRoutesChassis(app);
+        requestRoutesChassisResetAction(app);
+        requestRoutesChassisResetActionInfo(app);
+        requestRoutesUpdateService(app);
+        requestRoutesStorageCollection(app);
+        requestRoutesStorage(app);
+        requestRoutesDrive(app);
 #ifdef BMCWEB_INSECURE_ENABLE_REDFISH_FW_TFTP_UPDATE
-        nodes.emplace_back(
-            std::make_unique<UpdateServiceActionsSimpleUpdate>(app));
+        requestRoutesUpdateServiceActionsSimpleUpdate(app);
 #endif
-        nodes.emplace_back(std::make_unique<SoftwareInventoryCollection>(app));
-        nodes.emplace_back(std::make_unique<SoftwareInventory>(app));
+        requestRoutesSoftwareInventoryCollection(app);
+        requestRoutesSoftwareInventory(app);
         nodes.emplace_back(
             std::make_unique<VlanNetworkInterfaceCollection>(app));
         nodes.emplace_back(std::make_unique<VlanNetworkInterface>(app));
 
-        nodes.emplace_back(std::make_unique<SystemLogServiceCollection>(app));
-        nodes.emplace_back(std::make_unique<EventLogService>(app));
+        requestRoutesSystemLogServiceCollection(app);
+        requestRoutesEventLogService(app);
 
-        nodes.emplace_back(std::make_unique<PostCodesLogService>(app));
-        nodes.emplace_back(std::make_unique<PostCodesClear>(app));
-        nodes.emplace_back(std::make_unique<PostCodesEntry>(app));
-        nodes.emplace_back(std::make_unique<PostCodesEntryCollection>(app));
+        requestRoutesPostCodesLogService(app);
+        requestRoutesPostCodesClear(app);
+        requestRoutesPostCodesEntry(app);
+        requestRoutesPostCodesEntryCollection(app);
 
 #ifdef BMCWEB_ENABLE_REDFISH_DUMP_LOG
-        nodes.emplace_back(std::make_unique<SystemDumpService>(app));
-        nodes.emplace_back(std::make_unique<SystemDumpEntryCollection>(app));
-        nodes.emplace_back(std::make_unique<SystemDumpEntry>(app));
-        nodes.emplace_back(std::make_unique<SystemDumpCreate>(app));
-        nodes.emplace_back(std::make_unique<SystemDumpClear>(app));
+        requestRoutesSystemDumpService(app);
+        requestRoutesSystemDumpEntryCollection(app);
+        requestRoutesSystemDumpEntry(app);
+        requestRoutesSystemDumpCreate(app);
+        requestRoutesSystemDumpClear(app);
 
-        nodes.emplace_back(std::make_unique<BMCDumpService>(app));
-        nodes.emplace_back(std::make_unique<BMCDumpEntryCollection>(app));
-        nodes.emplace_back(std::make_unique<BMCDumpEntry>(app));
-        nodes.emplace_back(std::make_unique<BMCDumpCreate>(app));
-        nodes.emplace_back(std::make_unique<BMCDumpClear>(app));
+        requestRoutesBMCDumpService(app);
+        requestRoutesBMCDumpEntryCollection(app);
+        requestRoutesBMCDumpEntry(app);
+        requestRoutesBMCDumpCreate(app);
+        requestRoutesBMCDumpClear(app);
 #endif
 
 #ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
-        nodes.emplace_back(
-            std::make_unique<JournalEventLogEntryCollection>(app));
-        nodes.emplace_back(std::make_unique<JournalEventLogEntry>(app));
-        nodes.emplace_back(std::make_unique<JournalEventLogClear>(app));
+        requestRoutesJournalEventLogEntryCollection(app);
+        requestRoutesJournalEventLogEntry(app);
+        requestRoutesJournalEventLogClear(app);
 #endif
 
-        nodes.emplace_back(std::make_unique<BMCLogServiceCollection>(app));
+        requestRoutesBMCLogServiceCollection(app);
 #ifdef BMCWEB_ENABLE_REDFISH_BMC_JOURNAL
-        nodes.emplace_back(std::make_unique<BMCJournalLogService>(app));
-        nodes.emplace_back(std::make_unique<BMCJournalLogEntryCollection>(app));
-        nodes.emplace_back(std::make_unique<BMCJournalLogEntry>(app));
+        requestRoutesBMCJournalLogService(app);
+        requestRoutesBMCJournalLogEntryCollection(app);
+        requestRoutesBMCJournalLogEntry(app);
 #endif
 
 #ifdef BMCWEB_ENABLE_REDFISH_CPU_LOG
-        nodes.emplace_back(std::make_unique<CrashdumpService>(app));
-        nodes.emplace_back(std::make_unique<CrashdumpEntryCollection>(app));
-        nodes.emplace_back(std::make_unique<CrashdumpEntry>(app));
-        nodes.emplace_back(std::make_unique<CrashdumpFile>(app));
-        nodes.emplace_back(std::make_unique<CrashdumpClear>(app));
-        nodes.emplace_back(std::make_unique<CrashdumpCollect>(app));
+        requestRoutesCrashdumpService(app);
+        requestRoutesCrashdumpEntryCollection(app);
+        requestRoutesCrashdumpEntry(app);
+        requestRoutesCrashdumpFile(app);
+        requestRoutesCrashdumpClear(app);
+        requestRoutesCrashdumpCollect(app);
 #endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
 
-        nodes.emplace_back(std::make_unique<ProcessorCollection>(app));
-        nodes.emplace_back(std::make_unique<Processor>(app));
-        nodes.emplace_back(std::make_unique<OperatingConfigCollection>(app));
-        nodes.emplace_back(std::make_unique<OperatingConfig>(app));
-        nodes.emplace_back(std::make_unique<MemoryCollection>(app));
-        nodes.emplace_back(std::make_unique<Memory>(app));
+        requestRoutesProcessorCollection(app);
+        requestRoutesProcessor(app);
+        requestRoutesOperatingConfigCollection(app);
+        requestRoutesOperatingConfig(app);
+        requestRoutesMemoryCollection(app);
+        requestRoutesMemory(app);
 
-        nodes.emplace_back(std::make_unique<SystemsCollection>(app));
-        nodes.emplace_back(std::make_unique<Systems>(app));
-        nodes.emplace_back(std::make_unique<SystemActionsReset>(app));
-        nodes.emplace_back(std::make_unique<SystemResetActionInfo>(app));
-        nodes.emplace_back(std::make_unique<BiosService>(app));
-        nodes.emplace_back(std::make_unique<BiosReset>(app));
+        requestRoutesSystemsCollection(app);
+        requestRoutesSystems(app);
+        requestRoutesSystemActionsReset(app);
+        requestRoutesSystemResetActionInfo(app);
+        requestRoutesBiosService(app);
+        requestRoutesBiosReset(app);
 #ifdef BMCWEB_ENABLE_VM_NBDPROXY
         nodes.emplace_back(std::make_unique<VirtualMedia>(app));
         nodes.emplace_back(std::make_unique<VirtualMediaCollection>(app));
@@ -165,58 +163,51 @@
         nodes.emplace_back(std::make_unique<VirtualMediaActionEjectMedia>(app));
 #endif // BMCWEB_ENABLE_VM_NBDPROXY
 #ifdef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
-        nodes.emplace_back(std::make_unique<DBusLogServiceActionsClear>(app));
-        nodes.emplace_back(std::make_unique<DBusEventLogEntryCollection>(app));
-        nodes.emplace_back(std::make_unique<DBusEventLogEntry>(app));
-        nodes.emplace_back(std::make_unique<DBusEventLogEntryDownload>(app));
+        requestRoutesDBusLogServiceActionsClear(app);
+        requestRoutesDBusEventLogEntryCollection(app);
+        requestRoutesDBusEventLogEntry(app);
+        requestRoutesDBusEventLogEntryDownload(app);
 #endif
 
-        nodes.emplace_back(
-            std::make_unique<MessageRegistryFileCollection>(app));
-        nodes.emplace_back(std::make_unique<MessageRegistryFile>(app));
-        nodes.emplace_back(std::make_unique<MessageRegistry>(app));
-        nodes.emplace_back(std::make_unique<CertificateService>(app));
-        nodes.emplace_back(
-            std::make_unique<CertificateActionsReplaceCertificate>(app));
-        nodes.emplace_back(std::make_unique<CertificateLocations>(app));
-        nodes.emplace_back(std::make_unique<HTTPSCertificateCollection>(app));
-        nodes.emplace_back(std::make_unique<HTTPSCertificate>(app));
-        nodes.emplace_back(std::make_unique<LDAPCertificateCollection>(app));
-        nodes.emplace_back(std::make_unique<LDAPCertificate>(app));
-        nodes.emplace_back(std::make_unique<CertificateActionGenerateCSR>(app));
-        nodes.emplace_back(
-            std::make_unique<TrustStoreCertificateCollection>(app));
-        nodes.emplace_back(std::make_unique<TrustStoreCertificate>(app));
-        nodes.emplace_back(std::make_unique<SystemPCIeFunctionCollection>(app));
-        nodes.emplace_back(std::make_unique<SystemPCIeFunction>(app));
-        nodes.emplace_back(std::make_unique<SystemPCIeDeviceCollection>(app));
-        nodes.emplace_back(std::make_unique<SystemPCIeDevice>(app));
+        requestRoutesMessageRegistryFileCollection(app);
+        requestRoutesMessageRegistryFile(app);
+        requestRoutesMessageRegistry(app);
 
-        nodes.emplace_back(std::make_unique<SensorCollection>(app));
-        nodes.emplace_back(std::make_unique<Sensor>(app));
+        requestRoutesCertificateService(app);
+        requestRoutesCertificateActionGenerateCSR(app);
+        requestRoutesCertificateActionsReplaceCertificate(app);
+        requestRoutesHTTPSCertificate(app);
+        requestRoutesHTTPSCertificateCollection(app);
+        requestRoutesCertificateLocations(app);
+        requestRoutesLDAPCertificateCollection(app);
+        requestRoutesLDAPCertificate(app);
+        requestRoutesTrustStoreCertificateCollection(app);
+        requestRoutesTrustStoreCertificate(app);
 
-        nodes.emplace_back(std::make_unique<TaskMonitor>(app));
-        nodes.emplace_back(std::make_unique<TaskService>(app));
-        nodes.emplace_back(std::make_unique<TaskCollection>(app));
-        nodes.emplace_back(std::make_unique<Task>(app));
-        nodes.emplace_back(std::make_unique<EventService>(app));
-        nodes.emplace_back(std::make_unique<EventDestinationCollection>(app));
-        nodes.emplace_back(std::make_unique<EventDestination>(app));
-        nodes.emplace_back(std::make_unique<SubmitTestEvent>(app));
+        requestRoutesSystemPCIeFunctionCollection(app);
+        requestRoutesSystemPCIeFunction(app);
+        requestRoutesSystemPCIeDeviceCollection(app);
+        requestRoutesSystemPCIeDevice(app);
 
-        nodes.emplace_back(
-            std::make_unique<HypervisorInterfaceCollection>(app));
-        nodes.emplace_back(std::make_unique<HypervisorInterface>(app));
-        nodes.emplace_back(std::make_unique<HypervisorSystem>(app));
-        nodes.emplace_back(std::make_unique<HypervisorActionsReset>(app));
-        nodes.emplace_back(std::make_unique<HypervisorResetActionInfo>(app));
+        requestRoutesSensorCollection(app);
+        requestRoutesSensor(app);
 
-        nodes.emplace_back(std::make_unique<TelemetryService>(app));
-        nodes.emplace_back(
-            std::make_unique<MetricReportDefinitionCollection>(app));
-        nodes.emplace_back(std::make_unique<MetricReportDefinition>(app));
-        nodes.emplace_back(std::make_unique<MetricReportCollection>(app));
-        nodes.emplace_back(std::make_unique<MetricReport>(app));
+        requestRoutesTaskMonitor(app);
+        requestRoutesTaskService(app);
+        requestRoutesTaskCollection(app);
+        requestRoutesTask(app);
+        requestRoutesEventService(app);
+        requestRoutesEventDestinationCollection(app);
+        requestRoutesEventDestination(app);
+        requestRoutesSubmitTestEvent(app);
+
+        requestRoutesHypervisorSystems(app);
+
+        requestRoutesTelemetryService(app);
+        requestRoutesMetricReportDefinitionCollection(app);
+        requestRoutesMetricReportDefinition(app);
+        requestRoutesMetricReportCollection(app);
+        requestRoutesMetricReport(app);
 
         for (const auto& node : nodes)
         {