cadvisor: github.com/google/cadvisor/client Index | Files | Directories

package client

import "github.com/google/cadvisor/client"

This is an implementation of a cAdvisor REST API in Go. To use it, create a client (replace the URL with your actual cAdvisor REST endpoint):

client, err := client.NewClient("http://192.168.59.103:8080/")

Then, the client interface exposes go methods corresponding to the REST endpoints.

Index

Package Files

client.go

type Client Uses

type Client struct {
    // contains filtered or unexported fields
}

Client represents the base URL for a cAdvisor client.

func NewClient Uses

func NewClient(url string) (*Client, error)

NewClient returns a new v1.3 client with the specified base URL.

func (*Client) AllDockerContainers Uses

func (c *Client) AllDockerContainers(query *v1.ContainerInfoRequest) (cinfo []v1.ContainerInfo, err error)

Returns the JSON container information for all Docker containers.

func (*Client) ContainerInfo Uses

func (c *Client) ContainerInfo(name string, query *v1.ContainerInfoRequest) (cinfo *v1.ContainerInfo, err error)

ContainerInfo returns the JSON container information for the specified container and request.

func (*Client) DockerContainer Uses

func (c *Client) DockerContainer(name string, query *v1.ContainerInfoRequest) (cinfo v1.ContainerInfo, err error)

Returns the JSON container information for the specified Docker container and request.

func (*Client) EventStaticInfo Uses

func (c *Client) EventStaticInfo(name string) (einfo []*v1.Event, err error)

Returns all past events that satisfy the request

func (*Client) EventStreamingInfo Uses

func (c *Client) EventStreamingInfo(name string, einfo chan *v1.Event) (err error)

Streams all events that occur that satisfy the request into the channel that is passed

func (*Client) MachineInfo Uses

func (c *Client) MachineInfo() (minfo *v1.MachineInfo, err error)

MachineInfo returns the JSON machine information for this client. A non-nil error result indicates a problem with obtaining the JSON machine information data.

func (*Client) SubcontainersInfo Uses

func (c *Client) SubcontainersInfo(name string, query *v1.ContainerInfoRequest) ([]v1.ContainerInfo, error)

Returns the information about all subcontainers (recursive) of the specified container (including itself).

Directories

PathSynopsis
clientexample
v2Client library to programmatically access cAdvisor API.

Package client imports 10 packages (graph) and is imported by 206 packages. Updated 2020-04-23. Refresh now. Tools for package owners.