rest

package
v2.0.0-...-27a1933 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout    = "1m"
	DefaultAPIVersion = "3"
)

Variables

View Source
var NewClientFunc = NewClient

Functions

This section is empty.

Types

type Client

type Client struct {
	Logger *slog.Logger

	Remote conf.Remote

	Timeout time.Duration

	APIPath string

	Metadata *util.Metadata
	// contains filtered or unexported fields
}

func New

func New(poller *conf.Poller, timeout time.Duration, c *auth.Credentials) (*Client, error)

func NewClient

func NewClient(pollerName string, clientTimeout string, c *auth.Credentials) (*Client, error)

func NewDummyClient

func NewDummyClient() *Client

NewDummyClient creates a new dummy client

func (*Client) Fetch

func (c *Client) Fetch(request string, result *[]gjson.Result) error

Fetch makes a REST request to the cluster and stores the parsed JSON in result

func (*Client) GetGridRest

func (c *Client) GetGridRest(request string) ([]byte, error)

GetGridRest makes a grid API request to the cluster and returns a json response as a []byte see also Fetch

func (*Client) GetMetricQuery

func (c *Client) GetMetricQuery(metric string, result *[]gjson.Result) error

GetMetricQuery makes a metrics API request to the cluster and fills the result argument

func (*Client) Init

func (c *Client) Init(retries int, remote conf.Remote) error

Init is responsible for determining the StorageGrid server version, API version, hostname, and systemId

func (*Client) SetVersion

func (c *Client) SetVersion(v string) error

func (*Client) TraceLogSet

func (c *Client) TraceLogSet(collectorName string, config *node.Node)

Jump to

Keyboard shortcuts

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