54 lines
1.9 KiB
C
54 lines
1.9 KiB
C
#ifndef __INCLUDE_REDFISHUTIL_H__
|
|
#define __INCLUDE_REDFISHUTIL_H__
|
|
|
|
/*
|
|
* Copyright (c) 2017 Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* Starling-X Common Redfish Utilities Header
|
|
*/
|
|
|
|
#include "bmcUtil.h" /* for ... mtce-common bmc utility header */
|
|
|
|
#define REDFISHTOOL_PATH_AND_FILENAME ((const char *)("/usr/bin/redfishtool"))
|
|
#define REDFISHTOOL_OUTPUT_DIR ((const char *)("/var/run/bmc/redfishtool/"))
|
|
|
|
#define REDFISH_LABEL__FW_VERSION ((const char *)("RedfishVersion"))
|
|
#define REDFISH_MIN_MAJOR_VERSION (1)
|
|
|
|
#define REDFISHTOOL_ROOT_QUERY_CMD ((const char *)("root"))
|
|
#define REDFISHTOOL_BMC_INFO_CMD ((const char *)("Systems get"))
|
|
#define REDFISHTOOL_POWER_RESET_CMD ((const char *)("Systems reset GracefulRestart"))
|
|
#define REDFISHTOOL_POWER_ON_CMD ((const char *)("Systems reset On"))
|
|
#define REDFISHTOOL_POWER_OFF_CMD ((const char *)("Systems reset ForceOff"))
|
|
#define REDFISHTOOL_BOOTDEV_PXE_CMD ((const char *)("Systems setBootOverride Once Pxe"))
|
|
|
|
|
|
/* no support response string
|
|
*
|
|
* redfishtool:Transport: Response Error: status_code: 404 -- Not Found
|
|
*
|
|
*/
|
|
#define REDFISHTOOL_RESPONSE_ERROR ((const char *)("Response Error"))
|
|
#define REDFISHTOOL_ERROR_STATUS_CODE__NOT_FOUND ((const char *)("status_code: 404"))
|
|
#define REDFISHTOOL_ERROR_STATUS_CODE__NOT_ALLOWED ((const char *)("status_code: 405"))
|
|
|
|
/* module init */
|
|
int redfishUtil_init ( void );
|
|
|
|
/* create a redfish tool thread request */
|
|
string redfishUtil_create_request ( string cmd,
|
|
string & ip,
|
|
string & config_file,
|
|
string & out );
|
|
|
|
/* interpret redfish root query response and check version */
|
|
bool redfishUtil_is_supported ( string & hostname, string & root_query_response );
|
|
|
|
#endif // __INCLUDE_REDFISHUTIL_H__
|