Documentation ¶
Index ¶
- Constants
- func Is4xx(err error) bool
- func Is5xx(err error) bool
- func IsConflict(err error) bool
- func IsNotFound(err error) bool
- type Client
- func (c *Client) AssetsDelete(ctx context.Context, name string) error
- func (c *Client) AssetsIndex(ctx context.Context) ([]string, error)
- func (c *Client) AssetsInfo(ctx context.Context, name string) (*sabakan.Asset, error)
- func (c *Client) AssetsUpload(ctx context.Context, name, filename string, meta map[string]string) (*sabakan.AssetStatus, error)
- func (c *Client) CryptsDelete(ctx context.Context, serial string) error
- func (c *Client) CryptsGet(ctx context.Context, serial, device string) ([]byte, error)
- func (c *Client) CryptsPut(ctx context.Context, serial, device string, key []byte) error
- func (c *Client) DHCPConfigGet(ctx context.Context) (*sabakan.DHCPConfig, error)
- func (c *Client) DHCPConfigSet(ctx context.Context, conf *sabakan.DHCPConfig) error
- func (c *Client) IPAMConfigGet(ctx context.Context) (*sabakan.IPAMConfig, error)
- func (c *Client) IPAMConfigSet(ctx context.Context, conf *sabakan.IPAMConfig) error
- func (c *Client) IgnitionsDelete(ctx context.Context, role, id string) error
- func (c *Client) IgnitionsGet(ctx context.Context, role, id string) (*IgnitionTemplate, error)
- func (c *Client) IgnitionsListIDs(ctx context.Context, role string) ([]string, error)
- func (c *Client) IgnitionsSet(ctx context.Context, role, id string, tmpl *IgnitionTemplate) error
- func (c *Client) ImagesDelete(ctx context.Context, os, id string) error
- func (c *Client) ImagesIndex(ctx context.Context, os string) (sabakan.ImageIndex, error)
- func (c *Client) ImagesUpload(ctx context.Context, os, id string, kernel io.Reader, kernelSize int64, ...) error
- func (c *Client) KernelParamsGet(ctx context.Context, os string) (sabakan.KernelParams, error)
- func (c *Client) KernelParamsSet(ctx context.Context, os string, params sabakan.KernelParams) error
- func (c *Client) LogsGet(ctx context.Context, since, until time.Time, w io.Writer) error
- func (c *Client) MachinesCreate(ctx context.Context, specs []*sabakan.MachineSpec) error
- func (c *Client) MachinesGet(ctx context.Context, params map[string]string) ([]sabakan.Machine, error)
- func (c *Client) MachinesGetState(ctx context.Context, serial string) (sabakan.MachineState, error)
- func (c *Client) MachinesRemove(ctx context.Context, serial string) error
- func (c *Client) MachinesRemoveLabel(ctx context.Context, serial string, label string) error
- func (c *Client) MachinesSetLabel(ctx context.Context, serial string, label, value string) error
- func (c *Client) MachinesSetRetireDate(ctx context.Context, serial string, date time.Time) error
- func (c *Client) MachinesSetState(ctx context.Context, serial string, state string) error
- type IgnitionTemplate
- type IgnitionVersion
- type ImageIndex
- type RemoteFile
- type SystemdUnit
- type TemplateSource
Constants ¶
const ( Ignition2_2 = sabakan.Ignition2_2 Ignition2_3 = sabakan.Ignition2_3 )
Supported ignition versions
Variables ¶
This section is empty.
Functions ¶
func IsConflict ¶
IsConflict returns true if err contains 409 status code
func IsNotFound ¶
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 (*Client) AssetsDelete ¶
AssetsDelete deletes an asset
func (*Client) AssetsIndex ¶
AssetsIndex retrieves index of assets
func (*Client) AssetsInfo ¶
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 ¶
CryptsDelete removes all encryption keys of the machine specified by serial.
func (*Client) DHCPConfigGet ¶
DHCPConfigGet retrieves DHCP configurations
func (*Client) DHCPConfigSet ¶
DHCPConfigSet sets DHCP configurations
func (*Client) IPAMConfigGet ¶
IPAMConfigGet retrieves IPAM configurations
func (*Client) IPAMConfigSet ¶
IPAMConfigSet sets IPAM configurations
func (*Client) IgnitionsDelete ¶
IgnitionsDelete deletes an ignition template specified by role and id
func (*Client) IgnitionsGet ¶
IgnitionsGet gets an ignition template identified by role and id.
func (*Client) IgnitionsListIDs ¶
IgnitionsListIDs gets list of ignition template IDs for a role
func (*Client) IgnitionsSet ¶
IgnitionsSet puts an ignition template file
func (*Client) ImagesDelete ¶
ImagesDelete deletes image file.
func (*Client) ImagesIndex ¶
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 ¶
KernelParamsGet retrieves kernel parameters
func (*Client) KernelParamsSet ¶
KernelParamsSet sets kernel parameters
func (*Client) MachinesCreate ¶
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 ¶
MachinesGetState get the state of the machine from sabakan server
func (*Client) MachinesRemove ¶
MachinesRemove removes machine information from sabakan server
func (*Client) MachinesRemoveLabel ¶
MachinesRemoveLabel removes a label from a machine on sabakan server.
func (*Client) MachinesSetLabel ¶
MachinesSetLabel adds or updates a label for a machine on sabakan server.
func (*Client) MachinesSetRetireDate ¶
MachinesSetRetireDate set the retire date of the machine.
type IgnitionTemplate ¶
type IgnitionTemplate = sabakan.IgnitionTemplate
IgnitionTemplate represents an ignition template
func BuildIgnitionTemplate ¶
func BuildIgnitionTemplate(sourceFile string, metadata map[string]interface{}) (*IgnitionTemplate, error)
BuildIgnitionTemplate constructs an IgnitionTemplate from source file.
type IgnitionVersion ¶
type IgnitionVersion = sabakan.IgnitionVersion
IgnitionVersion represents ignition specification version in `major.minor`
type RemoteFile ¶
type RemoteFile struct { Name string `json:"name"` URL string `json:"url"` Mode *int `json:"mode"` }
RemoteFile represents a remote file.
type SystemdUnit ¶
type SystemdUnit struct { Name string `json:"name"` Enabled bool `json:"enabled"` Mask bool `json:"mask"` }
SystemdUnit represents a systemd unit in Ignition template.
type TemplateSource ¶
type TemplateSource struct { Version IgnitionVersion `json:"version"` Include string `json:"include"` Passwd string `json:"passwd"` Files []string `json:"files"` RemoteFiles []RemoteFile `json:"remote_files"` Systemd []SystemdUnit `json:"systemd"` Networkd []string `json:"networkd"` }
TemplateSource represents YAML/JSON source file of Ignition template.