cobblerclient

package module
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

README

cobblerclient

Cobbler Client written in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSystemId

func NewSystemId(c *Client) (string, error)

Requests Cobbler to create a new system. Returns the newly created system if it was successfully created. Returns an error otherwise.

Types

type Client

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

func NewClient

func NewClient(httpClient HTTPClient, c ClientConfig) Client

func (*Client) CreateKickstartFile

func (c *Client) CreateKickstartFile(f *KickstartFile) (bool, error)

Creates a kickstart file in Cobbler. Returns true/false and returns an optional error in case that anything goes wrong.

func (*Client) CreateSnippet

func (c *Client) CreateSnippet(s *Snippet) (bool, error)

Creates a snippet in Cobbler. Returns true/false and returns an optional error in case that anything goes wrong.

func (*Client) CreateSystem

func (c *Client) CreateSystem(config SystemConfig) (*System, error)

func (*Client) DeleteSystem

func (c *Client) DeleteSystem(name string) (bool, error)

func (*Client) Login

func (c *Client) Login() (bool, error)

Performs a login request to Cobbler using the credentials provided in the configuration in the initializer.

func (*Client) Sync

func (c *Client) Sync() (bool, error)

Sync the system. Returns true if the sync was successful, or false if it was not. Returns an error if anything went wrong

type ClientConfig

type ClientConfig struct {
	Url      string
	Username string
	Password string
}

type HTTPClient

type HTTPClient interface {
	Post(string, string, io.Reader) (*http.Response, error)
}

type KickstartFile

type KickstartFile struct {
	Name string // The name the kickstart file will be saved in Cobbler
	Body string // The contents of the kickstart file
}

type NetworkConfig

type NetworkConfig struct {
	Mac     string
	DNSName string
	Ip      string
	Netmask string
	Gateway string
}

type Snippet

type Snippet struct {
	Name string // The name the snippet file will be saved in Cobbler
	Body string // The contents of the kickstart file
}

type System

type System struct {
	Id string

	SystemConfig
	// contains filtered or unexported fields
}

func (*System) Save

func (s *System) Save() (bool, error)

Saves the current state of the system. Returns true if the save was successful, or false if it was not. Returns an error if anything went wrong

func (*System) SetHostname

func (s *System) SetHostname(hostname string) (bool, error)

func (*System) SetId

func (s *System) SetId() error

Requests Cobbler to create a new system and sets the newly created system's id into the `system` instace. Returns an error in case anything goes wrong.

func (*System) SetName

func (s *System) SetName(name string) (bool, error)

func (*System) SetNameservers

func (s *System) SetNameservers(nameservers string) (bool, error)

func (*System) SetNetwork

func (s *System) SetNetwork(config NetworkConfig) (bool, error)

func (*System) SetProfile

func (s *System) SetProfile(profile string) (bool, error)

type SystemConfig

type SystemConfig struct {
	Name        string
	Profile     string
	Hostname    string
	Nameservers string
	Network     NetworkConfig
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL