api

package
v0.0.0-...-ad0daee Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdToString

func CmdToString(cmd HyperCmd) string

CmdToString translates a command into its corresponding string.

Types

type Capabilities

type Capabilities struct {
	// Bounding is the set of capabilities checked by the kernel.
	Bounding []string `json:"bounding"`
	// Effective is the set of capabilities checked by the kernel.
	Effective []string `json:"effective"`
	// Inheritable is the capabilities preserved across execve.
	Inheritable []string `json:"inheritable"`
	// Permitted is the limiting superset for effective capabilities.
	Permitted []string `json:"permitted"`
	// Ambient is the ambient set of capabilities that are kept.
	Ambient []string `json:"ambient"`
}

Capabilities specify the capabilities to keep when executing the process inside the container.

type Constraints

type Constraints struct {
	// CPUQuota specifies the total amount of time in microseconds
	CPUQuota int64

	// CPUPeriod specifies a period of time in microseconds
	CPUPeriod uint64

	// CPUShares specifies container's weight vs. other containers
	CPUShares uint64
}

Constraints describes the constraints for a container

type DecodedMessage

type DecodedMessage struct {
	Code    uint32
	Message []byte
}

DecodedMessage describes messages going through CTL channel.

type EnvironmentVar

type EnvironmentVar struct {
	Env   string `json:"env"`
	Value string `json:"value"`
}

EnvironmentVar describes an environment variable and its value.

type Exec

type Exec struct {
	ContainerID string  `json:"container"`
	Process     Process `json:"process"`
}

Exec describes the format expected by a EXECCMD command.

type Fsmap

type Fsmap struct {
	Source       string `json:"source"`
	Path         string `json:"path"`
	AbsolutePath bool   `json:"absolutePath"`
	ReadOnly     bool   `json:"readOnly"`
	DockerVolume bool   `json:"dockerVolume"`

	// SCSIAddr is the SCSI address in the format SCSI-id:LUN.
	// If SCSIAddr is provided, we use that to determine the device name to be mounted
	// ignoring the Source field that is used for as the source location for mounting otherwise.
	SCSIAddr string `json:"scsiAddr,omitempty"`
}

Fsmap describes a filesystem map related to a container.

type HyperCmd

type HyperCmd uint32

HyperCmd defines the command type.

const (
	VersionCmd HyperCmd = iota
	StartPodCmd
	GetPodDeprecatedCmd
	StopPodDeprecatedCmd
	DestroyPodCmd
	RestartContainerDeprecatedCmd
	ExecCmd
	FinishCmdDeprecatedCmd
	ReadyCmd
	AckCmd
	ErrorCmd
	WinsizeCmd
	PingCmd
	FinishPodDeprecatedCmd
	NextCmd
	WriteFileCmd
	ReadFileCmd
	NewContainerCmd
	KillContainerCmd
	OnlineCPUMemCmd
	SetupInterfaceCmd
	SetupRouteCmd
	RemoveContainerCmd
	PsContainerCmd
	ProcessAsyncEventCmd
)

Control command string IDs

type IPAddress

type IPAddress struct {
	IPAddr  string `json:"ipAddress"`
	NetMask string `json:"netMask"`
}

IPAddress describes an IP address and its network mask.

type KillContainer

type KillContainer struct {
	ID           string         `json:"container"`
	Signal       syscall.Signal `json:"signal"`
	AllProcesses bool           `json:"allProcesses"`
}

KillContainer describes the format expected by a KILLCONTAINER command.

type NetIface

type NetIface struct {
	Name        string      `json:"newDeviceName"`
	IPAddresses []IPAddress `json:"ipAddresses"`
	MTU         int         `json:"mtu"`
	HwAddr      string      `json:"macAddr"`
}

NetIface describes a pod network interface.

type Network

type Network struct {
	Interfaces []NetIface `json:"interfaces"`
	DNS        []string   `json:"dns"`
	Routes     []Route    `json:"routes"`
}

Network fully describes a pod network with its interfaces, routes and dns related information.

type NewContainer

type NewContainer struct {
	ID               string           `json:"id"`
	RootFs           string           `json:"rootfs"`
	Image            string           `json:"image"`
	FsType           string           `json:"fstype,omitempty"`
	Fsmap            []Fsmap          `json:"fsmap"`
	Process          Process          `json:"process"`
	SystemMountsInfo SystemMountsInfo `json:"systemMountsInfo"`
	Constraints      Constraints      `json:"constraints"`

	// SCSI address in the format SCSI-Id:LUN
	SCSIAddr string `json:"scsiAddr,omitempty"`
}

NewContainer describes the format expected by a NEWCONTAINER command.

type Process

type Process struct {
	ID               string           `json:"id"`
	User             string           `json:"user,omitempty"`
	Group            string           `json:"group,omitempty"`
	AdditionalGroups []string         `json:"additionalGroups,omitempty"`
	Terminal         bool             `json:"terminal"`
	Stdio            uint64           `json:"stdio"`
	Stderr           uint64           `json:"stderr"`
	Args             []string         `json:"args"`
	Envs             []EnvironmentVar `json:"envs,omitempty"`
	Workdir          string           `json:"workdir"`
	NoNewPrivileges  bool             `json:"noNewPrivileges"`
	Capabilities     Capabilities     `json:"capabilities"`
}

Process describes a process running on a container.

type PsContainer

type PsContainer struct {
	ID     string   `json:"container"`
	Format string   `json:"format"`
	Args   []string `json:"psargs"`
}

PsContainer describes the format expected by a PSCONTAINER command.

type RemoveContainer

type RemoveContainer struct {
	ID string `json:"container"`
}

RemoveContainer describes the format expected by a REMOVECONTAINER command.

type Route

type Route struct {
	Src     string `json:"src"`
	Dest    string `json:"dest"`
	Gateway string `json:"gateway,omitempty"`
	Device  string `json:"device,omitempty"`
}

Route describes a pod network route.

type StartPod

type StartPod struct {
	ID         string     `json:"hostname"`
	Interfaces []NetIface `json:"interfaces,omitempty"`
	DNS        []string   `json:"dns,omitempty"`
	Routes     []Route    `json:"routes,omitempty"`
	ShareDir   string     `json:"shareDir"`
}

StartPod describes the format expected by a STARTPOD command.

type SystemMountsInfo

type SystemMountsInfo struct {
	// Indicates if /dev has been passed as a bind mount for the host /dev
	BindMountDev bool `json:"bindMountDev"`

	// Size of /dev/shm assigned on the host.
	DevShmSize int `json:"devShmSize"`
}

SystemMountsInfo describes additional information for system mounts that the agent needs to handle

type TtyMessage

type TtyMessage struct {
	Session uint64
	Message []byte
}

TtyMessage describes messages going through IO channel.

type Winsize

type Winsize struct {
	Sequence uint64 `json:"seq"`
	Row      uint16 `json:"row"`
	Column   uint16 `json:"column"`
}

Winsize describes the format expected by a WINSIZE command.

Jump to

Keyboard shortcuts

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