api

package
v0.0.0-...-9988eaa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	APITokenID     string
	APITokenSecret string
	BaseURL        string
	HTTPClient     *http.Client
}

Client is in charge of interacting with a proxmox server

func NewClient

func NewClient(baseurl string, tokenid string, tokensecret string) *Client

func (*Client) Shutdown

func (client *Client) Shutdown(node string, lxc string) error

Shutdown the LXC container given in parameters

func (*Client) Start

func (client *Client) Start(node string, lxc string) error

func (*Client) Status

func (client *Client) Status(node string, lxc string) (LXCStatusResponse, error)

Get Status of lxc id given

type LXCStatusResponse

type LXCStatusResponse struct {
	Data struct {
		Uptime int     `json:"uptime"`
		Status string  `json:"status"`
		CPU    float64 `json:"cpu"`
		Swap   int     `json:"swap"`
		Maxmem int     `json:"maxmem"`
		Tags   string  `json:"tags"`
		Pid    int     `json:"pid"`
		Ha     struct {
			Managed int `json:"managed"`
		} `json:"ha"`
		Type      string `json:"type"`
		Disk      int    `json:"disk"`
		Maxswap   int    `json:"maxswap"`
		Name      string `json:"name"`
		Cpus      int    `json:"cpus"`
		Diskwrite int    `json:"diskwrite"`
		Netout    int    `json:"netout"`
		Diskread  int64  `json:"diskread"`
		Netin     int    `json:"netin"`
		Maxdisk   int64  `json:"maxdisk"`
		Vmid      int    `json:"vmid"`
		Mem       int    `json:"mem"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL