mirror of https://github.com/pikvm/pikvm.git
				
				
				
			Update api.md
This commit is contained in:
		
							parent
							
								
									6a05d13506
								
							
						
					
					
						commit
						2f023de72a
					
				
							
								
								
									
										29
									
								
								pages/api.md
								
								
								
								
							
							
						
						
									
										29
									
								
								pages/api.md
								
								
								
								
							|  | @ -168,19 +168,40 @@ Each category is represented by its own event in the websocket (`info_hw_state`, | ||||||
| On `GET` this handle will display messages from all KVMD services as plain text. The `follow=1` request parameter turns the request into an infinite one and you will receive new log messages in real time. The seek parameter runs the log for the specified time in seconds. For example, `seek=3600` will show the log for the last hour. Both the `seek` and `follow` parameters can be used together. | On `GET` this handle will display messages from all KVMD services as plain text. The `follow=1` request parameter turns the request into an infinite one and you will receive new log messages in real time. The seek parameter runs the log for the specified time in seconds. For example, `seek=3600` will show the log for the last hour. Both the `seek` and `follow` parameters can be used together. | ||||||
| 
 | 
 | ||||||
| ## Get ATX state: `/api/atx` | ## Get ATX state: `/api/atx` | ||||||
| On `GET` it will show current ATX state | On `GET` it will show current ATX state. | ||||||
|  | <details> | ||||||
|  |     <summary>Example</summary> | ||||||
|  | 
 | ||||||
|  | ```js | ||||||
|  | { | ||||||
|  |     "ok": true, | ||||||
|  |     "result": { | ||||||
|  |         "busy": false, // True if ATX is busy performing an operation and does not accept commands | ||||||
|  |         "enabled": true, | ||||||
|  |         "leds": { | ||||||
|  |             "hdd": false, | ||||||
|  |             "power": false | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | </details> | ||||||
| 
 | 
 | ||||||
| ## Set ATX PSU state: `/api/atx/power` | ## Set ATX PSU state: `/api/atx/power` | ||||||
| On `POST` it will change ATX power supply state to desired. | On `POST` it will change ATX power supply state to desired. | ||||||
| Parameters: | Parameters: | ||||||
| - `action` describes desired state: `on` — turned on (do nothing in case PSU is already on), `off` — turned off (aka soft-off). Emulates short-press on POWER button, `off_hard` — will emulate long (4+ seconds) press on power button, `reset_hard` — emulates pressing RESET button (hardware cold reset) | - `action` describes desired state: | ||||||
| - `wait` Boolean. Says if call should return immediately or just after finishing operation |   * `on` - turned on (do nothing in case PSU is already on); | ||||||
|  |   * `off` - turned off (aka soft-off), emulates short-press on the power button; | ||||||
|  |   * `off_hard` - emulates long (5+ seconds) press on the power button; | ||||||
|  |   * `reset_hard`  emulates pressing reset button (hardware hot reset). | ||||||
|  | - `wait` - boolean. Says if call should return immediately or just after finishing operation. | ||||||
| 
 | 
 | ||||||
| ## Emulate pressing buttons on computer case: `/api/atx/click` | ## Emulate pressing buttons on computer case: `/api/atx/click` | ||||||
| On `POST` send button press events to {front-}panel header (like you pressing buttins on your computer's case). | On `POST` send button press events to {front-}panel header (like you pressing buttins on your computer's case). | ||||||
| Parameters: | Parameters: | ||||||
| - `button` specifies the desired computer case button you would like to press. Currently supported options are: `power` — for short press on power button, `power_long` — for pressing POWER button for 4+ seconds (force OFF), `reset` — to initiate cold-reset | - `button` specifies the desired computer case button you would like to press. Currently supported options are: `power` — for short press on power button, `power_long` — for pressing POWER button for 4+ seconds (force OFF), `reset` — to initiate cold-reset | ||||||
| - `wait` Boolean. Says if call should return immediately or just after finishing operation | - `wait` Boolean. Says if call should return immediately or just after finishing operation. | ||||||
| 
 | 
 | ||||||
| # To be continued ===> | # To be continued ===> | ||||||
| Unfortunately, the developer doesn't have enough time to fully describe the API. You can find all existing APIs in the [KVMD source tree](https://github.com/pikvm/kvmd/tree/master/kvmd/apps/kvmd/api). We would appreciate your help with documentation. | Unfortunately, the developer doesn't have enough time to fully describe the API. You can find all existing APIs in the [KVMD source tree](https://github.com/pikvm/kvmd/tree/master/kvmd/apps/kvmd/api). We would appreciate your help with documentation. | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue