log_services: Remove raw PECI command

The raw PECI command is recommended not to include in a standard
build, so removing it from the bmcweb to avoid accidental
inclusion.

Tested:
Confirmed that the raw PECI command is gone.

Change-Id: I2b52e0ede089da6df6ca3ad304194de8af27b709
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/meson.build b/meson.build
index 22a8c4a..7145ce5 100644
--- a/meson.build
+++ b/meson.build
@@ -74,7 +74,6 @@
 'redfish-cpu-log'                 : '-DBMCWEB_ENABLE_REDFISH_CPU_LOG',
 'redfish-dbus-log'                : '-DBMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES',
 'redfish-provisioning-feature'    : '-DBMCWEB_ENABLE_REDFISH_PROVISIONING_FEATURE',
-'redfish-raw-peci'                : '-DBMCWEB_ENABLE_REDFISH_RAW_PECI',
 'redfish-dump-log'                : '-DBMCWEB_ENABLE_REDFISH_DUMP_LOG',
 'rest'                            : '-DBMCWEB_ENABLE_DBUS_REST',
 'insecure-sensor-override'        : '-DBMCWEB_INSECURE_UNRESTRICTED_SENSOR_OVERRIDE',
diff --git a/meson_options.txt b/meson_options.txt
index 9611631..67bc828 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -16,7 +16,6 @@
 option('host-serial-socket', type : 'feature', value : 'enabled', description : 'Enable host serial console WebSocket. Path is \'/console0\'.  See https://github.com/openbmc/docs/blob/master/console.md.')
 option('static-hosting', type : 'feature', value : 'enabled', description : 'Enable serving files from the \'/usr/share/www\' directory as paths under \'/\'.')
 option('redfish-bmc-journal', type : 'feature', value : 'disabled', description : 'Enable BMC journal access through Redfish. Paths are under \'/redfish/v1/Managers/bmc/LogServices/Journal\'.')
-option('redfish-raw-peci', type : 'feature', value : 'disabled', description : '''Enable PECI transactions through Redfish. Paths are under \/redfish/v1/Systems/system/LogServices/CpuLog/Actions/Oem/CpuLog.SendRawPeci\'.''')
 option('redfish-cpu-log', type : 'feature', value : 'disabled', description : '''Enable CPU log service transactions through Redfish. Paths are under \'/redfish/v1/Systems/system/LogServices/Crashdump'.''')
 option('redfish-dump-log', type : 'feature', value : 'disabled', description : 'Enable Dump log service transactions through Redfish. Paths are under \'/redfish/v1/Systems/system/LogServices/Dump\'and \'/redfish/v1/Managers/bmc/LogServices/Dump\'')
 option('redfish-dbus-log', type : 'feature', value : 'disabled', description : 'Enable DBUS log service transactions through Redfish. Paths are under \'/redfish/v1/Systems/system/LogServices/EventLog/Entries\'')
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
index 9c76c5d..db58d60 100644
--- a/redfish-core/include/redfish.hpp
+++ b/redfish-core/include/redfish.hpp
@@ -142,9 +142,6 @@
         nodes.emplace_back(std::make_unique<CrashdumpFile>(app));
         nodes.emplace_back(std::make_unique<CrashdumpClear>(app));
         nodes.emplace_back(std::make_unique<CrashdumpCollect>(app));
-#ifdef BMCWEB_ENABLE_REDFISH_RAW_PECI
-        nodes.emplace_back(std::make_unique<SendRawPECI>(app));
-#endif // BMCWEB_ENABLE_REDFISH_RAW_PECI
 #endif // BMCWEB_ENABLE_REDFISH_CPU_LOG
 
         nodes.emplace_back(std::make_unique<ProcessorCollection>(app));
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 2a52830..7614ec0 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -47,8 +47,6 @@
     "xyz.openbmc_project.Collection.DeleteAll";
 constexpr char const* crashdumpOnDemandInterface =
     "com.intel.crashdump.OnDemand";
-constexpr char const* crashdumpRawPECIInterface =
-    "com.intel.crashdump.SendRawPeci";
 constexpr char const* crashdumpTelemetryInterface =
     "com.intel.crashdump.Telemetry";
 
@@ -2601,13 +2599,6 @@
             {"#LogService.CollectDiagnosticData",
              {{"target", "/redfish/v1/Systems/system/LogServices/Crashdump/"
                          "Actions/LogService.CollectDiagnosticData"}}}};
-
-#ifdef BMCWEB_ENABLE_REDFISH_RAW_PECI
-        asyncResp->res.jsonValue["Actions"]["Oem"] = {
-            {"#Crashdump.SendRawPeci",
-             {{"target", "/redfish/v1/Systems/system/LogServices/Crashdump/"
-                         "Actions/Oem/Crashdump.SendRawPeci"}}}};
-#endif
     }
 };
 
@@ -3037,79 +3028,6 @@
     }
 };
 
