PEL: Manager: Implemented the GetBMCLogIdFromPELId dbus method

In OpenPOWER based system, the application may need to get
the OpenBMC event log id by using the PEL id (aka Entry ID (EID) which
is a unique id in the PEL) so added the interface for the same.

Tested:
- Tested by below unit test cases.
 - With valid PEL ID
 - With invalid PEL ID

- Tested by using busctl command
 - With valid PEL ID
```
   busctl call xyz.openbmc_project.Logging \
   /xyz/openbmc_project/logging org.open_power.Logging.PEL \
   GetBMCLogIdFromPELId u 1342211909
   >>> u 4534
```
 - With invalid PEL ID
```
   busctl call xyz.openbmc_project.Logging \
   /xyz/openbmc_project/logging org.open_power.Logging.PEL \
   GetBMCLogIdFromPELId u 0xFFFFFFFF
   >>> Call failed: Invalid argument was given.
```

DBus interface:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/44421

Signed-off-by: Ramesh Iyyar <rameshi1@in.ibm.com>
Change-Id: Ibc67c0d1ad83457800847853e30254e2d9be53e6
diff --git a/extensions/openpower-pels/manager.cpp b/extensions/openpower-pels/manager.cpp
index 0aa2988..c90cacc 100644
--- a/extensions/openpower-pels/manager.cpp
+++ b/extensions/openpower-pels/manager.cpp
@@ -714,5 +714,18 @@
     }
 }
 
+uint32_t Manager::getBMCLogIdFromPELId(uint32_t pelId)
+{
+    Repository::LogID id{Repository::LogID::Pel(pelId)};
+    if (auto logId = _repo.getLogID(id); !logId.has_value())
+    {
+        throw common_error::InvalidArgument();
+    }
+    else
+    {
+        return logId->obmcID.id;
+    }
+}
+
 } // namespace pels
 } // namespace openpower