Redfish:Define new Oem schemas for dump

Implemented Oem schemas for extending LogService and
LogEntry

Testing:
redfish validator passed.

Change-Id: I89a76cf3bd991b36a6aa48871f25d03fbbe30f66
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
diff --git a/static/redfish/v1/$metadata/index.xml b/static/redfish/v1/$metadata/index.xml
index 18b95b7..a9df1bf 100644
--- a/static/redfish/v1/$metadata/index.xml
+++ b/static/redfish/v1/$metadata/index.xml
@@ -2252,4 +2252,12 @@
         <edmx:Include Namespace="OemAccountService"/>
         <edmx:Include Namespace="OemAccountService.v1_0_0"/>
     </edmx:Reference>
+    <edmx:Reference Uri="/redfish/v1/schema/OemLogService_v1.xml">
+        <edmx:Include Namespace="OemLogService"/>
+        <edmx:Include Namespace="OemLogService.v1_0_0"/>
+    </edmx:Reference>
+    <edmx:Reference Uri="/redfish/v1/schema/OemLogEntry_v1.xml">
+        <edmx:Include Namespace="OemLogEntry"/>
+        <edmx:Include Namespace="OemLogEntry.v1_0_0"/>
+    </edmx:Reference>
 </edmx:Edmx>
diff --git a/static/redfish/v1/JsonSchemas/OemLogEntry/index.json b/static/redfish/v1/JsonSchemas/OemLogEntry/index.json
new file mode 100644
index 0000000..e3ae704
--- /dev/null
+++ b/static/redfish/v1/JsonSchemas/OemLogEntry/index.json
@@ -0,0 +1,85 @@
+{
+    "$id": "http://redfish.dmtf.org/schemas/v1/OemLogEntry.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": {
+        "OpenBmc": {
+            "additionalProperties": false,
+            "description": "OEM Extension for LogEntry",
+            "longDescription": "OEM Extension for LogEntry for dump.",
+            "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"
+                    ]
+                }
+            },
+            "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": {
+                "#LogEntry.DownloadLog": {
+                    "$ref": "#/definitions/DownloadLog"
+                }
+            },
+            "type": "object"
+           },
+           "DownloadLog": {
+            "additionalProperties": false,
+            "description": "This action is used to download dump.",
+            "longDescription": "This action is used to download dump.",
+            "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"
+                    ]
+                }
+            },
+            "type": "object"
+            },
+            "properties": {
+                "SizeInB": {
+                    "description": "Indicates size of dump in bytes",
+                    "longDescription": "The value of this property provides size of this dump entry in bytes",
+                    "readonly": true,
+                    "type": [
+                        "integer",
+                        "null"
+                    ]
+                }
+            },
+            "type": "object"
+        }
+    },
+    "owningEntity": "OpenBMC",
+    "release": "1.0",
+    "title": "#OemLogEntry.v1_0_0.LogEnry"
+}
diff --git a/static/redfish/v1/JsonSchemas/OemLogService/index.json b/static/redfish/v1/JsonSchemas/OemLogService/index.json
new file mode 100644
index 0000000..21ff0af
--- /dev/null
+++ b/static/redfish/v1/JsonSchemas/OemLogService/index.json
@@ -0,0 +1,116 @@
+{
+    "$id": "http://redfish.dmtf.org/schemas/v1/OemLogService.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": {
+        "OpenBmc": {
+            "additionalProperties": true,
+            "description": "Oem properties for OpenBmc.",
+            "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"
+                    ]
+                }
+            },
+            "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": {
+                "#LogService.CreateLog": {
+                    "$ref": "#/definitions/CreateLog"
+                }
+            },
+            "type": "object"
+           },
+           "CreateLog": {
+            "additionalProperties": false,
+            "description": "This action is used to trigger a new system dump.",
+            "longDescription": "This action is used to trigger a new system dump.",
+            "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"
+                    ]
+                }
+            },
+            "type": "object"
+            },
+
+            "properties": {
+                "Type": {
+                    "description": "Indicates type of this oem entry",
+                    "longDescription": "The value of this property represents type of entry",
+                    "readonly": true,
+                    "type": [
+                        "string",
+                        "null"
+                    ]
+                },
+                "DumpType": {
+                    "description": "Indicates dump type",
+                    "longDescription": "The value of this property represents type of dump.",
+                    "readonly": true,
+                    "type": [
+                        "string",
+                        "null"
+                    ]
+                }
+
+            },
+            "type": "object"
+        },
+        "LogService": {
+            "additionalProperties": false,
+            "description": "OEM Extension for VirtualMedia",
+            "longDescription": "OEM Extension for VirtualMedia to support Proxy mode.",
+            "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": {},
+            "type": "object"
+        }
+    },
+    "owningEntity": "OpenBMC",
+    "release": "1.0",
+    "title": "#OemLogService.v1_0_0"
+}
diff --git a/static/redfish/v1/schema/OemLogEntry_v1.xml b/static/redfish/v1/schema/OemLogEntry_v1.xml
new file mode 100644
index 0000000..facfd4f
--- /dev/null
+++ b/static/redfish/v1/schema/OemLogEntry_v1.xml
@@ -0,0 +1,51 @@
+<?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://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Measures.V1.xml">
+    <edmx:Include Namespace="Org.OData.Measures.V1" Alias="Measures"/>
+  </edmx:Reference>
+  <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/RedfishExtensions_v1.xml">
+    <edmx:Include Namespace="RedfishExtensions.v1_0_0" Alias="Redfish"/>
+  </edmx:Reference>
+  <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/Resource_v1.xml">
+    <edmx:Include Namespace="Resource"/>
+    <edmx:Include Namespace="Resource.v1_0_0"/>
+  </edmx:Reference>
+
+  <edmx:DataServices>
+
+    <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OemLogEntry">
+      <Annotation Term="Redfish.OwningEntity" String="OpenBMC"/>
+    </Schema>
+
+    <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OemLogEntry.v1_0_0">
+      <Annotation Term="Redfish.OwningEntity" String="OpenBMC"/>
+      <Annotation Term="Redfish.Release" String="1.0"/>
+
+      <ComplexType Name="OpenBmc" BaseType="Resource.OemObject">
+        <Annotation Term="OData.AdditionalProperties" Bool="true"/>
+        <Annotation Term="OData.Description" String="Oem properties for OpenBmc." />
+            <Action Name="DownloadLog" IsBound="true">
+                <Parameter Name="LogEntry" Type="LogEntry.v1_2_0.OemActions"/>
+                <Annotation Term="OData.Description" String="The action to download the system dump log entry for this Log Service."/>
+                <Annotation Term="OData.LongDescription" String="This action shall download system dump for this Log Service."/>
+            </Action>
+            <Property Name="SizeInB" Type="Edm.Int64">
+                <Annotation Term="OData.Permissions" EnumMember="OData.Permission/Read"/>
+                <Annotation Term="OData.Description" String="The size of dump in bytes for the log entry if the entry type is `DUMP`."/>
+                <Annotation Term="OData.LongDescription" String="This property shall contain the size in bytes for the log entry if the EntryType is `DUMP`."/>
+            </Property>
+      </ComplexType>
+
+      <EntityType Name="LogEntry" BaseType="Resource.OemObject" Abstract="true">
+          <Annotation Term="OData.Description" String="OEM Extension for LogEntry"/>
+          <Annotation Term="OData.LongDescription" String="OEM Extension of LogEntry for dump"/>
+      </EntityType>
+    </Schema>
+
+  </edmx:DataServices>
+</edmx:Edmx>
+
diff --git a/static/redfish/v1/schema/OemLogService_v1.xml b/static/redfish/v1/schema/OemLogService_v1.xml
new file mode 100644
index 0000000..95f5e11
--- /dev/null
+++ b/static/redfish/v1/schema/OemLogService_v1.xml
@@ -0,0 +1,56 @@
+<?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://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Measures.V1.xml">
+    <edmx:Include Namespace="Org.OData.Measures.V1" Alias="Measures"/>
+  </edmx:Reference>
+  <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/RedfishExtensions_v1.xml">
+    <edmx:Include Namespace="RedfishExtensions.v1_0_0" Alias="Redfish"/>
+  </edmx:Reference>
+  <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/Resource_v1.xml">
+    <edmx:Include Namespace="Resource"/>
+    <edmx:Include Namespace="Resource.v1_0_0"/>
+  </edmx:Reference>
+
+  <edmx:DataServices>
+
+    <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OemLogService">
+      <Annotation Term="Redfish.OwningEntity" String="OpenBMC"/>
+    </Schema>
+
+    <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OemLogService.v1_0_0">
+      <Annotation Term="Redfish.OwningEntity" String="OpenBMC"/>
+      <Annotation Term="Redfish.Release" String="1.0"/>
+
+      <ComplexType Name="OpenBmc" BaseType="Resource.OemObject">
+        <Annotation Term="OData.AdditionalProperties" Bool="true"/>
+        <Annotation Term="OData.Description" String="Oem properties for OpenBmc." />
+          <Action Name="CreateLog" IsBound="true">
+            <Parameter Name="LogService" Type="LogService.v1_0_0.OemActions"/>
+            <Annotation Term="OData.Description" String="The action to create the log for this Log Service."/>
+            <Annotation Term="OData.LongDescription" String="This action is used to trigger a new system dump."/>
+          </Action>
+          <Property Name="Type" Type="Edm.String">
+            <Annotation Term="OData.Permissions" EnumMember="OData.Permission/Read"/>
+            <Annotation Term="OData.Description" String="The entry type"/>
+            <Annotation Term="OData.LongDescription" String="This property shall contain the EntryType is `Dump`."/>
+          </Property>
+          <Property Name="DumpType" Type="Edm.String">
+            <Annotation Term="OData.Permissions" EnumMember="OData.Permission/Read"/>
+            <Annotation Term="OData.Description" String="The dump entry type"/>
+            <Annotation Term="OData.LongDescription" String="This property shall contain dump entry type."/>
+          </Property>
+      </ComplexType>
+
+      <EntityType Name="LogService" BaseType="Resource.OemObject" Abstract="true">
+          <Annotation Term="OData.Description" String="OEM Extension for LogService"/>
+          <Annotation Term="OData.LongDescription" String="OEM Extension of LogService for dump"/>
+      </EntityType>
+    </Schema>
+
+  </edmx:DataServices>
+</edmx:Edmx>
+