blob: 47b4c4c7b616bf95149547a028dc908213e47636 [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
20namespace redfish {
21
22class AccountService : public Node {
23 public:
Ed Tanous6c233012018-03-15 14:43:56 -070024 AccountService(CrowApp& app) : Node(app, "/redfish/v1/AccountService/") {
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +010025 Node::json["@odata.id"] = "/redfish/v1/AccountService";
26 Node::json["@odata.type"] = "#AccountService.v1_1_0.AccountService";
27 Node::json["@odata.context"] =
Lewanczyk, Dawid88d16c92018-02-02 14:51:09 +010028 "/redfish/v1/$metadata#AccountService.AccountService";
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +010029 Node::json["Id"] = "AccountService";
30 Node::json["Description"] = "BMC User Accounts";
31 Node::json["Name"] = "Account Service";
Borawski.Lukaszc1a46bd2018-02-08 13:31:59 +010032 Node::json["ServiceEnabled"] = true;
33 Node::json["MinPasswordLength"] = 1;
34 Node::json["MaxPasswordLength"] = 20;
35 Node::json["Accounts"]["@odata.id"] = "/redfish/v1/AccountService/Accounts";
36 Node::json["Roles"]["@odata.id"] = "/redfish/v1/AccountService/Roles";
Ed Tanous3ebd75f2018-03-05 18:20:01 -080037
38 entityPrivileges = {
Borawski.Lukasz4b1b8682018-04-04 12:50:16 +020039 {boost::beast::http::verb::get,
40 {{"ConfigureUsers"}, {"ConfigureManager"}}},
Ed Tanouse0d918b2018-03-27 17:41:04 -070041 {boost::beast::http::verb::head, {{"Login"}}},
42 {boost::beast::http::verb::patch, {{"ConfigureUsers"}}},
43 {boost::beast::http::verb::put, {{"ConfigureUsers"}}},
44 {boost::beast::http::verb::delete_, {{"ConfigureUsers"}}},
45 {boost::beast::http::verb::post, {{"ConfigureUsers"}}}};
Lewanczyk, Dawid88d16c92018-02-02 14:51:09 +010046 }
47
48 private:
Ed Tanous55c7b7a2018-05-22 15:27:24 -070049 void doGet(crow::Response& res, const crow::Request& req,
Lewanczyk, Dawid88d16c92018-02-02 14:51:09 +010050 const std::vector<std::string>& params) override {
Ed Tanous55c7b7a2018-05-22 15:27:24 -070051 res.jsonValue = Node::json;
Lewanczyk, Dawid88d16c92018-02-02 14:51:09 +010052 res.end();
53 }
Lewanczyk, Dawid88d16c92018-02-02 14:51:09 +010054};
55
56} // namespace redfish