blob: c58cafd6330caa088e55dd82eb6102e879f8fbde [file] [log] [blame]
Lewanczyk, Dawid88d16c92018-02-02 14:51:09 +01001/*
2// Copyright (c) 2018 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16#pragma once
17
18#include "node.hpp"
19
Ed Tanous1abe55e2018-09-05 08:30:59 -070020namespace redfish
21{
Lewanczyk, Dawid88d16c92018-02-02 14:51:09 +010022
Ed Tanous1abe55e2018-09-05 08:30:59 -070023class AccountService : public Node
24{
25 public:
26 AccountService(CrowApp& app) : Node(app, "/redfish/v1/AccountService/")
27 {
28 Node::json["@odata.id"] = "/redfish/v1/AccountService";
29 Node::json["@odata.type"] = "#AccountService.v1_1_0.AccountService";
30 Node::json["@odata.context"] =
31 "/redfish/v1/$metadata#AccountService.AccountService";
32 Node::json["Id"] = "AccountService";
33 Node::json["Description"] = "BMC User Accounts";
34 Node::json["Name"] = "Account Service";
35 Node::json["ServiceEnabled"] = true;
36 Node::json["MinPasswordLength"] = 1;
37 Node::json["MaxPasswordLength"] = 20;
38 Node::json["Accounts"]["@odata.id"] =
39 "/redfish/v1/AccountService/Accounts";
40 Node::json["Roles"]["@odata.id"] = "/redfish/v1/AccountService/Roles";
Ed Tanous3ebd75f2018-03-05 18:20:01 -080041
Ed Tanous1abe55e2018-09-05 08:30:59 -070042 entityPrivileges = {
43 {boost::beast::http::verb::get,
44 {{"ConfigureUsers"}, {"ConfigureManager"}}},
45 {boost::beast::http::verb::head, {{"Login"}}},
46 {boost::beast::http::verb::patch, {{"ConfigureUsers"}}},
47 {boost::beast::http::verb::put, {{"ConfigureUsers"}}},
48 {boost::beast::http::verb::delete_, {{"ConfigureUsers"}}},
49 {boost::beast::http::verb::post, {{"ConfigureUsers"}}}};
50 }
Lewanczyk, Dawid88d16c92018-02-02 14:51:09 +010051
Ed Tanous1abe55e2018-09-05 08:30:59 -070052 private:
53 void doGet(crow::Response& res, const crow::Request& req,
54 const std::vector<std::string>& params) override
55 {
56 res.jsonValue = Node::json;
57 res.end();
58 }
Lewanczyk, Dawid88d16c92018-02-02 14:51:09 +010059};
60
Ed Tanous1abe55e2018-09-05 08:30:59 -070061} // namespace redfish