Redfish Schema: Add Stepwise to Oem Schema

This adds the schema required for stepwise controllers.
JSON is auto-created based on XML using redfish csdl to
json script.

Tested-by: Ran redfish validator and verified it passed

Change-Id: Id933d248f55c98d858a7dccffa974f95b98b554e
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/static/redfish/v1/JsonSchemas/OemManager/index.json b/static/redfish/v1/JsonSchemas/OemManager/index.json
index c3b4bf4..bf69511 100644
--- a/static/redfish/v1/JsonSchemas/OemManager/index.json
+++ b/static/redfish/v1/JsonSchemas/OemManager/index.json
@@ -1,5 +1,6 @@
 {
     "$schema": "http://redfish.dmtf.org/schemas/v1/redfish-schema.v1_4_0.json",
+    "copyright": "Copyright 2014-2018 Distributed Management Task Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright",
     "definitions": {
         "Fan": {
             "additionalProperties": true,
@@ -47,6 +48,16 @@
                             "type": "null"
                         }
                     ]
+                },
+                "StepwiseControllers": {
+                    "anyOf": [
+                        {
+                            "$ref": "#/definitions/StepwiseControllers"
+                        },
+                        {
+                            "type": "null"
+                        }
+                    ]
                 }
             },
             "type": "object"
@@ -407,7 +418,123 @@
             },
             "properties": {},
             "type": "object"
+        },
+        "StepwiseController": {
+            "additionalProperties": false,
+            "description": "Configuration data for Stepwise Controllers.",
+            "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",
+                        "number",
+                        "null",
+                        "object",
+                        "string"
+                    ]
+                }
+            },
+            "properties": {
+                "Inputs": {
+                    "description": "Input sensors to the Stepwise controller.",
+                    "items": {
+                        "type": [
+                            "string",
+                            "null"
+                        ]
+                    },
+                    "longDescription": "Input sensors to the Stepwise controller.",
+                    "type": "array"
+                },
+                "NegativeHysteresis": {
+                    "description": "Negative Hysteresis for the stepwise controller.",
+                    "longDescription": "Negative Hysteresis for the stepwise controller.",
+                    "type": "number"
+                },
+                "PositiveHysteresis": {
+                    "description": "Positive Hysteresis for the stepwise controller.",
+                    "longDescription": "Positive Hysteresis for the stepwise controller.",
+                    "type": "number"
+                },
+                "Steps": {
+                    "description": "Temperature vs RPM steps for the stepwise controller.",
+                    "items": {
+                        "anyOf": [
+                            {
+                                "$ref": "#/definitions/StepwiseSteps"
+                            },
+                            {
+                                "type": "null"
+                            }
+                        ]
+                    },
+                    "longDescription": "Temperature vs RPM steps for the stepwise controller.",
+                    "type": "array"
+                },
+                "Zones": {
+                    "description": "Contains the Zones that this controller contributes to.",
+                    "items": {
+                        "$ref": "#/definitions/FanZone"
+                    },
+                    "readonly": true,
+                    "type": "array"
+                },
+                "Zones@odata.count": {
+                    "$ref": "http://redfish.dmtf.org/schemas/v1/odata.v4_0_2.json#/definitions/count"
+                }
+            },
+            "type": "object"
+        },
+        "StepwiseControllers": {
+            "additionalProperties": true,
+            "description": "OpenBmc StepwiseControllers.",
+            "longDescription": "Container for OpenBmc Stepwise controllers.",
+            "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",
+                        "number",
+                        "null",
+                        "object",
+                        "string"
+                    ]
+                }
+            },
+            "properties": {},
+            "type": "object"
+        },
+        "StepwiseSteps": {
+            "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",
+                        "number",
+                        "null",
+                        "object",
+                        "string"
+                    ]
+                }
+            },
+            "properties": {
+                "Output": {
+                    "description": "Fan speed setting for step.",
+                    "longDescription": "Fan speed setting for step.",
+                    "type": "number"
+                },
+                "Target": {
+                    "description": "Input sensor reading for step.",
+                    "longDescription": "Input sensor reading for step.",
+                    "type": "number"
+                }
+            },
+            "type": "object"
         }
     },
     "title": "#OemManager"
-}
+}
\ No newline at end of file
diff --git a/static/redfish/v1/schema/OemManager_v1.xml b/static/redfish/v1/schema/OemManager_v1.xml
index 267aad3..8f7a6af 100644
--- a/static/redfish/v1/schema/OemManager_v1.xml
+++ b/static/redfish/v1/schema/OemManager_v1.xml
@@ -41,6 +41,7 @@
                 <Annotation Term="OData.AutoExpand"/>
                 <NavigationProperty Name="FanControllers" Type="OemManager.FanControllers"/>
                 <NavigationProperty Name="PidControllers" Type="OemManager.PidControllers"/>
