Projet de remplacement du "RPiPasserelle" d'Otec.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openapi.yaml 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. openapi: "3.0.0"
  2. info:
  3. title: PyHeatpump API specifications
  4. version: 0.1.0
  5. paths:
  6. /:
  7. get:
  8. operation: get_specs
  9. summary: List API specs (read this file)
  10. responses:
  11. '200':
  12. description: 200 response
  13. content:
  14. application/json:
  15. examples:
  16. value:
  17. [route1, route2, ..., routeN]
  18. /config:
  19. get:
  20. operation: get_config
  21. summary: Retrieves current configuration values
  22. responses:
  23. '200':
  24. description: The dictionary of configuration
  25. content:
  26. application/json:
  27. examples:
  28. configuration:
  29. heatpump:
  30. option: value
  31. supervisor:
  32. option: value
  33. '500':
  34. description: Failed to get configuration
  35. post:
  36. operation: set_config
  37. summary: Sets the configuration values
  38. content:
  39. application/json:
  40. examples:
  41. valuesToSet:
  42. heatpump:
  43. database: memory
  44. supervisor:
  45. scheme: https
  46. host: supervision.gteo.fr:8081
  47. text/plain:
  48. examples:
  49. valuesToSet: heatpump.serial_port=/dev/serial0
  50. responses:
  51. '200':
  52. description: Setting configuration succeeded
  53. '403':
  54. description: Setting configuration forbidden
  55. '404':
  56. description: Specified setting does not exists
  57. '415':
  58. description: Sent data cannot be treated
  59. /variable_types:
  60. get:
  61. operation: get_variable_types
  62. summary: Retrieves the list of variable types and their parameters
  63. responses:
  64. '200':
  65. description: The variable types details, as described in the database tab var_types
  66. content:
  67. application/json:
  68. examples:
  69. variableTypes:
  70. analog:
  71. slabel: A
  72. type: float
  73. start_address: 0
  74. end_address: 250
  75. integer:
  76. slabel: I
  77. type: int
  78. start_address: 0
  79. end_address: 250
  80. digital:
  81. slabel: D
  82. type: boolean
  83. start_address: 0
  84. end_address: 250
  85. set:
  86. operation: set_variable_types
  87. summary: Retrieves the list of variable types and their parameters
  88. content:
  89. application/json:
  90. examples:
  91. variableTypes:
  92. analog:
  93. slabel: A
  94. type: float
  95. start_address: 0
  96. end_address: 250
  97. integer:
  98. slabel: I
  99. type: int
  100. start_address: 0
  101. end_address: 250
  102. digital:
  103. slabel: D
  104. type: boolean
  105. start_address: 0
  106. end_address: 250
  107. responses:
  108. '200':
  109. description: The variable types details were correctly set.
  110. /variables:
  111. get:
  112. operation: get_variables
  113. summary: Retrieves a list of variables, by type
  114. parameters:
  115. changed:
  116. description: List only variables where values changed since last fetch
  117. errored:
  118. description: Listen only variables that the program was unable to fetch
  119. responses:
  120. '200':
  121. application/json:
  122. description: List of the variables
  123. examples:
  124. variablesList:
  125. A:
  126. - 42: 34
  127. - 24: 43
  128. I:
  129. - 4200: 777
  130. post:
  131. operation: set_variables
  132. summary: Make changes to some variables
  133. content:
  134. application/json:
  135. description: List of the changes to make
  136. examples:
  137. variablesToSet:
  138. A:
  139. 42: 34
  140. 24: 43
  141. I:
  142. 4200: 777
  143. D:
  144. 100: 1
  145. 200: 0
  146. responses:
  147. '500':
  148. description: Some variables cannot be set
  149. content:
  150. examples:
  151. variablesErrored:
  152. A:
  153. - 42
  154. - 24
  155. I:
  156. - 4200
  157. - 420