client

package
v0.0.0-...-686bfca Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddressFamilyIPv6 = "ipv6"
	AddressFamilyIPv4 = "ipv4"
)

Variables

View Source
var (
	// StatusAllDetails causes no additional status details to be printed by
	// FormatStatusResponse.
	StatusNoDetails = StatusDetails{}
	// StatusAllDetails causes all status details to be printed by FormatStatusResponse.
	StatusAllDetails = StatusDetails{
		AllAddresses:                true,
		AllControllers:              true,
		AllNodes:                    true,
		AllRedirects:                true,
		AllClusters:                 true,
		BPFMapDetails:               true,
		KubeProxyReplacementDetails: true,
		ClockSourceDetails:          true,
	}
)

Functions

func DefaultSockPath

func DefaultSockPath() string

DefaultSockPath returns default UNIX domain socket path or path set using CILIUM_SOCK env variable

func Hint

func Hint(err error) error

Hint tries to improve the error message displayed to the user.

Types

type Client

type Client struct {
	clientapi.CceAPI
}

func NewClient

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

NewClient creates a client for the given `host`. If host is nil then use SockPath provided by CILIUM_SOCK or the cce default SockPath

func NewDefaultClient

func NewDefaultClient() (*Client, error)

NewDefaultClient creates a client with default parameters connecting to UNIX domain socket.

func NewDefaultClientWithTimeout

func NewDefaultClientWithTimeout(timeout time.Duration) (*Client, error)

NewDefaultClientWithTimeout creates a client with default parameters connecting to UNIX domain socket and waits for cce-agent availability.

func (*Client) IPAMAllocate

func (c *Client) IPAMAllocate(family, owner string, expiration bool) (*models.IPAMResponse, error)

IPAMAllocate allocates an IP address out of address family specific pool.

func (*Client) IPAMAllocateIP

func (c *Client) IPAMAllocateIP(ip, owner string) error

IPAMAllocateIP tries to allocate a particular IP address.

func (*Client) IPAMCNIAllocate

func (c *Client) IPAMCNIAllocate(family, owner, containerID, netns string) (*models.IPAMResponse, error)

IPAMCNIAllocate allocates an IP address out of address family specific pool.

func (*Client) IPAMCNIReleaseIP

func (c *Client) IPAMCNIReleaseIP(owner, containerID, netns string) error

IPAMCNIReleaseIP releases a IP address back to the pool.

func (*Client) IPAMReleaseIP

func (c *Client) IPAMReleaseIP(ip string) error

IPAMReleaseIP releases a IP address back to the pool.

type StatusDetails

type StatusDetails struct {
	// AllAddress causes all addresses to be printed by FormatStatusResponse.
	AllAddresses bool
	// AllControllers causes all controllers to be printed by FormatStatusResponse.
	AllControllers bool
	// AllNodes causes all nodes to be printed by FormatStatusResponse.
	AllNodes bool
	// AllRedirects causes all redirects to be printed by FormatStatusResponse.
	AllRedirects bool
	// AllClusters causes all clusters to be printed by FormatStatusResponse.
	AllClusters bool
	// BPFMapDetails causes BPF map details to be printed by FormatStatusResponse.
	BPFMapDetails bool
	// KubeProxyReplacementDetails causes BPF kube-proxy details to be printed by FormatStatusResponse.
	KubeProxyReplacementDetails bool
	// ClockSourceDetails causes BPF time-keeping internals to be printed by FormatStatusResponse.
	ClockSourceDetails bool
}

Jump to

Keyboard shortcuts

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