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 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. /config/mac_address:
  60. get:
  61. operation: get_mac_address
  62. summary: Retrieves current mac address (in the configuration)
  63. responses:
  64. '200':
  65. description: The mac address value
  66. content:
  67. text/plain:
  68. examples: 00:11:22:33:44:55
  69. post:
  70. operation: set_mac_address
  71. summary: Sets current mac address (in the configuration)
  72. content:
  73. text/plain:
  74. description: If empty, sets to machine current mac
  75. examples:
  76. ff:ee:dd:cc:bb:aa
  77. responses:
  78. '200':
  79. description: The mac address value
  80. content:
  81. examples: 00:11:22:33:44:55
  82. /config/last_update:
  83. get:
  84. operation: get_last_update
  85. summary: Retrieves heatpump.last_update current value (in the configuration)
  86. responses:
  87. '200':
  88. description: The last update timestamp
  89. content:
  90. text/plain:
  91. examples: 00:11:22:33:44:55
  92. post:
  93. operation: set_last_update
  94. summary: Sets heatpump.last_update value (in the configuration)
  95. content:
  96. text/plain:
  97. description: If 0, sets to current time
  98. If < 0, sets to +x seconds
  99. If > 0, sets to -x seconds
  100. examples:
  101. 0
  102. responses:
  103. '200':
  104. description: The last_update timestamp
  105. content:
  106. examples: 1600205650
  107. /variable_types:
  108. get:
  109. operation: get_variable_types
  110. summary: Retrieves the list of variable types and their parameters
  111. responses:
  112. '200':
  113. description: The variable types details, as described in the database tab var_types
  114. content:
  115. application/json:
  116. examples:
  117. variableTypes:
  118. analog:
  119. slabel: A
  120. type: float
  121. start_address: 0
  122. end_address: 250
  123. integer:
  124. slabel: I
  125. type: int
  126. start_address: 0
  127. end_address: 250
  128. digital:
  129. slabel: D
  130. type: boolean
  131. start_address: 0
  132. end_address: 250
  133. set:
  134. operation: set_variable_types
  135. summary: Retrieves the list of variable types and their parameters
  136. content:
  137. application/json:
  138. examples:
  139. variableTypes:
  140. analog:
  141. slabel: A
  142. type: float
  143. start_address: 0
  144. end_address: 250
  145. integer:
  146. slabel: I
  147. type: int
  148. start_address: 0
  149. end_address: 250
  150. digital:
  151. slabel: D
  152. type: boolean
  153. start_address: 0
  154. end_address: 250
  155. responses:
  156. '200':
  157. description: The variable types details were correctly set.
  158. /variables:
  159. get:
  160. operation: get_variables
  161. summary: Retrieves a list of variables, by type
  162. parameters:
  163. changed:
  164. description: List only variables where values changed since last fetch
  165. errored:
  166. description: Listen only variables that the program was unable to fetch
  167. responses:
  168. '200':
  169. application/json:
  170. description: List of the variables
  171. examples:
  172. variablesList:
  173. A:
  174. - 42: 34
  175. - 24: 43
  176. I:
  177. - 4200: 777
  178. post:
  179. operation: set_variables
  180. summary: Make changes to some variables
  181. content:
  182. application/json:
  183. description: List of the changes to make
  184. examples:
  185. variablesToSet:
  186. A:
  187. 42: 34
  188. 24: 43
  189. I:
  190. 4200: 777
  191. D:
  192. 100: 1
  193. 200: 0
  194. responses:
  195. '500':
  196. description: Some variables cannot be set
  197. content:
  198. examples:
  199. variablesErrored:
  200. A:
  201. - 42
  202. - 24
  203. I:
  204. - 4200
  205. - 420