api

package
v0.0.0-...-8ca5d7a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExternalRegistryIDRegexp = regexp.MustCompile(`^([a-z0-9_-]+)/(.+)$`)
View Source
var NodeIDRegexp = regexp.MustCompile(`^([a-z0-9_-]+)/([a-z0-9_-]+)$`)

Functions

This section is empty.

Types

type Error

type Error struct {
	Error interface{}
}

type ExternalRegistry

type ExternalRegistry struct {
	ID       ExternalRegistryID
	Name     string
	URL      string
	Username string
	Email    string
}

type ExternalRegistryID

type ExternalRegistryID struct {
	Grid string
	Name string
}

func ParseExternalRegistryID

func ParseExternalRegistryID(str string) (id ExternalRegistryID, err error)

func (ExternalRegistryID) MarshalJSON

func (id ExternalRegistryID) MarshalJSON() ([]byte, error)

func (ExternalRegistryID) String

func (id ExternalRegistryID) String() string

func (*ExternalRegistryID) UnmarshalJSON

func (id *ExternalRegistryID) UnmarshalJSON(buf []byte) error

type ExternalRegistryIndex

type ExternalRegistryIndex struct {
	ExternalRegistries []ExternalRegistry `json:"external_registries"`
}

type ExternalRegistryPOST

type ExternalRegistryPOST struct {
	URL      string `json:"url"`
	Username string `json:"username"`
	Email    string `json:"email,omitempty"`
	Password string `json:"password"`
}

type Grid

type Grid struct {
	ID              string
	Name            string
	InitialSize     int `json:"initial_size"`
	Token           string
	Stats           GridStats
	DefaultAffinity GridDefaultAffinity `json:"default_affinity,omitempty"`
	TrustedSubnets  GridTrustedSubnets  `json:"trusted_subnets"`
	Subnet          string
	Supernet        string
	Logs            *GridLogs

	NodeCount      int `json:"node_count"`
	ServiceCount   int `json:"service_count"`
	ContainerCount int `json:"container_count"`
	UserCount      int `json:"user_count"`
}

func (Grid) String

func (grid Grid) String() string

type GridDefaultAffinity

type GridDefaultAffinity []string

type GridLogs

type GridLogs struct {
	Forwarder string       `json:"forwarder"`
	Opts      GridLogsOpts `json:"opts"`
}

type GridLogsOpts

type GridLogsOpts map[string]string

type GridPOST

type GridPOST struct {
	// Required
	Name        string `json:"name"`
	InitialSize int    `json:"initial_size"`

	// Optional
	Token    string `json:"token,omitempty"`
	Subnet   string `json:"subnet,omitempty"`
	Supernet string `json:"supernet,omitempty"`

	// Optional
	TrustedSubnets  *GridTrustedSubnets  `json:"trusted_subnets,omitempty"`
	DefaultAffinity *GridDefaultAffinity `json:"default_affinity,omitempty"`
	Stats           *GridStats           `json:"stats,omitempty"`
	Logs            *GridLogs            `json:"logs,omitempty"`
}

type GridPUT

type GridPUT struct {
	// Optional
	TrustedSubnets  *GridTrustedSubnets  `json:"trusted_subnets,omitempty"`
	DefaultAffinity *GridDefaultAffinity `json:"default_affinity,omitempty"`
	Stats           *GridStats           `json:"stats,omitempty"`
	Logs            *GridLogs            `json:"logs,omitempty"`
}

type GridStats

type GridStats struct {
	Statsd *GridStatsStatsd `json:"statsd"`
}

type GridStatsStatsd

type GridStatsStatsd struct {
	Server string `json:"server"`
	Port   int    `json:"port"`
}

type GridTrustedSubnets

type GridTrustedSubnets []string

type Grids

type Grids []Grid

type GridsGET

type GridsGET struct {
	Grids Grids
}

type Node

type Node struct {
	ID            NodeID // grid/name
	NodeID        string `json:"node_id"` // Docker ID
	Connected     bool
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
	ConnectedAt   time.Time `json:"connected_at"`
	LastSeenAt    time.Time `json:"last_seen_at"`
	Name          string
	OS            string
	EngineRootDir string `json:"engine_root_dir"`
	Driver        string
	// network_drivers
	// volume_drivers
	KernelVersion string `json:"kernel_version"`
	Labels        NodeLabels
	MemTotal      int `json:"mem_total"`
	MemLimit      int `json:"mem_limit"`
	CPUs          int
	PublicIP      string   `json:"public_ip"`
	PrivateIP     string   `json:"private_ip"`
	OverlayIP     string   `json:"overlay_ip"`
	AgentVersion  string   `json:"agent_version"`
	DockerVersion string   `json:"docker_version"`
	PeerIPs       []string `json:"peer_ips"`
	NodeNumber    int      `json:"node_number"`
	InitialMember bool     `json:"initial_member"`
	Grid          Grid
}

Node represents a Kontena node, (a virtual or physical machine) which will run the Kontena Agent where services can be deployed.

type NodeID

type NodeID struct {
	Grid string
	Name string
}

func ParseNodeID

func ParseNodeID(str string) (id NodeID, err error)

func (NodeID) MarshalJSON

func (id NodeID) MarshalJSON() ([]byte, error)

func (NodeID) String

func (id NodeID) String() string

func (*NodeID) UnmarshalJSON

func (id *NodeID) UnmarshalJSON(buf []byte) error

type NodeLabels

type NodeLabels []string

type NodePOST

type NodePOST struct {
	Name   string      `json:"name"`
	Token  string      `json:"token,omitempty"`
	Labels *NodeLabels `json:"labels,omitempty"`
}

type NodePUT

type NodePUT struct {
	Labels *NodeLabels `json:"labels,omitempty"`
}

type NodeToken

type NodeToken struct {
	ID    NodeID `json:"id"`
	Token string `json:"token"`
}

type NodeTokenDELETE

type NodeTokenDELETE struct {
	NodeTokenParams
}

type NodeTokenPUT

type NodeTokenPUT struct {
	Token string `json:"token,omitempty"`
	NodeTokenParams
}

type NodeTokenParams

type NodeTokenParams struct {
	ResetConnection bool `json:"reset_connection"`
}

type Nodes

type Nodes []Node

type NodesGET

type NodesGET struct {
	Nodes Nodes
}

type Ping

type Ping struct {
	Message string
}

type User

type User struct {
	ID    string
	Email string
	Name  string
	Roles []UserRole
}

User represents an authenticated Kontena user with basic details.

type UserRole

type UserRole struct {
	Name        string
	Description string
}

Jump to

Keyboard shortcuts

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