Documentation
¶
Index ¶
- type Client
- func (c *Client) Call(method string, args ...interface{}) (interface{}, error)
- func (c *Client) CreateDistro(distro Distro) (*Distro, error)
- func (c *Client) CreateProfile(profile Profile) (*Profile, error)
- func (c *Client) CreateRepo(repo Repo) (*Repo, error)
- func (c *Client) CreateSnippet(s Snippet) error
- func (c *Client) CreateSystem(system System) (*System, error)
- func (c *Client) CreateTemplateFile(f TemplateFile) error
- func (c *Client) DeleteDistro(name string) error
- func (c *Client) DeleteProfile(name string) error
- func (c *Client) DeleteRepo(name string) error
- func (c *Client) DeleteSnippet(name string) error
- func (c *Client) DeleteSystem(name string) error
- func (c *Client) DeleteTemplateFile(name string) error
- func (c *Client) GetDistro(name string) (*Distro, error)
- func (c *Client) GetDistros() ([]*Distro, error)
- func (c *Client) GetItemHandle(what, name string) (string, error)
- func (c *Client) GetProfile(name string) (*Profile, error)
- func (c *Client) GetProfiles() ([]*Profile, error)
- func (c *Client) GetRepo(name string) (*Repo, error)
- func (c *Client) GetRepos() ([]*Repo, error)
- func (c *Client) GetSnippet(name string) (*Snippet, error)
- func (c *Client) GetSystem(name string) (*System, error)
- func (c *Client) GetSystems() ([]*System, error)
- func (c *Client) GetTemplateFile(ksName string) (*TemplateFile, error)
- func (c *Client) Login() (bool, error)
- func (c *Client) Sync() error
- func (c *Client) UpdateDistro(distro *Distro) error
- func (c *Client) UpdateProfile(profile *Profile) error
- func (c *Client) UpdateRepo(repo *Repo) error
- func (c *Client) UpdateSystem(system *System) error
- type ClientConfig
- type Distro
- type HTTPClient
- type Interface
- type Interfaces
- type Profile
- type Repo
- type Snippet
- type System
- type TemplateFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Token string
// contains filtered or unexported fields
}
Client is ...
func (*Client) CreateDistro ¶ added in v0.4.0
CreateDistro creates a distro.
func (*Client) CreateProfile ¶ added in v0.4.0
CreateProfile creates a system. It ensures that a Distro is set and then sets other default values.
func (*Client) CreateRepo ¶ added in v0.4.0
CreateRepo creates a repo.
func (*Client) CreateSnippet ¶
CreateSnippet creates a snippet in Cobbler. Takes a Snippet struct as input Returns true/false and error if creation failed.
func (*Client) CreateSystem ¶
CreateSystem creates a system. It ensures that either a Profile or Image are set and then sets other default values.
func (*Client) CreateTemplateFile ¶ added in v0.4.0
func (c *Client) CreateTemplateFile(f TemplateFile) error
CreateTemplateFile to create a template file in Cobbler. Takes a TemplateFile struct as input. Requires 3 arguments: file, data and token Returns true/false and error if creation failed.
func (*Client) DeleteDistro ¶ added in v0.4.0
DeleteDistro deletes a single distro by its name.
func (*Client) DeleteProfile ¶ added in v0.4.0
DeleteProfile deletes a single profile by its name.
func (*Client) DeleteRepo ¶ added in v0.4.0
DeleteRepo deletes a single repo by its name.
func (*Client) DeleteSnippet ¶ added in v0.4.0
DeleteSnippet deletes a snippet file in Cobbler. Takes a snippet file name as input. Returns error if delete failed.
func (*Client) DeleteSystem ¶
DeleteSystem deletes a single system by its name.
func (*Client) DeleteTemplateFile ¶ added in v0.4.0
DeleteTemplateFile to delete a template file in Cobbler. Takes a template file name as input. Requires 2 arguments: short filename and token Returns error if delete failed.
func (*Client) GetDistros ¶ added in v0.4.0
GetDistros returns all systems in Cobbler.
func (*Client) GetItemHandle ¶ added in v0.4.0
GetItemHandle gets the internal ID of a Cobbler item.
func (*Client) GetProfile ¶ added in v0.4.0
GetProfile returns a single profile obtained by its name.
func (*Client) GetProfiles ¶ added in v0.4.0
GetProfiles returns all systems in Cobbler.
func (*Client) GetSnippet ¶ added in v0.4.0
GetSnippet gets a snippet file in Cobbler. Takes a snippet file name as input. Returns *Snippet and error if read failed.
func (*Client) GetSystems ¶ added in v0.4.0
GetSystems returns all systems in Cobbler.
func (*Client) GetTemplateFile ¶ added in v0.4.0
func (c *Client) GetTemplateFile(ksName string) (*TemplateFile, error)
GetTemplateFile to get a template file in Cobbler. Takes a template file name as input. Requires 2 arguments: short filename and token Returns *TemplateFile and error if read failed.
func (*Client) Login ¶
Login will perform a login request to Cobbler using the credentials provided in the configuration in the initializer.
func (*Client) UpdateDistro ¶ added in v0.4.0
UpdateDistro updates a single distro.
func (*Client) UpdateProfile ¶ added in v0.4.0
UpdateProfile updates a single profile.
func (*Client) UpdateRepo ¶ added in v0.4.0
UpdateRepo updates a single repo.
func (*Client) UpdateSystem ¶ added in v0.4.0
UpdateSystem updates a single system.
type ClientConfig ¶
ClientConfig is the URL of Cobbler plus login credentials.
type Distro ¶ added in v0.4.0
type Distro struct {
// These are internal fields and cannot be modified.
Ctime float64 `mapstructure:"ctime" cobbler:"noupdate"` // TODO: convert to time
Depth int `mapstructure:"depth" cobbler:"noupdate"`
Mtime float64 `mapstructure:"mtime" cobbler:"noupdate"` // TODO: convert to time
SourceRepos []string `mapstructure:"source_repos" cobbler:"noupdate"`
TreeBuildTime string `mapstructure:tree_build_time" cobbler:"noupdate"`
UID string `mapstructure:"uid" cobbler:"noupdate"`
Arch string `mapstructure:"arch"`
BootFiles string `mapstructure:"boot_files"`
BootLoader string `mapstructure:"boot_loader"`
Breed string `mapstructure:"breed"`
Comment string `mapstructure:"comment"`
FetchableFiles string `mapstructure:"fetchable_files"`
Initrd string `mapstructure:"initrd"`
Kernel string `mapstructure:"kernel"`
KernelOptions string `mapstructure:"kernel_options"`
KernelOptionsPost string `mapstructure:"kernel_options_post"`
MGMTClasses []string `mapstructure:"mgmt_classes"`
Name string `mapstructure:"name"`
OSVersion string `mapstructure:"os_version"`
Owners []string `mapstructure:"owners"`
RedHatManagementKey string `mapstructure:"redhat_management_key"`
TemplateFiles string `mapstructure:"template_files"`
}
Distro is a created distro. Get the fileds from cobbler/items/distro.py
type HTTPClient ¶
HTTPClient is ...
type Interface ¶ added in v0.4.0
type Interface struct {
CNAMEs []string `mapstructure:"cnames" structs:"cnames"`
DHCPTag string `mapstructure:"dhcp_tag" structs:"dhcp_tag"`
DNSName string `mapstructure:"dns_name" structs:"dns_name"`
BondingOpts string `mapstructure:"bonding_opts" structs:"bonding_opts"`
BridgeOpts string `mapstructure:"bridge_opts" structs:"bridge_opts"`
Gateway string `mapstructure:"if_gateway" structs:"if_gateway"`
InterfaceType string `mapstructure:"interface_type" structs:"interface_type"`
InterfaceMaster string `mapstructure:"interface_master" structs:"interface_master"`
IPAddress string `mapstructure:"ip_address" structs:"ip_address"`
IPv6Address string `mapstructure:"ipv6_address" structs:"ipv6_address"`
IPv6Secondaries []string `mapstructure:"ipv6_secondaries" structs:"ipv6_secondaries"`
IPv6MTU string `mapstructure:"ipv6_mtu" structs:"ipv6_mtu"`
IPv6StaticRoutes []string `mapstructure:"ipv6_static_routes" structs:"ipv6_static_routes"`
IPv6DefaultGateway string `mapstructure:"ipv6_default_gateway" structs:"ipv6_default_gateway"`
MACAddress string `mapstructure:"mac_address" structs:"mac_address"`
Management bool `mapstructure:"management" structs:"management"`
Netmask string `mapstructure:"netmask" structs:"netmask"`
Static bool `mapstructure:"static" structs:"static"`
StaticRoutes []string `mapstructure:"static_routes" structs:"static_routes"`
VirtBridge string `mapstructure:"virt_bridge" structs:"virt_bridge"`
}
Interface is an interface in a system.
type Interfaces ¶ added in v0.4.0
Interfaces is a collection of interfaces in a system.
type Profile ¶ added in v0.4.0
type Profile struct {
// These are internal fields and cannot be modified.
Ctime float64 `mapstructure:"ctime" cobbler:"noupdate"` // TODO: convert to time
Depth int `mapstructure:"depth" cobbler:"noupdate"`
ID string `mapstructure:"uid" cobbler:"noupdate"`
Mtime float64 `mapstructure:"mtime" cobbler:"noupdate"` // TODO: convert to time
ReposEnabled bool `mapstructure:"repos_enabled" cobbler:"noupdate"`
Autoinstall string `mapstructure:"autoinstall"`
AutoinstallMeta string `mapstructure:"autoinstall_meta"`
BootFiles string `mapstructure:"boot_files"`
Comment string `mapstructure:"comment"`
DHCPTag string `mapstructure:"dhcp_tag"`
Distro string `mapstructure:"distro"`
EnableGPXE bool `mapstructure:"enable_gpxe"`
EnableMenu bool `mapstructure:"enable_menu"`
FetchableFiles string `mapstructure:"fetchable_files"`
KernelOptions string `mapstructure:"kernel_options"`
KernelOptionsPost string `mapstructure:"kernel_options_post"`
MGMTClasses []string `mapstructure:"mgmt_classes"`
MGMTParameters string `mapstructure:"mgmt_parameters"`
Name string `mapstructure:"name"`
NameServers []string `mapstructure:"name_servers"`
NameServersSearch []string `mapstructure:"name_servers_search"`
NextServer string `mapstructure:"next_server"`
Owners []string `mapstructure:"owners"`
Proxy string `mapstructure:"proxy"`
RedHatManagementKey string `mapstructure:"redhat_management_key"`
//RedHatManagementServer string `mapstructure:"redhat_management_server"` // Removed in Cobbler 3 profile
Repos string `mapstructure:"repos"`
Server string `mapstructure:"server"`
TemplateFiles string `mapstructure:"template_files"`
VirtAutoBoot string `mapstructure:"virt_auto_boot"`
VirtBridge string `mapstructure:"virt_bridge"`
VirtCPUs string `mapstructure:"virt_cpus"`
VirtDiskDriver string `mapstructure:"virt_disk_driver"`
VirtFileSize string `mapstructure:"virt_file_size"`
VirtPath string `mapstructure:"virt_path"`
VirtRAM string `mapstructure:"virt_ram"`
VirtType string `mapstructure:"virt_type"`
Client
}
Profile is a created profile.
type Repo ¶ added in v0.4.0
type Repo struct {
// These are internal fields and cannot be modified.
Ctime float64 `mapstructure:"ctime" cobbler:"noupdate"` // TODO: convert to time
Depth int `mapstructure:"depth" cobbler:"noupdate"`
Mtime float64 `mapstructure:"mtime" cobbler:"noupdate"` // TODO: convert to time
TreeBuildTime string `mapstructure:tree_build_time" cobbler:"noupdate"`
Parent string `mapstructure:"parent" cobbler:"noupdate"`
UID string `mapstructure:"uid" cobbler:"noupdate"`
AptComponents []string `mapstructure:"apt_components"`
AptDists []string `mapstructure:"apt_dists"`
Arch string `mapstructure:"arch"`
Breed string `mapstructure:"breed"`
Comment string `mapstructure:"comment"`
CreateRepoFlags string `mapstructure:"createrepo_flags"`
Environment string `mapstructure:"environment"`
KeepUpdated bool `mapstructure:"keep_updated"`
Mirror string `mapstructure:"mirror"`
MirrorLocally bool `mapstructure:"mirror_locally"`
Name string `mapstructure:"name"`
Owners []string `mapstructure:"owners"`
Proxy string `mapstructure:"proxy" cobbler:"newfield"`
RpmList []string `mapstructure:"rpm_list"`
}
Repo is a created repo. Get the fileds from cobbler/items/repo.py
type Snippet ¶
type Snippet struct {
Name string // The name the snippet file will be saved in Cobbler
Body string // The contents of the template file
}
Snippet is a snippet file
type System ¶
type System struct {
// These are internal fields and cannot be modified.
Ctime float64 `mapstructure:"ctime" cobbler:"noupdate"` // TODO: convert to time
Depth int `mapstructure:"depth" cobbler:"noupdate"`
ID string `mapstructure:"uid" cobbler:"noupdate"`
IPv6Autoconfiguration bool `mapstructure:"ipv6_autoconfiguration" cobbler:"noupdate"`
Mtime float64 `mapstructure:"mtime" cobbler:"noupdate"` // TODO: convert to time
ReposEnabled bool `mapstructure:"repos_enabled" cobbler:"noupdate"`
Autoinstall string `mapstructure:"autoinstall"`
AutoinstallMeta string `mapstructure:"autoinstall_meta"`
BootFiles string `mapstructure:"boot_files"`
BootLoader string `mapstructure:"boot_loader"`
Comment string `mapstructure:"comment"`
EnableGPXE bool `mapstructure:"enable_gpxe"`
FetchableFiles string `mapstructure:"fetchable_files"`
Gateway string `mapstructure:"gateway"`
Hostname string `mapstructure:"hostname"`
Image string `mapstructure:"image"`
Interfaces map[string]interface{} `mapstructure:"interfaces" cobbler:"noupdate"`
IPv6DefaultDevice string `mapstructure:"ipv6_default_device"`
KernelOptions string `mapstructure:"kernel_options"`
KernelOptionsPost string `mapstructure:"kernel_options_post"`
//LDAPEnabled bool `mapstructure:"ldap_enabled"` // Removed in Cobbler 3 system
//LDAPType string `mapstructure:"ldap_type"` // Removed in Cobbler 3 system
MGMTClasses []string `mapstructure:"mgmt_classes"`
MGMTParameters string `mapstructure:"mgmt_parameters"`
//MonitEnabled bool `mapstructure:"monit_enabled"` // Removed in Cobbler 3 system
Name string `mapstructure:"name"`
NameServers []string `mapstructure:"name_servers"`
NameServersSearch []string `mapstructure:"name_servers_search"`
NetbootEnabled bool `mapstructure:"netboot_enabled"`
NextServer string `mapstructure:"next_server"`
Owners []string `mapstructure:"owners"`
PowerAddress string `mapstructure:"power_address"`
PowerID string `mapstructure:"power_id"`
PowerPass string `mapstructure:"power_pass"`
PowerType string `mapstructure:"power_type"`
PowerUser string `mapstructure:"power_user"`
Profile string `mapstructure:"profile"`
Proxy string `mapstructure:"proxy"`
RedHatManagementKey string `mapstructure:"redhat_management_key"`
//RedHatManagementServer string `mapstructure:"redhat_management_server"` // Removed in Cobbler 3 system
Status string `mapstructure:"status"`
TemplateFiles string `mapstructure:"template_files"`
VirtAutoBoot string `mapstructure:"virt_auto_boot"`
VirtCPUs string `mapstructure:"virt_cpus"`
VirtDiskDriver string `mapstructure:"virt_disk_driver"`
VirtFileSize string `mapstructure:"virt_file_size"`
VirtPath string `mapstructure:"virt_path"`
VirtPXEBoot int `mapstructure:"virt_pxe_boot"`
VirtRAM string `mapstructure:"virt_ram"`
VirtType string `mapstructure:"virt_type"`
Client
}
System is a created system.
func (*System) CreateInterface ¶ added in v0.4.0
CreateInterface controls network interfaces in Cobbler
func (*System) DeleteInterface ¶ added in v0.4.0
DeleteInterface deletes a single interface in a System.
func (*System) GetInterface ¶ added in v0.4.0
GetInterface returns a single interface in a System.
func (*System) GetInterfaces ¶ added in v0.4.0
func (s *System) GetInterfaces() (Interfaces, error)
GetInterfaces returns all interfaces in a System.
type TemplateFile ¶ added in v0.4.0
type TemplateFile struct {
Name string // The name the template file will be saved in Cobbler
Body string // The contents of the template file
}
TemplateFile is the former TemplateFile