blob: 07e00fea6e34423cad9b65f9102e407cc557e632 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package octoprintApis
import (
"bytes"
"encoding/json"
// "io"
// "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels"
)
// RestartRequest restart the print of the currently selected file from the
// beginning. There must be an active print job for this to work and the print
// job must currently be paused
type RestartRequest struct{}
// Do sends an API request and returns an error if any.
func (cmd *RestartRequest) Do(c *Client) error {
payload := map[string]string{"command": "restart"}
buffer := bytes.NewBuffer(nil)
if err := json.NewEncoder(buffer).Encode(payload); err != nil {
return err
}
_, err := c.doJsonRequest("POST", JobApiUri, buffer, JobToolErrors, true)
return err
}
|