Add PLDM.PDR Interface

This interface has APIs that helps PLDM requester apps
(eg: openpower-occ-control, phosphor-logging’s openpower extension)
on the BMC to access the primary PDR repo.

The requester app openpower-occ-control will set
an effecter to request an OCC reset.

IBM has such apps to talk to host firmware, but the
API is generic.

Also introduce an exception
xyz.openbmc_project.Common.Error.ResourceNotFound.

Change-Id: I05ef9b79ee779c04abddf7777974b15c2d8f2ee9
Signed-off-by: Pavithra Barithaya <pbaritha@in.ibm.com>
diff --git a/xyz/openbmc_project/Common.errors.yaml b/xyz/openbmc_project/Common.errors.yaml
index 90b0e91..d365b35 100644
--- a/xyz/openbmc_project/Common.errors.yaml
+++ b/xyz/openbmc_project/Common.errors.yaml
@@ -12,3 +12,5 @@
   description: Server's CA certificate has not been provided.
 - name: TooManyResources
   description: Too many resources have already been granted.
+- name: ResourceNotFound
+  description: The resource is not found.
diff --git a/xyz/openbmc_project/Common.metadata.yaml b/xyz/openbmc_project/Common.metadata.yaml
index e1d122a..a90da83 100644
--- a/xyz/openbmc_project/Common.metadata.yaml
+++ b/xyz/openbmc_project/Common.metadata.yaml
@@ -21,3 +21,5 @@
   level: ERR
 - name: TooManyResources
   level: INFO
+- name: ResourceNotFound
+  level: INFO
diff --git a/xyz/openbmc_project/PLDM/PDR.interface.yaml b/xyz/openbmc_project/PLDM/PDR.interface.yaml
new file mode 100644
index 0000000..cdbd58c
--- /dev/null
+++ b/xyz/openbmc_project/PLDM/PDR.interface.yaml
@@ -0,0 +1,68 @@
+description: >
+    Implement to fetch the state effecter PDRs. PDRs are Platform Descriptor
+    Records which are the collection of information that includes semantic
+    and association information. The state effecter PDR is used to provide
+    information about the PLDM Composite State Effecter.
+
+    This API would be used by PLDM Requester apps on the BMC.
+
+    An implementation of this interface should maintain the primary PDR
+    repository on the BMC.
+
+    A OpenBMC implementation should implement the xyz.openbmc_project.PLDM.PDR
+    interface on the path /xyz/openbmc_project/pldm.
+
+    More information about PDR can be found at DSP0248 version 1.2.0 section 25.
+
+
+methods:
+    - name: FindStateEffecterPDR
+      description: >
+          Obtain the state effecter PDR, for the input TID, entity ID and state
+          set id. If multiple PLDM entity instances(in state effecter PDRs)
+          match the EntityId and StateSetId below,all the corresponding state
+          effecter PDRs are returned. More than one PDR can be returned for the
+          same state set id.
+
+          When the PDR for the given input TID, entity id and state set id is
+          not found, then the xyz.openbmc_project.Common.Error.ResourceNotFound
+          exception will be thrown.
+
+      parameters:
+        - name: TID
+          type: byte
+          description: >
+            A terminus id.
+
+        - name: EntityID
+          type: uint16
+          description: >
+            A numeric value that represents an entity that can be associated to
+            a PLDM state set.
+
+            More information is found at
+            http://dmtf.org/sites/default/files/standards/documents/DSP0249_1.0.0.pdf
+            section 7.
+
+        - name: StateSetId
+          type: uint16
+          description: >
+            A numeric value that identifies the PLDM State Set that is used with
+            this sensor.
+
+            More information is found at
+            http://dmtf.org/sites/default/files/standards/documents/DSP0249_1.0.0.pdf
+            section 6.
+
+      returns:
+        - name: StateEffecterPDR
+          type: array[array[byte]]
+          description: >
+            Array of State Effecter PDRs, where a PDR is an array[byte].
+            Multiple PDRs of the format present in table 89 of DSP0248 version
+            1.2.0 are returned. Each of the PDRs returned has the common header
+            along with all the other fields in table 89 and 90 of
+            DSP0248 of version 1.2.0 .
+
+      errors:
+        - xyz.openbmc_project.Common.Error.ResourceNotFound