more knecht

This commit is contained in:
2026-04-04 15:17:33 +02:00
parent b4fddbb5b6
commit 397cbea7fb
6 changed files with 194 additions and 12 deletions

View File

@@ -147,6 +147,24 @@ func (c *Client) CreateStack(name, composeContent string, env []EnvVar) (*Stack,
return &s, nil
}
func (c *Client) StopStack(id int) error {
resp, err := c.do("POST", fmt.Sprintf("/api/stacks/%d/stop?endpointId=%d", id, c.endpointID), nil)
if err != nil {
return err
}
resp.Body.Close()
return nil
}
func (c *Client) StartStack(id int) error {
resp, err := c.do("POST", fmt.Sprintf("/api/stacks/%d/start?endpointId=%d", id, c.endpointID), nil)
if err != nil {
return err
}
resp.Body.Close()
return nil
}
func (c *Client) UpdateStack(id int, composeContent string, env []EnvVar) (*Stack, error) {
body := map[string]any{
"stackFileContent": composeContent,