client

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssembleIgnitionTemplate

func AssembleIgnitionTemplate(fname string, w io.Writer) error

AssembleIgnitionTemplate assemble ignition template from fname to w

func Is4xx

func Is4xx(err error) bool

Is4xx returns true if err contains 4xx status code

func Is5xx

func Is5xx(err error) bool

Is5xx returns true if err contains 5xx status code

func IsConflict

func IsConflict(err error) bool

IsConflict returns true if err contains 409 status code

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if err contains 404 status code

Types

type Client

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

Client is a sabakan client

func NewClient

func NewClient(endpoint string, http *http.Client) (*Client, error)

NewClient returns new client

func (*Client) AssetsDelete

func (c *Client) AssetsDelete(ctx context.Context, name string) error

AssetsDelete deletes an asset

func (*Client) AssetsIndex

func (c *Client) AssetsIndex(ctx context.Context) ([]string, error)

AssetsIndex retrieves index of assets

func (*Client) AssetsInfo

func (c *Client) AssetsInfo(ctx context.Context, name string) (*sabakan.Asset, error)

AssetsInfo retrieves meta data of an asset

func (*Client) AssetsUpload

func (c *Client) AssetsUpload(ctx context.Context, name, filename string, meta map[string]string) (*sabakan.AssetStatus, error)

AssetsUpload stores a file as an asset

func (*Client) CryptsDelete

func (c *Client) CryptsDelete(ctx context.Context, serial string) error

CryptsDelete removes all encryption keys of the machine specified by serial.

func (*Client) CryptsGet

func (c *Client) CryptsGet(ctx context.Context, serial, device string) ([]byte, error)

CryptsGet gets an encryption key from sabakan server.

func (*Client) CryptsPut

func (c *Client) CryptsPut(ctx context.Context, serial, device string, key []byte) error

CryptsPut puts an encryption key to sabakan server.

func (*Client) DHCPConfigGet

func (c *Client) DHCPConfigGet(ctx context.Context) (*sabakan.DHCPConfig, error)

DHCPConfigGet retrieves DHCP configurations

func (*Client) DHCPConfigSet

func (c *Client) DHCPConfigSet(ctx context.Context, conf *sabakan.DHCPConfig) error

DHCPConfigSet sets DHCP configurations

func (*Client) IPAMConfigGet

func (c *Client) IPAMConfigGet(ctx context.Context) (*sabakan.IPAMConfig, error)

IPAMConfigGet retrieves IPAM configurations

func (*Client) IPAMConfigSet

func (c *Client) IPAMConfigSet(ctx context.Context, conf *sabakan.IPAMConfig) error

IPAMConfigSet sets IPAM configurations

func (*Client) IgnitionsCat

func (c *Client) IgnitionsCat(ctx context.Context, role, id string, w io.Writer) error

IgnitionsCat gets an ignition template for the role an id

func (*Client) IgnitionsDelete

func (c *Client) IgnitionsDelete(ctx context.Context, role, id string) error

IgnitionsDelete deletes an ignition template specified by role and id

func (*Client) IgnitionsGet

func (c *Client) IgnitionsGet(ctx context.Context, role string) ([]*sabakan.IgnitionInfo, error)

IgnitionsGet gets list of ignition template info of the specified role

func (*Client) IgnitionsSet

func (c *Client) IgnitionsSet(ctx context.Context, role, id string, r io.Reader, meta map[string]string) error

IgnitionsSet puts an ignition template file

func (*Client) ImagesDelete

func (c *Client) ImagesDelete(ctx context.Context, os, id string) error

ImagesDelete deletes image file.

func (*Client) ImagesIndex

func (c *Client) ImagesIndex(ctx context.Context, os string) (sabakan.ImageIndex, error)

ImagesIndex get index of images.

func (*Client) ImagesUpload

func (c *Client) ImagesUpload(ctx context.Context, os, id string, kernel io.Reader, kernelSize int64, initrd io.Reader, initrdSize int64) error

ImagesUpload upload image file.

func (*Client) KernelParamsGet

func (c *Client) KernelParamsGet(ctx context.Context, os string) (sabakan.KernelParams, error)

KernelParamsGet retrieves kernel parameters

func (*Client) KernelParamsSet

func (c *Client) KernelParamsSet(ctx context.Context, os string, params sabakan.KernelParams) error

KernelParamsSet sets kernel parameters

func (*Client) LogsGet

func (c *Client) LogsGet(ctx context.Context, since, until time.Time, w io.Writer) error

LogsGet retrieves audit logs.

func (*Client) MachinesCreate

func (c *Client) MachinesCreate(ctx context.Context, specs []*sabakan.MachineSpec) error

MachinesCreate create machines information to sabakan server

func (*Client) MachinesGet

func (c *Client) MachinesGet(ctx context.Context, params map[string]string) ([]sabakan.Machine, error)

MachinesGet get machine information from sabakan server

func (*Client) MachinesGetState

func (c *Client) MachinesGetState(ctx context.Context, serial string) (sabakan.MachineState, error)

MachinesGetState get the state of the machine from sabakan server

func (*Client) MachinesRemove

func (c *Client) MachinesRemove(ctx context.Context, serial string) error

MachinesRemove removes machine information from sabakan server

func (*Client) MachinesSetRetireDate

func (c *Client) MachinesSetRetireDate(ctx context.Context, serial string, date time.Time) error

MachinesSetRetireDate set the retire date of the machine.

func (*Client) MachinesSetState

func (c *Client) MachinesSetState(ctx context.Context, serial string, state string) error

MachinesSetState set the state of the machine on sabakan server

type IgnitionInfo

type IgnitionInfo = sabakan.IgnitionInfo

IgnitionInfo represents information of an ignition template

type ImageIndex

type ImageIndex = sabakan.ImageIndex

ImageIndex is a list of *Image.

Jump to

Keyboard shortcuts

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