-class SendRawPECI : public Node
-{
-  public:
-    SendRawPECI(App& app) :
-        Node(app,
-             "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/Oem/"
-             "Crashdump.SendRawPeci/")
-    {
-        // Note: Deviated from redfish privilege registry for GET & HEAD
-        // method for security reasons.
-        entityPrivileges = {
-            {boost::beast::http::verb::get, {{"ConfigureComponents"}}},
-            {boost::beast::http::verb::head, {{"ConfigureComponents"}}},
-            {boost::beast::http::verb::patch, {{"ConfigureComponents"}}},
-            {boost::beast::http::verb::put, {{"ConfigureComponents"}}},
-            {boost::beast::http::verb::delete_, {{"ConfigureComponents"}}},
-            {boost::beast::http::verb::post, {{"ConfigureComponents"}}}};
-    }
-
-  private:
-    void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>&) override
-    {
-        std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
-        std::vector<std::vector<uint8_t>> peciCommands;
-
-        if (!json_util::readJson(req, res, "PECICommands", peciCommands))
-        {
-            return;
-        }
-        uint32_t idx = 0;
-        for (auto const& cmd : peciCommands)
-        {
-            if (cmd.size() < 3)
-            {
-                std::string s("[");
-                for (auto const& val : cmd)
-                {
-                    if (val != *cmd.begin())
-                    {
-                        s += ",";
-                    }
-                    s += std::to_string(val);
-                }
-                s += "]";
-                messages::actionParameterValueFormatError(
-                    res, s, "PECICommands[" + std::to_string(idx) + "]",
-                    "SendRawPeci");
-                return;
-            }
-            idx++;
-        }
-        // Callback to return the Raw PECI response
-        auto sendRawPECICallback =
-            [asyncResp](const boost::system::error_code ec,
-                        const std::vector<std::vector<uint8_t>>& resp) {
-                if (ec)
-                {
-                    BMCWEB_LOG_DEBUG << "failed to process PECI commands ec: "
-                                     << ec.message();
-                    messages::internalError(asyncResp->res);
-                    return;
-                }
-                asyncResp->res.jsonValue = {{"Name", "PECI Command Response"},
-                                            {"PECIResponse", resp}};
-            };
-        // Call the SendRawPECI command with the provided data
-        crow::connections::systemBus->async_method_call(
-            std::move(sendRawPECICallback), crashdumpObject, crashdumpPath,
-            crashdumpRawPECIInterface, "SendRawPeci", peciCommands);
-    }
-};
-
 /**
  * DBusLogServiceActionsClear class supports POST method for ClearLog action.
  */
