blob: 7af55705a5f6e1f42decf533c6f0d924972087d2 [file] [log] [blame]
#include "bmc/redfish.h"
#include <cstdint>
#include <memory>
#include <utility>
#include "bmc/http_connection.h"
#include "absl/functional/any_invocable.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "boost/asio/ip/tcp.hpp" // NOLINT(readability/boost)
#include "nlohmann/json.hpp"
#include "nlohmann/json_fwd.hpp"
namespace safepower_agent {
namespace Redfish {
namespace beast = boost::beast;
namespace http = beast::http;
void Get(absl::string_view target,
absl::AnyInvocable<void(absl::StatusOr<nlohmann::json>) &&> callback,
absl::string_view ip, uint16_t port) {
auto connection = std::make_shared<HttpConnection>();
connection->PerformConnection(http::verb::get, target, std::move(callback),
nlohmann::json{}, ip, port);
}
} // namespace Redfish
} // namespace safepower_agent