Implement JsonSchema endpoint

This patchset implements JsonSchema support, and automates our update
of the XML metadata, and Json schema files in the future by way of a
python script.

Change-Id: Iec6f580d10736678149db18d87be2f140b535be9
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/static/redfish/v1/JsonSchemas/PrivilegeRegistry/index.json b/static/redfish/v1/JsonSchemas/PrivilegeRegistry/index.json
new file mode 100644
index 0000000..b285361
--- /dev/null
+++ b/static/redfish/v1/JsonSchemas/PrivilegeRegistry/index.json
@@ -0,0 +1,358 @@
+{
+    "$ref": "#/definitions/PrivilegeRegistry",
+    "$schema": "http://redfish.dmtf.org/schemas/v1/redfish-schema.v1_3_0.json",
+    "copyright": "Copyright 2014-2017 Distributed Management Task Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright",
+    "definitions": {
+        "Actions": {
+            "additionalProperties": false,
+            "description": "The available actions for this resource.",
+            "longDescription": "This type shall contain the available actions for this resource.",
+            "patternProperties": {
+                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[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": {
+                "Oem": {
+                    "$ref": "#/definitions/OemActions"
+                }
+            },
+            "type": "object"
+        },
+        "Mapping": {
+            "additionalProperties": false,
+            "description": "This type describes a mapping between an entity and the relevant privileges used to access it.",
+            "longDescription": "This type shall describe a mapping between an entity and the relevant privileges used to access it.",
+            "patternProperties": {
+                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[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": {
+                "Entity": {
+                    "description": "Indicates entity name. e.g., Manager.",
+                    "longDescription": "Indicates entity name. e.g., Manager.",
+                    "readonly": true,
+                    "type": "string"
+                },
+                "OperationMap": {
+                    "$ref": "#/definitions/OperationMap",
+                    "description": "List mapping between HTTP method and privilege required for entity.",
+                    "longDescription": "List mapping between HTTP method and privilege required for entity."
+                },
+                "PropertyOverrides": {
+                    "description": "Indicates privilege overrides of property or element within a entity.",
+                    "items": {
+                        "anyOf": [
+                            {
+                                "$ref": "#/definitions/Target_PrivilegeMap"
+                            },
+                            {
+                                "type": "null"
+                            }
+                        ]
+                    },
+                    "longDescription": "Indicates privilege overrides of property or element. e.g., password property.",
+                    "type": "array"
+                },
+                "ResourceURIOverrides": {
+                    "description": "Indicates privilege overrides of Resource URI.",
+                    "items": {
+                        "anyOf": [
+                            {
+                                "$ref": "#/definitions/Target_PrivilegeMap"
+                            },
+                            {
+                                "type": "null"
+                            }
+                        ]
+                    },
+                    "longDescription": "Indicates privilege overrides of Resource URI. Target lists Resource URI.",
+                    "type": "array"
+                },
+                "SubordinateOverrides": {
+                    "description": "Indicates privilege overrides of subordinate resource.",
+                    "items": {
+                        "anyOf": [
+                            {
+                                "$ref": "#/definitions/Target_PrivilegeMap"
+                            },
+                            {
+                                "type": "null"
+                            }
+                        ]
+                    },
+                    "longDescription": "Indicates privilege overrides of subordinate resource. Target lists referenced by Entity.",
+                    "type": "array"
+                }
+            },
+            "type": "object"
+        },
+        "OemActions": {
+            "additionalProperties": true,
+            "description": "The available OEM specific actions for this resource.",
+            "longDescription": "This type shall contain any additional OEM actions for this resource.",
+            "patternProperties": {
+                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[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"
+        },
+        "OperationMap": {
+            "additionalProperties": false,
+            "description": "Used for describing the specific privileges for a set of HTTP operations.",
+            "longDescription": "This type shall describe the specific privileges required for a set of HTTP operations.",
+            "patternProperties": {
+                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[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": {
+                "DELETE": {
+                    "description": "Indicates privilege required for HTTP DELETE operation.",
+                    "items": {
+                        "$ref": "#/definitions/OperationPrivilege"
+                    },
+                    "longDescription": "Indicates privilege required for HTTP DELETE operation.",
+                    "type": "array"
+                },
+                "GET": {
+                    "description": "Indicates privilege required for HTTP GET operation.",
+                    "items": {
+                        "$ref": "#/definitions/OperationPrivilege"
+                    },
+                    "longDescription": "Indicates privilege required for HTTP GET operation.",
+                    "type": "array"
+                },
+                "HEAD": {
+                    "description": "Indicates privilege required for HTTP HEAD operation.",
+                    "items": {
+                        "$ref": "#/definitions/OperationPrivilege"
+                    },
+                    "longDescription": "Indicates privilege required for HTTP HEAD operation.",
+                    "type": "array"
+                },
+                "PATCH": {
+                    "description": "Indicates privilege required for HTTP PATCH operation.",
+                    "items": {
+                        "$ref": "#/definitions/OperationPrivilege"
+                    },
+                    "longDescription": "Indicates privilege required for HTTP PATCH operation.",
+                    "type": "array"
+                },
+                "POST": {
+                    "description": "Indicates privilege required for HTTP POST operation.",
+                    "items": {
+                        "$ref": "#/definitions/OperationPrivilege"
+                    },
+                    "longDescription": "Indicates privilege required for HTTP POST operation.",
+                    "type": "array"
+                },
+                "PUT": {
+                    "description": "Indicates privilege required for HTTP PUT operation.",
+                    "items": {
+                        "$ref": "#/definitions/OperationPrivilege"
+                    },
+                    "longDescription": "Indicates privilege required for HTTP PUT operation.",
+                    "type": "array"
+                }
+            },
+            "type": "object"
+        },
+        "OperationPrivilege": {
+            "additionalProperties": false,
+            "description": "Used for describing the specific privileges for a given type of HTTP operation.",
+            "longDescription": "This type shall describe the specific privileges required for a given type of HTTP operation.",
+            "patternProperties": {
+                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[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": {
+                "Privilege": {
+                    "description": "Lists the privileges that are allowed to perform the given type of HTTP operation on the entity type.",
+                    "items": {
+                        "type": "string"
+                    },
+                    "longDescription": "This array shall contain a set of strings that match 0 or more of the strings found in the PrivilegesUsed and OEMPrivilegesUsed properties.",
+                    "readonly": true,
+                    "type": "array"
+                }
+            },
+            "type": "object"
+        },
+        "PrivilegeRegistry": {
+            "additionalProperties": false,
+            "description": "This is the schema definition for Operation to Privilege mapping.",
+            "longDescription": "This resource shall be used to represent operation to privilege mappings.",
+            "patternProperties": {
+                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[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": {
+                "@odata.context": {
+                    "$ref": "http://redfish.dmtf.org/schemas/v1/odata.v4_0_1.json#/definitions/context"
+                },
+                "@odata.id": {
+                    "$ref": "http://redfish.dmtf.org/schemas/v1/odata.v4_0_1.json#/definitions/id"
+                },
+                "@odata.type": {
+                    "$ref": "http://redfish.dmtf.org/schemas/v1/odata.v4_0_1.json#/definitions/type"
+                },
+                "Actions": {
+                    "$ref": "#/definitions/Actions",
+                    "description": "The available actions for this resource.",
+                    "longDescription": "The Actions property shall contain the available actions for this resource."
+                },
+                "Description": {
+                    "anyOf": [
+                        {
+                            "$ref": "http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/Description"
+                        },
+                        {
+                            "type": "null"
+                        }
+                    ],
+                    "readonly": true
+                },
+                "Id": {
+                    "$ref": "http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/Id",
+                    "readonly": true
+                },
+                "Mappings": {
+                    "items": {
+                        "$ref": "#/definitions/Mapping"
+                    },
+                    "type": "array"
+                },
+                "Name": {
+                    "$ref": "http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/Name",
+                    "readonly": true
+                },
+                "OEMPrivilegesUsed": {
+                    "description": "Lists the set of OEM Priviliges used in building this mapping.",
+                    "items": {
+                        "type": "string"
+                    },
+                    "readonly": true,
+                    "type": "array"
+                },
+                "Oem": {
+                    "$ref": "http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/Oem",
+                    "description": "This is the manufacturer/provider specific extension moniker used to divide the Oem object into sections.",
+                    "longDescription": "The value of this string shall be of the format for the reserved word *Oem*."
+                },
+                "PrivilegesUsed": {
+                    "description": "Lists the set of Redfish standard priviliges used in building this mapping.",
+                    "items": {
+                        "$ref": "http://redfish.dmtf.org/schemas/v1/Privileges.json#/definitions/PrivilegeType"
+                    },
+                    "readonly": true,
+                    "type": "array"
+                }
+            },
+            "required": [
+                "Id",
+                "Name"
+            ],
+            "type": "object"
+        },
+        "Target_PrivilegeMap": {
+            "additionalProperties": false,
+            "description": "This type describes a mapping between one or more targets and the HTTP operations associated with them.",
+            "longDescription": "This type shall describe a mapping between one or more targets and the HTTP operations associated with them.",
+            "patternProperties": {
+                "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[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": {
+                "OperationMap": {
+                    "anyOf": [
+                        {
+                            "$ref": "#/definitions/OperationMap"
+                        },
+                        {
+                            "type": "null"
+                        }
+                    ],
+                    "description": "List mapping between HTTP operation and privilege needed to perform operation.",
+                    "longDescription": "List mapping between HTTP operation and privilege needed to perform operation."
+                },
+                "Targets": {
+                    "description": "Indicates the URI or Entity.",
+                    "items": {
+                        "type": [
+                            "string",
+                            "null"
+                        ]
+                    },
+                    "longDescription": "Indicates the set of URI(s) or Entity(s) or property(s). e.g./redfish/v1/Systems/1, Manager, Password. When targets property is not mentioned, then there is no override.",
+                    "readonly": true,
+                    "type": "array"
+                }
+            },
+            "type": "object"
+        }
+    },
+    "title": "#PrivilegeRegistry.v1_1_1.PrivilegeRegistry"
+}
\ No newline at end of file