RedfishLib.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /** @file
  2. This library provides a set of utility APIs that allow to create/read/update/delete
  3. (CRUD) Redfish resources and provide basic query abilities by using [URI/RedPath]
  4. (https://github.com/DMTF/libredfish).
  5. The query language is based on XPath (https://www.w3.org/TR/1999/REC-xpath-19991116/).
  6. This library and query language essentially treat the entire Redfish Service like it
  7. was a single JSON document. In other words whenever it encounters an odata.id in JSON
  8. document, it will retrieve the new JSON document (if needed). We name the path as
  9. RedPath:
  10. Expression Description
  11. nodename Selects the JSON entity with the name "nodename".
  12. If the value of nodename is an object with "@odata.id",
  13. it will continue get the value from "@odata.id".
  14. / Selects from the root node
  15. [index] Selects the index number JSON entity from an array or
  16. object. If the JSON entity is one collection (has
  17. Members & Members@odata.count), means to get the index
  18. member in "Members". Index number >=1, 1 means to return
  19. the first instance.
  20. [XXX] Operation on JSON entity.
  21. If the JSON entity is one collection (has Members &
  22. Members@odata.count), means to get all elements in
  23. "Members". If the JSON entity is one array, means to
  24. get all elements in array. Others will match the nodename
  25. directly (e.g. JSON_OBJECT, JSON_STRING, JSON_TRUE,
  26. JSON_FALSE, JSON_INTEGER).
  27. [nodename] Selects all the elements from an JSON entity that
  28. contain a property named "nodename"
  29. [name=value] Selects all the elements from an JSON entity where
  30. the property "name" is equal to "value"
  31. [name~value] Selects all the elements from an JSON entity where
  32. the string property "name" is equal to "value" using
  33. case insensitive comparison.
  34. [name<value] Selects all the elements from an JSON entity where
  35. the property "name" is less than "value"
  36. [name<=value] Selects all the elements from an JSON entity where
  37. the property "name" is less than or equal to "value"
  38. [name>value] Selects all the elements from an JSON entity where
  39. the property "name" is greater than "value"
  40. [name>=value] Selects all the elements from an JSON entity where
  41. the property "name" is greater than or equal to "value"
  42. Some examples:
  43. /v1/Chassis[1] - Will return the first Chassis instance.
  44. /v1/Chassis[SKU=1234] - Will return all Chassis instances with a SKU field equal to 1234.
  45. /v1/Systems[Storage] - Will return all the System instances that have Storage field populated.
  46. Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  47. (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
  48. SPDX-License-Identifier: BSD-2-Clause-Patent
  49. **/
  50. #ifndef REDFISH_LIB_H_
  51. #define REDFISH_LIB_H_
  52. #include <Library/JsonLib.h>
  53. #include <Protocol/Http.h>
  54. #include <Protocol/EdkIIRedfishConfigHandler.h>
  55. #define ODATA_TYPE_NAME_MAX_SIZE 128
  56. #define ODATA_TYPE_MAX_SIZE 128
  57. ///
  58. /// Library class public defines
  59. ///
  60. typedef VOID *REDFISH_SERVICE;
  61. typedef VOID *REDFISH_PAYLOAD;
  62. ///
  63. /// Library class public structures/unions
  64. ///
  65. typedef struct {
  66. EFI_HTTP_STATUS_CODE *StatusCode;
  67. UINTN HeaderCount;
  68. EFI_HTTP_HEADER *Headers;
  69. REDFISH_PAYLOAD Payload;
  70. } REDFISH_RESPONSE;
  71. ///
  72. /// Odata type-name mapping structure.
  73. ///
  74. typedef struct {
  75. CONST CHAR8 OdataTypeName[ODATA_TYPE_NAME_MAX_SIZE];
  76. CONST CHAR8 OdataType[ODATA_TYPE_MAX_SIZE];
  77. } REDFISH_ODATA_TYPE_MAPPING;
  78. /**
  79. This function uses REST EX protocol provided in RedfishConfigServiceInfo.
  80. The service enumerator will also handle the authentication flow automatically
  81. if HTTP basic auth or Redfish session login is configured to use.
  82. Callers are responsible for freeing the returned service by RedfishCleanupService().
  83. @param[in] RedfishConfigServiceInfo Redfish service information the EFI Redfish
  84. feature driver communicates with.
  85. @return New created Redfish Service, or NULL if error happens.
  86. **/
  87. REDFISH_SERVICE
  88. EFIAPI
  89. RedfishCreateService (
  90. IN REDFISH_CONFIG_SERVICE_INFORMATION *RedfishConfigServiceInfo
  91. );
  92. /**
  93. Free the Service and all its related resources.
  94. @param[in] RedfishService The Service to access the Redfish resources.
  95. **/
  96. VOID
  97. EFIAPI
  98. RedfishCleanupService (
  99. IN REDFISH_SERVICE RedfishService
  100. );
  101. /**
  102. Create REDFISH_PAYLOAD instance in local with JSON represented resource value and
  103. the Redfish Service.
  104. The returned REDFISH_PAYLOAD can be used to create or update Redfish resource in
  105. server side.
  106. Callers are responsible for freeing the returned payload by RedfishCleanupPayload().
  107. @param[in] Value JSON Value of the redfish resource.
  108. @param[in] RedfishService The Service to access the Redfish resources.
  109. @return REDFISH_PAYLOAD instance of the resource, or NULL if error happens.
  110. **/
  111. REDFISH_PAYLOAD
  112. EFIAPI
  113. RedfishCreatePayload (
  114. IN EDKII_JSON_VALUE Value,
  115. IN REDFISH_SERVICE RedfishService
  116. );
  117. /**
  118. Free the RedfishPayload and all its related resources.
  119. @param[in] Payload Payload to be freed.
  120. **/
  121. VOID
  122. EFIAPI
  123. RedfishCleanupPayload (
  124. IN REDFISH_PAYLOAD Payload
  125. );
  126. /**
  127. This function returns the decoded JSON value of a REDFISH_PAYLOAD.
  128. Caller doesn't need to free the returned JSON value because it will be released
  129. in corresponding RedfishCleanupPayload() function.
  130. @param[in] Payload A REDFISH_PAYLOAD instance.
  131. @return Decoded JSON value of the payload.
  132. **/
  133. EDKII_JSON_VALUE
  134. EFIAPI
  135. RedfishJsonInPayload (
  136. IN REDFISH_PAYLOAD Payload
  137. );
  138. /**
  139. Fill the input RedPath string with system UUID from SMBIOS table or use the customized
  140. ID if FromSmbios == FALSE.
  141. This is a helper function to build a RedPath string which can be used to address
  142. a Redfish resource for this computer system. The input PathString must have a Systems
  143. note in format of "Systems[UUID=%g]" or "Systems[UUID~%g]" to fill the UUID value.
  144. Example:
  145. Use "/v1/Systems[UUID=%g]/Bios" to build a RedPath to address the "Bios" resource
  146. for this computer system.
  147. @param[in] RedPath RedPath format to be build.
  148. @param[in] FromSmbios Get system UUID from SMBIOS as computer system instance ID.
  149. @param[in] IdString The computer system instance ID.
  150. @return Full RedPath with system UUID inside, or NULL if error happens.
  151. **/
  152. CHAR8 *
  153. EFIAPI
  154. RedfishBuildPathWithSystemUuid (
  155. IN CONST CHAR8 *RedPath,
  156. IN BOOLEAN FromSmbios,
  157. IN CHAR8 *IdString OPTIONAL
  158. );
  159. /**
  160. Get a redfish response addressed by a RedPath string, including HTTP StatusCode, Headers
  161. and Payload which record any HTTP response messages.
  162. Callers are responsible for freeing the HTTP StatusCode, Headers and Payload returned in
  163. redfish response data.
  164. @param[in] RedfishService The Service to access the Redfish resources.
  165. @param[in] RedPath RedPath string to address a resource, must start
  166. from the root node.
  167. @param[out] RedResponse Pointer to the Redfish response data.
  168. @retval EFI_SUCCESS The opeartion is successful, indicates the HTTP StatusCode is not
  169. NULL and the value is 2XX. The corresponding redfish resource has
  170. been returned in Payload within RedResponse.
  171. @retval EFI_INVALID_PARAMETER RedfishService, RedPath, or RedResponse is NULL.
  172. @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. Callers can get
  173. more error info from returned HTTP StatusCode, Headers and Payload
  174. within RedResponse:
  175. 1. If the returned Payload is NULL, indicates any error happen.
  176. 2. If the returned StatusCode is NULL, indicates any error happen.
  177. 3. If the returned StatusCode is not 2XX, indicates any error happen.
  178. **/
  179. EFI_STATUS
  180. EFIAPI
  181. RedfishGetByService (
  182. IN REDFISH_SERVICE RedfishService,
  183. IN CONST CHAR8 *RedPath,
  184. OUT REDFISH_RESPONSE *RedResponse
  185. );
  186. /**
  187. Get a redfish response addressed by URI, including HTTP StatusCode, Headers
  188. and Payload which record any HTTP response messages.
  189. Callers are responsible for freeing the HTTP StatusCode, Headers and Payload returned in
  190. redfish response data.
  191. @param[in] RedfishService The Service to access the URI resources.
  192. @param[in] URI String to address a resource.
  193. @param[out] RedResponse Pointer to the Redfish response data.
  194. @retval EFI_SUCCESS The opeartion is successful, indicates the HTTP StatusCode is not
  195. NULL and the value is 2XX. The corresponding redfish resource has
  196. been returned in Payload within RedResponse.
  197. @retval EFI_INVALID_PARAMETER RedfishService, RedPath, or RedResponse is NULL.
  198. @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. Callers can get
  199. more error info from returned HTTP StatusCode, Headers and Payload
  200. within RedResponse:
  201. 1. If the returned Payload is NULL, indicates any error happen.
  202. 2. If the returned StatusCode is NULL, indicates any error happen.
  203. 3. If the returned StatusCode is not 2XX, indicates any error happen.
  204. **/
  205. EFI_STATUS
  206. EFIAPI
  207. RedfishGetByUri (
  208. IN REDFISH_SERVICE RedfishService,
  209. IN CONST CHAR8 *Uri,
  210. OUT REDFISH_RESPONSE *RedResponse
  211. );
  212. /**
  213. Get a redfish response addressed by the input Payload and relative RedPath string,
  214. including HTTP StatusCode, Headers and Payload which record any HTTP response messages.
  215. Callers are responsible for freeing the HTTP StatusCode, Headers and Payload returned in
  216. redfish response data.
  217. @param[in] Payload A existing REDFISH_PAYLOAD instance.
  218. @param[in] RedPath Relative RedPath string to address a resource inside Payload.
  219. @param[out] RedResponse Pointer to the Redfish response data.
  220. @retval EFI_SUCCESS The opeartion is successful:
  221. 1. The HTTP StatusCode is NULL and the returned Payload in
  222. RedResponse is not NULL, indicates the Redfish resource has
  223. been parsed from the input payload directly.
  224. 2. The HTTP StatusCode is not NULL and the value is 2XX,
  225. indicates the corresponding redfish resource has been returned
  226. in Payload within RedResponse.
  227. @retval EFI_INVALID_PARAMETER Payload, RedPath, or RedResponse is NULL.
  228. @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. Callers can get
  229. more error info from returned HTTP StatusCode, Headers and Payload
  230. within RedResponse:
  231. 1. If the returned Payload is NULL, indicates any error happen.
  232. 2. If StatusCode is not NULL and the returned value of StatusCode
  233. is not 2XX, indicates any error happen.
  234. **/
  235. EFI_STATUS
  236. EFIAPI
  237. RedfishGetByPayload (
  238. IN REDFISH_PAYLOAD Payload,
  239. IN CONST CHAR8 *RedPath,
  240. OUT REDFISH_RESPONSE *RedResponse
  241. );
  242. /**
  243. Use HTTP PATCH to perform updates on pre-existing Redfish resource.
  244. This function uses the RedfishService to patch a Redfish resource addressed by
  245. Uri (only the relative path is required). Changes to one or more properties within
  246. the target resource are represented in the input Content, properties not specified
  247. in Content won't be changed by this request. The corresponding redfish response will
  248. returned, including HTTP StatusCode, Headers and Payload which record any HTTP response
  249. messages.
  250. Callers are responsible for freeing the HTTP StatusCode, Headers and Payload returned in
  251. redfish response data.
  252. @param[in] RedfishService The Service to access the Redfish resources.
  253. @param[in] Uri Relative path to address the resource.
  254. @param[in] Content JSON represented properties to be update.
  255. @param[out] RedResponse Pointer to the Redfish response data.
  256. @retval EFI_SUCCESS The opeartion is successful, indicates the HTTP StatusCode is not
  257. NULL and the value is 2XX. The Redfish resource will be returned
  258. in Payload within RedResponse if server send it back in the HTTP
  259. response message body.
  260. @retval EFI_INVALID_PARAMETER RedfishService, Uri, Content, or RedResponse is NULL.
  261. @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. Callers can get
  262. more error info from returned HTTP StatusCode, Headers and Payload
  263. within RedResponse:
  264. 1. If the returned StatusCode is NULL, indicates any error happen.
  265. 2. If the returned StatusCode is not NULL and the value is not 2XX,
  266. indicates any error happen.
  267. **/
  268. EFI_STATUS
  269. EFIAPI
  270. RedfishPatchToUri (
  271. IN REDFISH_SERVICE RedfishService,
  272. IN CONST CHAR8 *Uri,
  273. IN CONST CHAR8 *Content,
  274. OUT REDFISH_RESPONSE *RedResponse
  275. );
  276. /**
  277. Use HTTP PATCH to perform updates on target payload. Patch to odata.id in Payload directly.
  278. This function uses the Payload to patch the Target. Changes to one or more properties
  279. within the target resource are represented in the input Payload, properties not specified
  280. in Payload won't be changed by this request. The corresponding redfish response will
  281. returned, including HTTP StatusCode, Headers and Payload which record any HTTP response
  282. messages.
  283. Callers are responsible for freeing the HTTP StatusCode, Headers and Payload returned in
  284. redfish response data.
  285. @param[in] Target The target payload to be updated.
  286. @param[in] Payload Palyoad with properties to be changed.
  287. @param[out] RedResponse Pointer to the Redfish response data.
  288. @retval EFI_SUCCESS The opeartion is successful, indicates the HTTP StatusCode is not
  289. NULL and the value is 2XX. The Redfish resource will be returned
  290. in Payload within RedResponse if server send it back in the HTTP
  291. response message body.
  292. @retval EFI_INVALID_PARAMETER Target, Payload, or RedResponse is NULL.
  293. @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. Callers can get
  294. more error info from returned HTTP StatusCode, Headers and Payload
  295. within RedResponse:
  296. 1. If the returned StatusCode is NULL, indicates any error happen.
  297. 2. If the returned StatusCode is not NULL and the value is not 2XX,
  298. indicates any error happen.
  299. **/
  300. EFI_STATUS
  301. EFIAPI
  302. RedfishPatchToPayload (
  303. IN REDFISH_PAYLOAD Target,
  304. IN REDFISH_PAYLOAD Payload,
  305. OUT REDFISH_RESPONSE *RedResponse
  306. );
  307. /**
  308. Use HTTP POST to create a new resource in target payload.
  309. The POST request should be submitted to the Resource Collection in which the new resource
  310. is to belong. The Resource Collection is addressed by Target payload. The Redfish may
  311. ignore any service controlled properties. The corresponding redfish response will returned,
  312. including HTTP StatusCode, Headers and Payload which record any HTTP response messages.
  313. Callers are responsible for freeing the HTTP StatusCode, Headers and Payload returned in
  314. redfish response data.
  315. @param[in] Target Target payload of the Resource Collection.
  316. @param[in] Payload The new resource to be created.
  317. @param[out] RedResponse Pointer to the Redfish response data.
  318. @retval EFI_SUCCESS The opeartion is successful, indicates the HTTP StatusCode is not
  319. NULL and the value is 2XX. The Redfish resource will be returned
  320. in Payload within RedResponse if server send it back in the HTTP
  321. response message body.
  322. @retval EFI_INVALID_PARAMETER Target, Payload, or RedResponse is NULL.
  323. @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. Callers can get
  324. more error info from returned HTTP StatusCode, Headers and Payload
  325. within RedResponse:
  326. 1. If the returned StatusCode is NULL, indicates any error happen.
  327. 2. If the returned StatusCode is not NULL and the value is not 2XX,
  328. indicates any error happen.
  329. **/
  330. EFI_STATUS
  331. EFIAPI
  332. RedfishPostToPayload (
  333. IN REDFISH_PAYLOAD Target,
  334. IN REDFISH_PAYLOAD Payload,
  335. OUT REDFISH_RESPONSE *RedResponse
  336. );
  337. /**
  338. Use HTTP DELETE to remove a resource.
  339. This function uses the RedfishService to remove a Redfish resource which is addressed
  340. by input Uri (only the relative path is required). The corresponding redfish response will
  341. returned, including HTTP StatusCode, Headers and Payload which record any HTTP response
  342. messages.
  343. Callers are responsible for freeing the HTTP StatusCode, Headers and Payload returned in
  344. redfish response data.
  345. @param[in] RedfishService The Service to access the Redfish resources.
  346. @param[in] Uri Relative path to address the resource.
  347. @param[out] RedResponse Pointer to the Redfish response data.
  348. @retval EFI_SUCCESS The opeartion is successful, indicates the HTTP StatusCode is not
  349. NULL and the value is 2XX, the Redfish resource has been removed.
  350. If there is any message returned from server, it will be returned
  351. in Payload within RedResponse.
  352. @retval EFI_INVALID_PARAMETER RedfishService, Uri, or RedResponse is NULL.
  353. @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. Callers can get
  354. more error info from returned HTTP StatusCode, Headers and Payload
  355. within RedResponse:
  356. 1. If the returned StatusCode is NULL, indicates any error happen.
  357. 2. If the returned StatusCode is not NULL and the value is not 2XX,
  358. indicates any error happen.
  359. **/
  360. EFI_STATUS
  361. EFIAPI
  362. RedfishDeleteByUri (
  363. IN REDFISH_SERVICE RedfishService,
  364. IN CONST CHAR8 *Uri,
  365. OUT REDFISH_RESPONSE *RedResponse
  366. );
  367. /**
  368. Dump text in fractions.
  369. @param[in] String ASCII string to dump.
  370. **/
  371. VOID
  372. RedfishDumpJsonStringFractions (
  373. IN CHAR8 *String
  374. );
  375. /**
  376. Extract the JSON text content from REDFISH_PAYLOAD and dump to debug console.
  377. @param[in] Payload The Redfish payload to dump.
  378. **/
  379. VOID
  380. RedfishDumpPayload (
  381. IN REDFISH_PAYLOAD Payload
  382. );
  383. /**
  384. Dump text in JSON value.
  385. @param[in] JsonValue The Redfish JSON value to dump.
  386. **/
  387. VOID
  388. RedfishDumpJson (
  389. IN EDKII_JSON_VALUE JsonValue
  390. );
  391. /**
  392. This function will cleanup the HTTP header and Redfish payload resources.
  393. @param[in] StatusCode The status code in HTTP response message.
  394. @param[in] HeaderCount Number of HTTP header structures in Headers list.
  395. @param[in] Headers Array containing list of HTTP headers.
  396. @param[in] Payload The Redfish payload to dump.
  397. **/
  398. VOID
  399. RedfishFreeResponse (
  400. IN EFI_HTTP_STATUS_CODE *StatusCode,
  401. IN UINTN HeaderCount,
  402. IN EFI_HTTP_HEADER *Headers,
  403. IN REDFISH_PAYLOAD Payload
  404. );
  405. /**
  406. Check if the "@odata.type" in Payload is valid or not.
  407. @param[in] Payload The Redfish payload to be checked.
  408. @param[in] OdataTypeName OdataType will be retrived from mapping list.
  409. @param[in] OdataTypeMappingList The list of OdataType.
  410. @param[in] OdataTypeMappingListSize The number of mapping list
  411. @return TRUE if the "@odata.type" in Payload is valid, otherwise FALSE.
  412. **/
  413. BOOLEAN
  414. RedfishIsValidOdataType (
  415. IN REDFISH_PAYLOAD Payload,
  416. IN CONST CHAR8 *OdataTypeName,
  417. IN REDFISH_ODATA_TYPE_MAPPING *OdataTypeMappingList,
  418. IN UINTN OdataTypeMappingListSize
  419. );
  420. /**
  421. Check if the payload is collection
  422. @param[in] Payload The Redfish payload to be checked.
  423. @return TRUE if the payload is collection.
  424. **/
  425. BOOLEAN
  426. RedfishIsPayloadCollection (
  427. IN REDFISH_PAYLOAD Payload
  428. );
  429. /**
  430. Get collection size.
  431. @param[in] Payload The Redfish collection payload
  432. @param[in] CollectionSize Size of this collection
  433. @return EFI_SUCCESS Coolection size is returned in CollectionSize
  434. @return EFI_INVALID_PARAMETER The payload is not a collection.
  435. **/
  436. EFI_STATUS
  437. RedfishGetCollectionSize (
  438. IN REDFISH_PAYLOAD Payload,
  439. IN UINTN *CollectionSize
  440. );
  441. /**
  442. Get Redfish payload of collection member
  443. @param[in] Payload The Redfish collection payload
  444. @param[in] Index Index of collection member
  445. @return NULL Fail to get collection member.
  446. @return Non NULL Payload is returned.
  447. **/
  448. REDFISH_PAYLOAD
  449. RedfishGetPayloadByIndex (
  450. IN REDFISH_PAYLOAD Payload,
  451. IN UINTN Index
  452. );
  453. /**
  454. Check and return Redfish resource of the given Redpath.
  455. @param[in] RedfishService Pointer to REDFISH_SERVICE
  456. @param[in] Redpath Redpath of the resource.
  457. @param[in] Response Optional return the resource.
  458. @return EFI_STATUS
  459. **/
  460. EFI_STATUS
  461. RedfishCheckIfRedpathExist (
  462. IN REDFISH_SERVICE RedfishService,
  463. IN CHAR8 *Redpath,
  464. IN REDFISH_RESPONSE *Response OPTIONAL
  465. );
  466. /**
  467. This function returns the string of Redfish service version.
  468. @param[in] RedfishService Redfish service instance.
  469. @param[out] ServiceVersionStr Redfish service string.
  470. @return EFI_STATUS
  471. **/
  472. EFI_STATUS
  473. RedfishGetServiceVersion (
  474. IN REDFISH_SERVICE RedfishService,
  475. OUT CHAR8 **ServiceVersionStr
  476. );
  477. /**
  478. This function returns the string of Redfish service version.
  479. @param[in] ServiceVerisonStr The string of Redfish service version.
  480. @param[in] Url The URL to build Redpath with ID.
  481. Start with "/", for example "/Registries"
  482. @param[in] Id ID string
  483. @param[out] Redpath Pointer to retrive Redpath, caller has to free
  484. the memory allocated for this string.
  485. @return EFI_STATUS
  486. **/
  487. EFI_STATUS
  488. RedfishBuildRedpathUseId (
  489. IN CHAR8 *ServiceVerisonStr,
  490. IN CHAR8 *Url,
  491. IN CHAR8 *Id,
  492. OUT CHAR8 **Redpath
  493. );
  494. #endif