31 lines
796 B
Go
31 lines
796 B
Go
package sdk
|
|
|
|
import "context"
|
|
|
|
type PythonVersion struct {
|
|
PythonVersion string `json:"python_version"`
|
|
PythonVersionInfo struct {
|
|
Major int `json:"major"`
|
|
Minor int `json:"minor"`
|
|
Micro int `json:"micro"`
|
|
ReleaseLevel string `json:"releaselevel"`
|
|
Serial int `json:"serial"`
|
|
} `json:"python_version_info"`
|
|
}
|
|
|
|
func (c *Client) PythonVersion(ctx context.Context) (*PythonVersion, error) {
|
|
var out PythonVersion
|
|
if err := c.get(ctx, "/api/sys/python_version", &out); err != nil {
|
|
return nil, err
|
|
}
|
|
return &out, nil
|
|
}
|
|
|
|
func (c *Client) Shutdown(ctx context.Context) (map[string]any, error) {
|
|
var out map[string]any
|
|
if err := c.post(ctx, "/api/sys/shutdown", map[string]any{}, &out); err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|