rancher2_api

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Image           string    `json:"image,omitempty"`
	Name            string    `json:"name,omitempty"`
	Env             []Env     `json:"env,omitempty"`
	ImagePullPolicy string    `json:"imagePullPolicy,omitempty"`
	Resources       Resources `json:"resources,omitempty"`
}

type Env

type Env struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Limits

type Limits struct {
	Cpu string `json:"cpu,omitempty"`
}

type Node

type Node struct {
	RequireAll []string `json:"requireAll,omitempty"`
}

type Rancher2

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

func New

func New(config config.Config) *Rancher2

func (*Rancher2) ContainerExists

func (r *Rancher2) ContainerExists(id string) (exists bool, err error)

func (*Rancher2) CreateContainer

func (r *Rancher2) CreateContainer(name string, image string, env map[string]string, restart bool) (id string, err error)

func (*Rancher2) RemoveContainer

func (r *Rancher2) RemoveContainer(id string) (err error)

func (*Rancher2) UpdateContainer

func (r *Rancher2) UpdateContainer(id string, name string, image string, env map[string]string, restart bool) (newId string, err error)

type Request

type Request struct {
	Name        string            `json:"name,omitempty"`
	NamespaceId string            `json:"namespaceId,omitempty"`
	Containers  []Container       `json:"containers,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Selector    Selector          `json:"selector,omitempty"`
	Scheduling  Scheduling        `json:"scheduling,omitempty"`
}

type Resources

type Resources struct {
	Limits Limits `json:"limits,omitempty"`
}

type Scheduling

type Scheduling struct {
	Node      Node   `json:"node,omitempty"`
	Scheduler string `json:"scheduler,omitempty"`
}

type Selector

type Selector struct {
	MatchLabels map[string]string `json:"matchLabels,omitempty"`
}

Jump to

Keyboard shortcuts

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