+                <NavigationProperty Name="StepwiseControllers" Type="OemManager.StepwiseControllers"/>
                 <NavigationProperty Name="FanZones" Type="OemManager.FanZones"/>
             </EntityType>
 
@@ -76,6 +77,22 @@
                 </Annotation>
             </EntityType>
 
+            <EntityType Name="StepwiseControllers" BaseType="Resource.OemObject" ContainsTarget="true">
+                <Annotation Term="OData.AdditionalProperties" Bool="true" />
+                <Annotation Term="OData.Description" String="OpenBmc StepwiseControllers." />
+                <Annotation Term="OData.LongDescription" String="Container for OpenBmc Stepwise controllers." />
+                <Annotation Term="Redfish.DynamicPropertyPatterns">
+                    <Annotation Term="OData.AutoExpand"/>
+                    <Collection ContainsTarget="true">
+                        <NavigationProperty>
+                            <Annotation Term="OData.AutoExpand"/>
+                            <PropertyValue Property="Pattern" String="[A-Za-z0-9_.:]+" />
+                            <PropertyValue Property="Type" String="OemManager.StepwiseController" />
+                        </NavigationProperty>
+                    </Collection>
+                </Annotation>
+            </EntityType>
+
             <EntityType Name="FanZones" BaseType="Resource.OemObject" ContainsTarget="true">
                 <Annotation Term="OData.AdditionalProperties" Bool="true" />
                 <Annotation Term="OData.Description" String="OpenBmc FanZones." />
@@ -227,6 +244,44 @@
                     <Annotation Term="OData.AutoExpandReferences"/>
                 </NavigationProperty>
             </ComplexType>
+
+            <ComplexType Name="StepwiseController" BaseType="Resource.OemObject">
+                <Annotation Term="OData.AdditionalProperties" Bool="false" />
+                <Annotation Term="OData.Description" String="Configuration data for Stepwise Controllers." />
+                <Property Name="Inputs" Type="Collection(Edm.String)">
+                    <Annotation Term="OData.Description" String="Input sensors to the Stepwise controller."/>
+                    <Annotation Term="OData.LongDescription" String="Input sensors to the Stepwise controller."/>
+                </Property>
+                <Property Name="NegativeHysteresis" Type="Edm.Decimal" Nullable="false">
+                    <Annotation Term="OData.Description" String="Negative Hysteresis for the stepwise controller." />
+                    <Annotation Term="OData.LongDescription" String="Negative Hysteresis for the stepwise controller." />
+                </Property>
+                <Property Name="PositiveHysteresis" Type="Edm.Decimal" Nullable="false">
+                    <Annotation Term="OData.Description" String="Positive Hysteresis for the stepwise controller." />
+                    <Annotation Term="OData.LongDescription" String="Positive Hysteresis for the stepwise controller." />
+                </Property>
+                <Property Name="Steps" Type="Collection(OemManager.StepwiseSteps)">
+                    <Annotation Term="OData.Description" String="Temperature vs RPM steps for the stepwise controller." />
+                    <Annotation Term="OData.LongDescription" String="Temperature vs RPM steps for the stepwise controller." />
+                    <Annotation Term="OData.AutoExpand"/>
+                </Property>
+                <NavigationProperty Name="Zones" Type="Collection(OemManager.FanZone)" ContainsTarget="true">
+                    <Annotation Term="OData.Permissions" EnumMember="OData.Permission/Read" />
+                    <Annotation Term="OData.Description" String="Contains the Zones that this controller contributes to." />
+                    <Annotation Term="OData.AutoExpandReferences"/>
+                </NavigationProperty>
+            </ComplexType>
+
+            <ComplexType Name="StepwiseSteps" BaseType="Resource.OemObject">
+                <Property Name="Target" Type="Edm.Decimal" Nullable="false">
+                    <Annotation Term="OData.Description" String="Input sensor reading for step."/>
+                    <Annotation Term="OData.LongDescription" String="Input sensor reading for step."/>
+                </Property>
+                <Property Name="Output" Type="Edm.Decimal" Nullable="false">
+                    <Annotation Term="OData.Description" String="Fan speed setting for step."/>
+                    <Annotation Term="OData.LongDescription" String="Fan speed setting for step."/>
+                </Property>
+           </ComplexType>
         </Schema>
     </edmx:DataServices>
 </edmx:Edmx>