metrics

package
v0.71.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: MPL-2.0 Imports: 4 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 {
	api.Client
}

Client is an interface for accessing the Proxmox metrics management API.

func (*Client) CreateServer

func (c *Client) CreateServer(ctx context.Context, data *ServerRequestData) error

CreateServer creates the metrics server.

func (*Client) DeleteServer

func (c *Client) DeleteServer(ctx context.Context, id string) error

DeleteServer deletes the metrics server.

func (*Client) ExpandPath

func (c *Client) ExpandPath(path string) string

ExpandPath expands a relative path to the Proxmox metrics server management API path.

func (*Client) GetServer

func (c *Client) GetServer(ctx context.Context, id string) (*ServerData, error)

GetServer retrieves the metrics server data.

func (*Client) GetServers

func (c *Client) GetServers(ctx context.Context) (*[]ServerData, error)

GetServers lists the metrics servers.

func (*Client) UpdateServer

func (c *Client) UpdateServer(ctx context.Context, data *ServerRequestData) error

UpdateServer updates the metrics server.

type ServerData

type ServerData struct {
	Disable *int64  `json:"disable,omitempty" url:"disable,omitempty"`
	ID      string  `json:"id,omitempty"      url:"id,omitempty"`
	MTU     *int64  `json:"mtu"               url:"mtu,omitempty"`
	Port    int64   `json:"port"              url:"port"`
	Server  string  `json:"server"            url:"server"`
	Timeout *int64  `json:"timeout,omitempty" url:"timeout,omitempty"`
	Type    *string `json:"type,omitempty"    url:"type,omitempty"`

	// influxdb only options
	APIPathPrefix *string `json:"api-path-prefix,omitempty"    url:"api-path-prefix,omitempty"`
	Bucket        *string `json:"bucket,omitempty"             url:"bucket,omitempty"`
	InfluxDBProto *string `json:"influxdbproto,omitempty"      url:"influxdbproto,omitempty"`
	MaxBodySize   *int64  `json:"max-body-size,omitempty"      url:"max-body-size,omitempty"`
	Organization  *string `json:"organization,omitempty"       url:"organization,omitempty"`
	Token         *string `json:"token,omitempty"              url:"token,omitempty"`
	Verify        *int64  `json:"verify-certificate,omitempty" url:"verify-certificate,omitempty"`

	// graphite only options
	Path  *string `json:"path,omitempty"  url:"path,omitempty"`
	Proto *string `json:"proto,omitempty" url:"proto,omitempty"`
}

ServerData contains the data from a metrics server response.

type ServerRequestData

type ServerRequestData struct {
	ServerData
	Delete *[]string `url:"delete,omitempty"`
}

ServerRequestData contains the data for a metric server post/put request.

type ServerResponseBody

type ServerResponseBody struct {
	Data *ServerData `json:"data,omitempty"`
}

ServerResponseBody contains the body from a metrics server response.

type ServersResponseBody

type ServersResponseBody struct {
	Data *[]ServerData `json:"data,omitempty"`
}

ServersResponseBody contains the body from a metrics server list response.

Jump to

Keyboard shortcuts

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