summaryrefslogtreecommitdiff
path: root/include/google
diff options
context:
space:
mode:
authorWilly Tu <wltu@google.com>2022-09-26 19:46:38 +0300
committerEd Tanous <ed@tanous.net>2023-02-23 20:53:12 +0300
commiteddfc437edfc871b469199552bdeb0d65ee2dcf3 (patch)
tree3900183f1dc64c2cdcc20eebbc6d8de84e78a557 /include/google
parent66d90c2cb505d899373f17be468e730e88fe2345 (diff)
downloadbmcweb-eddfc437edfc871b469199552bdeb0d65ee2dcf3.tar.xz
Update most resources to use urlFromPieces
Only id in event_service and account_service have not been updated due to the risk of it breaking the username/id. It will require further testing to verify. Use urlFromPieces wherever that is needed to insert a variable in the URI. Don't use urlFromPieces when it is hardcoded values. This allow us to control all resource URIs that is dynamically added and to sync with the current recommanded method for `@odata.id`. The goal is to have a common place to manage the url created from dbus-paths in order to manage/update it easily when needed. Tested: RedfishValidtor Passed for all resource including the sensors with the fragments. Change-Id: I95cdfaaee58fc7f21c95f5944e1e5c813b3215f2 Signed-off-by: Willy Tu <wltu@google.com> Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'include/google')
-rw-r--r--include/google/google_service_root.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/google/google_service_root.hpp b/include/google/google_service_root.hpp
index fd8aad48b0..d5d340a984 100644
--- a/include/google/google_service_root.hpp
+++ b/include/google/google_service_root.hpp
@@ -118,8 +118,8 @@ inline void populateRootOfTrustEntity(
const ResolvedEntity& resolvedEntity)
{
asyncResp->res.jsonValue["@odata.type"] = "#RootOfTrust.v1_0_0.RootOfTrust";
- asyncResp->res.jsonValue["@odata.id"] =
- "/google/v1/RootOfTrustCollection/" + resolvedEntity.id;
+ asyncResp->res.jsonValue["@odata.id"] = crow::utility::urlFromPieces(
+ "google", "v1", "RootOfTrustCollection", resolvedEntity.id);
asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
asyncResp->res.jsonValue["Id"] = resolvedEntity.id;