Aggregation: Generate collections from schema
In aggregation we need to account for when a satellite BMC supports a
resource collection that the aggregating BMC does not. We need to
add links in responses from upstream resources to indicate that these
satellite only resources exist. These top level collections do not
always have the location format of /redfish/v1/<collection_id>. We
determine all of those from the schema rather than hardcoding a few
choice exceptions that do not fit that format such as
/redfish/v1/UpdateService/FirmwareInventory.
This patch is the first step in accomplishing this. We parse all
xml schema files in order to determine what are the top level
collection URIs. For URIs that are upstream from top level collections
we'll be able to derive what URIs could appear in the response which
are also on the same path to a top level collection.
The xml files for resources that aren't currently supported by bmcweb
are ignored when creating the schema index and later deleted once the
above parsing completes.
Later patches will use this information to make sure that we are
properly handling all schema defined top level collections.
Tested:
Compiles with aggregation enabled
Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: Icff825f4e4e9d84c96254561350f82839abdc074
diff --git a/scripts/update_schemas.py b/scripts/update_schemas.py
index 8021cbb..ba78113 100755
--- a/scripts/update_schemas.py
+++ b/scripts/update_schemas.py
@@ -8,6 +8,7 @@
import generate_schema_enums
import requests
+from generate_schema_collections import generate_top_collections
VERSION = "DSP8010_2022.2"
@@ -391,6 +392,7 @@
zip_ref.close()
generate_schema_enums.main()
+generate_top_collections()
# Now delete the xml schema files we aren't supporting
if os.path.exists(schema_path):