cri

package
v0.3.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cri provides minimal CRI client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a lightweight implementation of CRI client.

func NewClient

func NewClient(endpoint string, connectionTimeout time.Duration) (*Client, error)

NewClient builds CRI client

func (*Client) Close

func (c *Client) Close() error

Close connection

func (*Client) ContainerStats

func (c *Client) ContainerStats(ctx context.Context, containerID string) (*runtimeapi.ContainerStats, error)

ContainerStats returns the stats of the container.

func (*Client) ContainerStatus

func (c *Client) ContainerStatus(ctx context.Context, containerID string, verbose bool) (*runtimeapi.ContainerStatus, map[string]string, error)

ContainerStatus returns the container status.

func (*Client) CreateContainer

func (c *Client) CreateContainer(ctx context.Context, podSandBoxID string, config *runtimeapi.ContainerConfig, sandboxConfig *runtimeapi.PodSandboxConfig) (string, error)

CreateContainer creates a new container in the specified PodSandbox.

func (*Client) ImageStatus

func (c *Client) ImageStatus(ctx context.Context, image *runtimeapi.ImageSpec) (*runtimeapi.Image, error)

ImageStatus returns the status of the image.

func (*Client) ListContainerStats

func (c *Client) ListContainerStats(ctx context.Context, filter *runtimeapi.ContainerStatsFilter) ([]*runtimeapi.ContainerStats, error)

ListContainerStats returns stats for all the containers matching the filter

func (*Client) ListContainers

func (c *Client) ListContainers(ctx context.Context, filter *runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error)

ListContainers lists containers by filters.

func (*Client) ListImages

func (c *Client) ListImages(ctx context.Context, filter *runtimeapi.ImageFilter) ([]*runtimeapi.Image, error)

ListImages lists available images

func (*Client) ListPodSandbox

func (c *Client) ListPodSandbox(ctx context.Context, filter *runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error)

ListPodSandbox returns a list of PodSandboxes.

func (*Client) PodSandboxStatus

func (c *Client) PodSandboxStatus(ctx context.Context, podSandBoxID string) (*runtimeapi.PodSandboxStatus, map[string]string, error)

PodSandboxStatus returns the status of the PodSandbox.

func (*Client) PullImage

func (c *Client) PullImage(ctx context.Context, image *runtimeapi.ImageSpec, sandboxConfig *runtimeapi.PodSandboxConfig) (string, error)

PullImage pulls container image

func (*Client) RemoveContainer

func (c *Client) RemoveContainer(ctx context.Context, containerID string) error

RemoveContainer removes the container. If the container is running, the container should be forced to removal.

func (*Client) RemovePodSandbox

func (c *Client) RemovePodSandbox(ctx context.Context, podSandBoxID string) error

RemovePodSandbox removes the sandbox. If there are any containers in the sandbox, they should be forcibly removed.

func (*Client) RunPodSandbox

func (c *Client) RunPodSandbox(ctx context.Context, config *runtimeapi.PodSandboxConfig, runtimeHandler string) (string, error)

RunPodSandbox creates and starts a pod-level sandbox. Runtimes should ensure the sandbox is in ready state.

func (*Client) StartContainer

func (c *Client) StartContainer(ctx context.Context, containerID string) error

StartContainer starts the container.

func (*Client) StopContainer

func (c *Client) StopContainer(ctx context.Context, containerID string, timeout int64) error

StopContainer stops a running container with a grace period (i.e., timeout).

func (*Client) StopPodSandbox

func (c *Client) StopPodSandbox(ctx context.Context, podSandBoxID string) error

StopPodSandbox stops the sandbox. If there are any running containers in the sandbox, they should be forced to termination.

Jump to

Keyboard shortcuts

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