diff --git a/static/redfish/v1/JsonSchemas/OemCrashdump/OemCrashdump.json b/static/redfish/v1/JsonSchemas/OemCrashdump/OemCrashdump.json
deleted file mode 100644
index 604b719..0000000
--- a/static/redfish/v1/JsonSchemas/OemCrashdump/OemCrashdump.json
+++ /dev/null
@@ -1,120 +0,0 @@
-{
-    "$id": "http://redfish.dmtf.org/schemas/v1/OemCrashdump.v1_0_0.json",
-    "$schema": "http://redfish.dmtf.org/schemas/v1/redfish-schema-v1.json",
-    "copyright": "Copyright 2014-2019 DMTF. For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright",
-    "definitions": {
-        "Actions": {
-            "additionalProperties": false,
-            "patternProperties": {
-                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_]*$": {
-                    "description": "This property shall specify a valid odata or Redfish property.",
-                    "type": [
-                        "array",
-                        "boolean",
-                        "integer",
-                        "number",
-                        "null",
-                        "object",
-                        "string"
-                    ]
-                }
-            },
-            "properties": {
-                "#Crashdump.OnDemand": {
-                    "$ref": "#/definitions/OnDemand"
-                },
-                "#Crashdump.SendRawPeci": {
-                    "$ref": "#/definitions/SendRawPeci"
-                }
-            },
-            "type": "object"
-        },
-        "OnDemand": {
-            "additionalProperties": false,
-            "description": "This action is used to trigger a new on-demand crashdump.",
-            "longDescription": "This action is used to trigger a new on-demand crashdump which is returned immediately.",
-            "parameters": {},
-            "patternProperties": {
-                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_]*$": {
-                    "description": "This property shall specify a valid odata or Redfish property.",
-                    "type": [
-                        "array",
-                        "boolean",
-                        "integer",
-                        "number",
-                        "null",
-                        "object",
-                        "string"
-                    ]
-                }
-            },
-            "properties": {
-                "target": {
-                    "description": "Link to invoke action",
-                    "format": "uri-reference",
-                    "type": "string"
-                },
-                "title": {
-                    "description": "Friendly action name",
-                    "type": "string"
-                }
-            },
-            "type": "object"
-        },
-        "SendRawPeci": {
-            "additionalProperties": false,
-            "description": "This action is used to send a raw PECI command to the CPU.",
-            "longDescription": "This action is used to send a raw PECI command to the CPU.",
-            "parameters": {
-                "ClientAddress": {
-                    "description": "PECI client address for the command.",
-                    "longDescription": "This defines the PECI client address that is the target for this command.",
-                    "requiredParameter": true,
-                    "type": "integer"
-                },
-                "PECICommand": {
-                    "description": "The raw bytes to be sent as the PECI command.",
-                    "items": {
-                        "type": "integer"
-                    },
-                    "longDescription": "This defines an array of raw data that is made up of the raw bytes of the PECI command to be sent.",
-                    "requiredParameter": true,
-                    "type": "array"
-                },
-                "ReadLength": {
-                    "description": "Read length parameter for the command",
-                    "longDescription": "This defines the read length parameter for this command.",
-                    "requiredParameter": true,
-                    "type": "integer"
-                }
-            },
-            "patternProperties": {
-                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_]*$": {
-                    "description": "This property shall specify a valid odata or Redfish property.",
-                    "type": [
-                        "array",
-                        "boolean",
-                        "integer",
-                        "number",
-                        "null",
-                        "object",
-                        "string"
-                    ]
-                }
-            },
-            "properties": {
-                "target": {
-                    "description": "Link to invoke action",
-                    "format": "uri-reference",
-                    "type": "string"
-                },
-                "title": {
-                    "description": "Friendly action name",
-                    "type": "string"
-                }
-            },
-            "type": "object"
-        }
-    },
-    "title": "#OemCrashdump.v1_0_0"
-}
diff --git a/static/redfish/v1/JsonSchemas/OemCrashdump/index.json b/static/redfish/v1/JsonSchemas/OemCrashdump/index.json
deleted file mode 100644
index 7a19e8e..0000000
--- a/static/redfish/v1/JsonSchemas/OemCrashdump/index.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-    "@odata.context": "/redfish/v1/$metadata#JsonSchemaFile.JsonSchemaFile",
-    "@odata.id": "/redfish/v1/JsonSchemas/OemCrashdump",
-    "@odata.type": "#JsonSchemaFile.v1_0_2.JsonSchemaFile",
-    "Name": "Oem Crashdump Schema File",
-    "Schema": "#OemCrashdump.OemCrashdump",
-    "Description": "Oem Crashdump Schema File Location",
-    "Id": "OemCrashdump",
-    "Languages": [
-        "en"
-    ],
-    "Languages@odata.count": 1,
-    "Location": [
-        {
-            "Language": "en",
-            "Uri": "/redfish/v1/JsonSchemas/OemCrashdump/OemCrashdump.json"
-        }
-    ],
-    "Location@odata.count": 1
-}
diff --git a/static/redfish/v1/schema/OemCrashdump_v1.xml b/static/redfish/v1/schema/OemCrashdump_v1.xml
deleted file mode 100644
index 10e5ff6..0000000
--- a/static/redfish/v1/schema/OemCrashdump_v1.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
-    <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Core.V1.xml">
-        <edmx:Include Namespace="Org.OData.Core.V1" Alias="OData" />
-    </edmx:Reference>
-    <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/LogService_v1.xml">
-        <edmx:Include Namespace="LogService"/>
-        <edmx:Include Namespace="LogService.v1_0_0"/>
-    </edmx:Reference>
-
-    <edmx:DataServices>
-        <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OemCrashdump.v1_0_0">
-            <Action Name="OnDemand" IsBound="true">
-                <Parameter Name="LogService" Type="LogService.v1_0_0.OemActions"/>
-                <Annotation Term="OData.Description" String="This action is used to trigger a new on-demand crashdump." />
-                <Annotation Term="OData.LongDescription" String="This action is used to trigger a new on-demand crashdump which is returned immediately." />
-            </Action>
-
-            <Action Name="SendRawPeci" IsBound="true">
-                <Parameter Name="LogService" Type="LogService.v1_0_0.OemActions"/>
-                <Parameter Name="ClientAddress" Type="Edm.Int64" Nullable="false">
-                    <Annotation Term="OData.Description" String="PECI client address for the command." />
-                    <Annotation Term="OData.LongDescription" String="This defines the PECI client address that is the target for this command." />
-                </Parameter>
-                <Parameter Name="ReadLength" Type="Edm.Int64" Nullable="false">
-                    <Annotation Term="OData.Description" String="Read length parameter for the command" />
-                    <Annotation Term="OData.LongDescription" String="This defines the read length parameter for this command." />
-                </Parameter>
-                <Parameter Name="PECICommand" Type="Collection(Edm.Int64)" Nullable="false">
-                    <Annotation Term="OData.Description" String="The raw bytes to be sent as the PECI command." />
-                    <Annotation Term="OData.LongDescription" String="This defines an array of raw data that is made up of the raw bytes of the PECI command to be sent." />
-                </Parameter>
-                <Annotation Term="OData.Description" String="This action is used to send a raw PECI command to the CPU." />
-                <Annotation Term="OData.LongDescription" String="This action is used to send a raw PECI command to the CPU." />
-            </Action>
-        </Schema>
-    </edmx:DataServices>
-</edmx:Edmx>