redfishPayload.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /** @file
  2. This file is cloned from DMTF libredfish library tag v1.0.0 and maintained
  3. by EDKII.
  4. //----------------------------------------------------------------------------
  5. // Copyright Notice:
  6. // Copyright 2017 Distributed Management Task Force, Inc. All rights reserved.
  7. // License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libredfish/LICENSE.md
  8. //----------------------------------------------------------------------------
  9. Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  10. (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
  11. SPDX-License-Identifier: BSD-2-Clause-Patent
  12. **/
  13. #ifndef LIBREDFISH_REDFISH_PAYLOAD_H_
  14. #define LIBREDFISH_REDFISH_PAYLOAD_H_
  15. #include <Include/Library/RedfishCrtLib.h>
  16. #include <jansson.h>
  17. #include <redfishService.h>
  18. #include <redpath.h>
  19. redfishPayload *
  20. createRedfishPayload (
  21. json_t *value,
  22. redfishService *service
  23. );
  24. redfishPayload *
  25. getPayloadByNodeName (
  26. redfishPayload *payload,
  27. const char *nodeName,
  28. EFI_HTTP_STATUS_CODE **StatusCode
  29. );
  30. redfishPayload *
  31. getPayloadByIndex (
  32. redfishPayload *payload,
  33. size_t index,
  34. EFI_HTTP_STATUS_CODE **StatusCode
  35. );
  36. redfishPayload *
  37. getPayloadForPath (
  38. redfishPayload *payload,
  39. redPathNode *redpath,
  40. EFI_HTTP_STATUS_CODE **StatusCode
  41. );
  42. redfishPayload *
  43. getPayloadForPathString (
  44. redfishPayload *payload,
  45. const char *string,
  46. EFI_HTTP_STATUS_CODE **StatusCode
  47. );
  48. redfishPayload *
  49. patchPayload (
  50. redfishPayload *target,
  51. redfishPayload *payload,
  52. EFI_HTTP_STATUS_CODE **StatusCode
  53. );
  54. redfishPayload *
  55. postContentToPayload (
  56. redfishPayload *target,
  57. const char *data,
  58. size_t dataSize,
  59. const char *contentType,
  60. EFI_HTTP_STATUS_CODE **StatusCode
  61. );
  62. redfishPayload *
  63. postPayload (
  64. redfishPayload *target,
  65. redfishPayload *payload,
  66. EFI_HTTP_STATUS_CODE **StatusCode
  67. );
  68. void
  69. cleanupPayload (
  70. redfishPayload *payload
  71. );
  72. bool
  73. isPayloadCollection (
  74. redfishPayload *Payload
  75. );
  76. size_t
  77. getCollectionSize (
  78. redfishPayload *payload
  79. );
  80. redfishPayload *
  81. getPayloadByIndex (
  82. redfishPayload *payload,
  83. size_t index,
  84. EFI_HTTP_STATUS_CODE **StatusCode
  85. );
  86. #endif