1b6df6dc7SBorawski.Lukasz /* 2b6df6dc7SBorawski.Lukasz // Copyright (c) 2018 Intel Corporation 3b6df6dc7SBorawski.Lukasz // 4b6df6dc7SBorawski.Lukasz // Licensed under the Apache License, Version 2.0 (the "License"); 5b6df6dc7SBorawski.Lukasz // you may not use this file except in compliance with the License. 6b6df6dc7SBorawski.Lukasz // You may obtain a copy of the License at 7b6df6dc7SBorawski.Lukasz // 8b6df6dc7SBorawski.Lukasz // http://www.apache.org/licenses/LICENSE-2.0 9b6df6dc7SBorawski.Lukasz // 10b6df6dc7SBorawski.Lukasz // Unless required by applicable law or agreed to in writing, software 11b6df6dc7SBorawski.Lukasz // distributed under the License is distributed on an "AS IS" BASIS, 12b6df6dc7SBorawski.Lukasz // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13b6df6dc7SBorawski.Lukasz // See the License for the specific language governing permissions and 14b6df6dc7SBorawski.Lukasz // limitations under the License. 15b6df6dc7SBorawski.Lukasz */ 16b6df6dc7SBorawski.Lukasz #pragma once 17b6df6dc7SBorawski.Lukasz 18b6df6dc7SBorawski.Lukasz #include "node.hpp" 19b6df6dc7SBorawski.Lukasz 207bffdb7eSBernard Wong #include <utils/systemd_utils.hpp> 21b6df6dc7SBorawski.Lukasz 221abe55efSEd Tanous namespace redfish 231abe55efSEd Tanous { 241abe55efSEd Tanous 251abe55efSEd Tanous class ServiceRoot : public Node 261abe55efSEd Tanous { 27b6df6dc7SBorawski.Lukasz public: 2852cc112dSEd Tanous ServiceRoot(App& app) : Node(app, "/redfish/v1/") 291abe55efSEd Tanous { 3052cc112dSEd Tanous uuid = persistent_data::getConfig().systemUuid; 31e0625906SEd Tanous entityPrivileges = { 32e0625906SEd Tanous {boost::beast::http::verb::get, {}}, 33e0d918bcSEd Tanous {boost::beast::http::verb::head, {}}, 34e0d918bcSEd Tanous {boost::beast::http::verb::patch, {{"ConfigureComponents"}}}, 35e0d918bcSEd Tanous {boost::beast::http::verb::put, {{"ConfigureComponents"}}}, 36e0d918bcSEd Tanous {boost::beast::http::verb::delete_, {{"ConfigureComponents"}}}, 37e0d918bcSEd Tanous {boost::beast::http::verb::post, {{"ConfigureComponents"}}}}; 38b6df6dc7SBorawski.Lukasz } 39b6df6dc7SBorawski.Lukasz 40b6df6dc7SBorawski.Lukasz private: 41cb13a392SEd Tanous void doGet(crow::Response& res, const crow::Request&, 42cb13a392SEd Tanous const std::vector<std::string>&) override 431abe55efSEd Tanous { 445968caeeSMarri Devender Rao res.jsonValue["@odata.type"] = "#ServiceRoot.v1_5_0.ServiceRoot"; 45ceac6f75SEd Tanous res.jsonValue["@odata.id"] = "/redfish/v1"; 460f74e643SEd Tanous res.jsonValue["Id"] = "RootService"; 470f74e643SEd Tanous res.jsonValue["Name"] = "Root Service"; 485b816f23SGunnar Mills res.jsonValue["RedfishVersion"] = "1.9.0"; 490f74e643SEd Tanous res.jsonValue["Links"]["Sessions"] = { 500f74e643SEd Tanous {"@odata.id", "/redfish/v1/SessionService/Sessions"}}; 510f74e643SEd Tanous res.jsonValue["AccountService"] = { 520f74e643SEd Tanous {"@odata.id", "/redfish/v1/AccountService"}}; 530f74e643SEd Tanous res.jsonValue["Chassis"] = {{"@odata.id", "/redfish/v1/Chassis"}}; 540f74e643SEd Tanous res.jsonValue["JsonSchemas"] = { 550f74e643SEd Tanous {"@odata.id", "/redfish/v1/JsonSchemas"}}; 56aa7cb211SEd Tanous res.jsonValue["Managers"] = {{"@odata.id", "/redfish/v1/Managers"}}; 570f74e643SEd Tanous res.jsonValue["SessionService"] = { 588d3cae6bSGunnar Mills {"@odata.id", "/redfish/v1/SessionService"}}; 59ceac6f75SEd Tanous res.jsonValue["Managers"] = {{"@odata.id", "/redfish/v1/Managers"}}; 600f74e643SEd Tanous res.jsonValue["Systems"] = {{"@odata.id", "/redfish/v1/Systems"}}; 610f74e643SEd Tanous res.jsonValue["Registries"] = {{"@odata.id", "/redfish/v1/Registries"}}; 620f74e643SEd Tanous 630f74e643SEd Tanous res.jsonValue["UpdateService"] = { 640f74e643SEd Tanous {"@odata.id", "/redfish/v1/UpdateService"}}; 653602e232SEd Tanous res.jsonValue["UUID"] = uuid; 665968caeeSMarri Devender Rao res.jsonValue["CertificateService"] = { 675968caeeSMarri Devender Rao {"@odata.id", "/redfish/v1/CertificateService"}}; 6846229577SJames Feist res.jsonValue["Tasks"] = {{"@odata.id", "/redfish/v1/TaskService"}}; 69e5aaf047SAppaRao Puli res.jsonValue["EventService"] = { 70e5aaf047SAppaRao Puli {"@odata.id", "/redfish/v1/EventService"}}; 71*081ebf06SWludzik, Jozef res.jsonValue["TelemetryService"] = { 72*081ebf06SWludzik, Jozef {"@odata.id", "/redfish/v1/TelemetryService"}}; 73b6df6dc7SBorawski.Lukasz res.end(); 74b6df6dc7SBorawski.Lukasz } 753602e232SEd Tanous 763602e232SEd Tanous std::string uuid; 77b6df6dc7SBorawski.Lukasz }; 78b6df6dc7SBorawski.Lukasz 79b6df6dc7SBorawski.Lukasz } // namespace redfish 80