proxmox

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeProxmox

func InitializeProxmox()

Types

type ACLRequest

type ACLRequest struct {
	Path   string `json:"path"`
	Role   string `json:"role"`
	AuthId string `json:"auth-id"`
}

type APIToken

type APIToken struct {
	TokenId string `json:"tokenid"`
	Value   string `json:"value"`
}

func GetAPITokenFromFile

func GetAPITokenFromFile() (*APIToken, error)

func (*APIToken) SaveToFile

func (token *APIToken) SaveToFile() error

type APITokenRequest

type APITokenRequest struct {
	Comment string `json:"comment"`
}

type APITokenResponse

type APITokenResponse struct {
	Data APIToken `json:"data"`
}

type PBSStatus

type PBSStatus struct {
	BootInfo      map[string]interface{} `json:"boot-info"`
	CPU           float64                `json:"cpu"`
	CPUInfo       map[string]interface{} `json:"cpuinfo"`
	CurrentKernel map[string]interface{} `json:"current-kernel"`
	Info          map[string]string      `json:"info"`
	KVersion      string                 `json:"kversion"`
	LoadAvg       []float32              `json:"loadavg"`
	Memory        map[string]int64       `json:"memory"`
	Root          map[string]int64       `json:"root"`
	Swap          map[string]int64       `json:"swap"`
	Uptime        int64                  `json:"uptime"`
	Wait          float32                `json:"wait"`
}

type PBSStatusResponse

type PBSStatusResponse struct {
	Data PBSStatus `json:"data"`
}

type ProxmoxSession

type ProxmoxSession struct {
	LastToken  *Token
	APIToken   *APIToken
	HTTPClient *http.Client
}
var Session *ProxmoxSession

func (*ProxmoxSession) CreateAPIToken

func (proxmoxSess *ProxmoxSession) CreateAPIToken() (*APIToken, error)

func (*ProxmoxSession) GetJobTask

func (proxmoxSess *ProxmoxSession) GetJobTask(ctx context.Context, readyChan chan struct{}, job *types.Job, target *types.Target) (*Task, error)

func (*ProxmoxSession) GetPBSStatus

func (proxmoxSess *ProxmoxSession) GetPBSStatus() (*PBSStatus, error)

func (*ProxmoxSession) GetTaskByUPID

func (proxmoxSess *ProxmoxSession) GetTaskByUPID(upid string) (*Task, error)

func (*ProxmoxSession) GetTaskEndTime

func (proxmoxSess *ProxmoxSession) GetTaskEndTime(task *Task) (int64, error)

func (*ProxmoxSession) ProxmoxHTTPRequest

func (proxmoxSess *ProxmoxSession) ProxmoxHTTPRequest(method, url string, body io.Reader, respBody any) error

type Task

type Task struct {
	WID        string `json:"id"`
	Node       string `json:"node"`
	PID        int    `json:"pid"`
	PStart     int    `json:"pstart"`
	StartTime  int64  `json:"starttime"`
	EndTime    int64  `json:"endtime"`
	UPID       string `json:"upid"`
	User       string `json:"user"`
	WorkerType string `json:"worker_type"`
	Status     string `json:"status"`
	ExitStatus string `json:"exitstatus"`
}

type TaskResponse

type TaskResponse struct {
	Data  Task `json:"data"`
	Total int  `json:"total"`
}

type Token

type Token struct {
	CSRFToken string `json:"CSRFPreventionToken"`
	Ticket    string `json:"ticket"`
	Username  string `json:"username"`
}

type TokenRequest

type TokenRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type TokenResponse

type TokenResponse struct {
	Data Token `json:"data"`
}

Jump to

Keyboard shortcuts

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