blob: 4978b083a8161817bdfcc289067f7fea2f888324 [file] [log] [blame]
/*
// Copyright (c) 2018 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
*/
#pragma once
#include "app.hpp"
namespace redfish
{
using BootTimeCheckpoint = std::tuple<std::string, int64_t, int64_t>;
using BootTimeDuration = std::tuple<std::string, int64_t>;
enum class DumpType {
BMC_DUMP = 0,
SYSTEM_DUMP,
BMC_FAULT_LOG,
SYSTEM_FAULT_LOG,
};
// The index of the string is the integer value of the DumpType enum
constexpr std::array<std::string_view, 4> dumpTypeStrings {{
"BMC",
"System",
"FaultLog",
"FaultLog"
}};
struct Dump {
DumpType type;
std::optional<std::string> systemName = std::nullopt;
};
enum class BootTimeDataType
{
CHECKPOINT,
DURATION,
STATISTIC
};
constexpr std::array<std::string_view, 3> bootTimeDataTypeString{
{"Checkpoint", "Duration", "Statistic"}};
std::string dumpTypeToString(DumpType dumpType);
inline std::string bootTimeDataTypeToString(const BootTimeDataType dataType);
namespace internal
{
void getDumpServiceInfo(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const Dump& dump);
}
void requestRoutesSystemLogServiceCollection(App& app);
void requestRoutesEventLogService(App& app);
void requestRoutesJournalEventLogClear(App& app);
void requestRoutesJournalEventLogEntryCollection(App& app);
void requestRoutesJournalEventLogEntry(App& app);
void requestRoutesDBusEventLogEntryCollection(App& app);
void requestRoutesDBusEventLogEntry(App& app);
void requestRoutesDBusEventLogEntryDownload(App& app);
void requestRoutesSystemHostLogger(App& app);
void requestRoutesSystemHostLoggerCollection(App& app);
void requestRoutesSystemHostLoggerLogEntry(App& app);
void requestRoutesBMCLogServiceCollection(App& app);
void requestRoutesBMCJournalLogService(App& app);
void requestRoutesBMCJournalLogEntryCollection(App& app);
void requestRoutesBMCJournalLogEntry(App& app);
void requestRoutesBMCDumpService(App& app);
void requestRoutesBMCDumpEntryCollection(App& app);
void requestRoutesBMCDumpEntry(App& app);
void requestRoutesBMCDumpEntryDownload(App& app);
void requestRoutesBMCDumpCreate(App& app);
void requestRoutesBMCDumpClear(App& app);
void requestRoutesFaultLogDumpService(App& app);
void requestRoutesFaultLogDumpEntryCollection(App& app);
void requestRoutesFaultLogDumpEntry(App& app);
void requestRoutesFaultLogDumpClear(App& app);
void requestRoutesSystemDumpService(App& app);
void requestRoutesSystemDumpEntryCollection(App& app);
void requestRoutesSystemDumpEntry(App& app);
void requestRoutesSystemDumpCreate(App& app);
void requestRoutesSystemDumpClear(App& app);
void requestRoutesCrashdumpService(App& app);
void requestRoutesCrashdumpClear(App& app);
void requestRoutesCrashdumpEntryCollection(App& app);
void requestRoutesCrashdumpEntry(App& app);
void requestRoutesCrashdumpFile(App& app);
void requestRoutesCrashdumpCollect(App& app);
void requestRoutesDBusLogServiceActionsClear(App& app);
void requestRoutesPostCodesLogService(App& app);
void requestRoutesPostCodesClear(App& app);
void requestRoutesPostCodesEntryCollection(App& app);
void requestRoutesPostCodesEntryAdditionalData(App& app);
void requestRoutesPostCodesEntry(App& app);
void handleSystemBootTimeLogServiceGet(
App& app, const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& systemName);
void handleManagerBootTimeLogServiceGet(
App& app, const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp);
void handleSystemBootTimeLogsEntryCollectionGet(
App& app, const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& systemName);
void handleManagerBootTimeLogsEntryCollectionGet(
App& app, const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp);
void requestRoutesBootTimeLogService(App& app);
void requestRoutesBootTimeLogEntryCollection(App& app);
void handleSystemBootTimeLogsEntryGet(
App& app, const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& systemName, const std::string& entryId);
void handleManagerBootTimeLogsEntryGet(
App& app, const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& entryId);
void requestRoutesBootTimeLogEntry(App& app);
} // namespace redfish