cobblerclient

package module
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

README

Go Report Card Codacy Badge Codacy Badge Go Reference

cobblerclient

Cobbler Client written in Go. Used by the CLI and by the Terraform Provider.

For more details please see:

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EMPTYEVENT = CobblerEvent{
	// contains filtered or unexported fields
}

Functions

func FailOnError added in v0.5.0

func FailOnError(t *testing.T, err error)

FailOnError ...

func Fixture added in v0.5.0

func Fixture(fn string) ([]byte, error)

Fixture implies that from the context where the test is being run a "fixtures" folder exists.

Types

type APIResponsePair added in v0.5.0

type APIResponsePair struct {
	Actual   []byte // This is the actual response that the client gets from the server side.
	Expected []byte // The payload that you expect to receive. This is to verify that your implementation is sending the proper payload to the server.
	Response []byte // The response you want to return.
}

type AclSetupOptions added in v0.5.0

type AclSetupOptions struct {
	AddUser     string `mapstructure:"adduser"`
	AddGroup    string `mapstructure:"addgroup"`
	RemoveUser  string `mapstructure:"removeuser"`
	RemoveGroup string `mapstructure:"removegroup"`
}

AclSetupOptions is a struct which describes the options one can set for the actlsetup action of Cobbler.

type Architecture added in v0.5.0

type Architecture int64

func (Architecture) String added in v0.5.0

func (a Architecture) String() string

type BackgroundImportOptions added in v0.5.0

type BackgroundImportOptions struct {
	Path            string `mapstructure:"path"`
	Name            string `mapstructure:"name"`
	AvailableAs     string `mapstructure:"available_as"`
	AutoinstallFile string `mapstructure:"autoinstall_file"`
	RsyncFlags      string `mapstructure:"rsync_flags"`
	Arch            string `mapstructure:"arch"`
	Breed           string `mapstructure:"breed"`
	OsVersion       string `mapstructure:"os_version"`
}

type BackgroundPowerSystemOptions added in v0.5.0

type BackgroundPowerSystemOptions struct {
	Systems []string `mapstructure:"systems"`
	Power   string   `mapstructure:"power"`
}

type BackgroundReposyncOptions added in v0.5.0

type BackgroundReposyncOptions struct {
	Repos  []string `mapstructure:"repos"`
	Only   string   `mapstructure:"only"`
	Nofail bool     `mapstructure:"nofail"`
	Tries  int      `mapstructure:"tries"`
}

type BackgroundSyncOptions added in v0.5.0

type BackgroundSyncOptions struct {
	Dhcp    bool `mapstructure:"dhcp"`
	Dns     bool `mapstructure:"dns"`
	Verbose bool `mapstructure:"verbose"`
}

type BackgroundSyncSystemsOptions added in v0.5.0

type BackgroundSyncSystemsOptions struct {
	Systems []string `mapstructure:"systems"`
	Verbose bool     `mapstructure:"verbose"`
}

type BootloaderFormatSettings added in v0.5.0

type BootloaderFormatSettings struct {
	BinaryName      string   `json:"binary_name" mapstructure:"binary_name"`
	ExtraModules    []string `json:"extra_modules" mapstructure:"extra_modules"`
	ModuleDirectory string   `json:"mod_dir" mapstructure:"mod_dir"`
}

type BuildisoOptions added in v0.5.0

type BuildisoOptions struct {
	Iso           string   `mapstructure:"iso"`
	Profiles      []string `mapstructure:"profiles"`
	Systems       []string `mapstructure:"systems"`
	BuildisoDir   string   `mapstructure:"buildisodir"`
	Distro        string   `mapstructure:"distro"`
	Standalone    bool     `mapstructure:"standalone"`
	Airgapped     bool     `mapstructure:"airgapped"`
	Source        string   `mapstructure:"source"`
	ExcludeDns    bool     `mapstructure:"exclude_dns"`
	XorrisofsOpts string   `mapstructure:"xorrisofs_opts"`
}

BuildisoOptions is a struct which describes the options one can set for the buildiso action of Cobbler.

type Client

type Client struct {

	// The longevity of this token is defined server side in the setting "auth_token_duration". Per default no token is
	// retrieved. A token can be obtained via the [Client.Login] method.
	Token string
	// To allow for version dependant API calls in the client we cache the major, minor and patch version.
	CachedVersion CobblerVersion
	// contains filtered or unexported fields
}

Client is the type which all API methods are attached to.

func NewClient

func NewClient(httpClient HTTPClient, c ClientConfig) Client

NewClient creates a Client struct which is ready for usage.

func (*Client) AutoAddRepos added in v0.5.0

func (c *Client) AutoAddRepos() error

AutoAddRepos automatically imports any repos server side that are known to the daemon. It is the responsitbility of the caller to execute Client.BackgroundReposync.

func (*Client) BackgroundAclSetup added in v0.5.0

func (c *Client) BackgroundAclSetup(options AclSetupOptions) (string, error)

BackgroundAclSetup applies updated ACLs on the Cobbler system.

func (*Client) BackgroundBuildiso added in v0.5.0

func (c *Client) BackgroundBuildiso(options BuildisoOptions) (string, error)

BackgroundBuildiso builds an ISO file on the server. The return value is the task ID which is started on the server.

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

BackgroundHardlink tries to save space inside the web directory through hardlinking identical files.

func (*Client) BackgroundImport added in v0.5.0

func (c *Client) BackgroundImport(options BackgroundImportOptions) (string, error)

BackgroundImport runs an import locally on the server with the specified options.

func (*Client) BackgroundMkLoaders added in v0.5.0

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

BackgroundMkLoaders runs the mkloaders action on the server in the background.

func (*Client) BackgroundPowerSystem added in v0.5.0

func (c *Client) BackgroundPowerSystem(options BackgroundPowerSystemOptions) (string, error)

BackgroundPowerSystem executes power operations for a given list of systems.

func (*Client) BackgroundReplicate added in v0.5.0

func (c *Client) BackgroundReplicate(options ReplicateOptions) (string, error)

BackgroundReplicate replicates the Cobbler server to the target defined in the arguments.

func (*Client) BackgroundReposync added in v0.5.0

func (c *Client) BackgroundReposync(options BackgroundReposyncOptions) (string, error)

BackgroundReposync runs a reposyonc asynchronous in the background on the server.

func (*Client) BackgroundSignatureUpdate added in v0.5.0

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

BackgroundSignatureUpdate runs a signatures update in the background on the server.

func (*Client) BackgroundSync added in v0.5.0

func (c *Client) BackgroundSync(options BackgroundSyncOptions) (string, error)

BackgroundSync runs a "cobbler sync" in asynchronously in the background. The returned string is the event id which can be used to query the GetEventLog endpoint.

func (*Client) BackgroundSyncSystems added in v0.5.0

func (c *Client) BackgroundSyncSystems(options BackgroundSyncSystemsOptions) (string, error)

BackgroundSyncSystems runs the "cobbler syncsystems" action which only executes a Cobbler sync for a specific subset of systems.

func (*Client) BackgroundValidateAutoinstallFiles added in v0.5.0

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

BackgroundValidateAutoinstallFiles checks if the files generated by Cobbler are valid from a syntax perspective.

func (*Client) Call added in v0.4.1

func (c *Client) Call(method string, args ...interface{}) (interface{}, error)

Call is the generic method for calling an XML-RPC endpoint in Cobbler that has no dedicated method in the client. Normally there should be no need to use this if you are just using the client.

func (*Client) Check added in v0.5.0

func (c *Client) Check() (*[]string, error)

Check runs the "cobbler check" action and list all possible points for improvements on server side as a return value.

func (*Client) CheckAccess added in v0.5.0

func (c *Client) CheckAccess(resource, arg1, arg2 string) (int, error)

CheckAccess performs the same check as Client.CheckAccessNoFail but returning the error message with the reason instead of a boolean.

func (*Client) CheckAccessNoFail added in v0.5.0

func (c *Client) CheckAccessNoFail(resource, arg1, arg2 string) (bool, error)

CheckAccessNoFail validates if a certain resource can be accessed with the current token. "arg1" and "arg2" have different meanings depending on the authorization provider configured server side.

func (*Client) CopyDistro added in v0.5.0

func (c *Client) CopyDistro(objectId, newName string) error

CopyDistro duplicates a distro on the server with a new name.

func (*Client) CopyFile added in v0.5.0

func (c *Client) CopyFile(objectId, newName string) error

CopyFile duplicates a file on the server with a new name.

func (*Client) CopyImage added in v0.5.0

func (c *Client) CopyImage(objectId, newName string) error

CopyImage duplicates an image on the server with a new name.

func (*Client) CopyItem added in v0.5.0

func (c *Client) CopyItem(what, objectId, newName string) error

CopyItem duplicates an item on the server with a new name.

func (*Client) CopyMenu added in v0.5.0

func (c *Client) CopyMenu(objectId, newName string) error

CopyMenu duplicates a menu on the server with a new name.

func (*Client) CopyMgmtClass added in v0.5.0

func (c *Client) CopyMgmtClass(objectId, newName string) error

CopyMgmtClass copies a given managementclass server side with a new name.

func (*Client) CopyPackage added in v0.5.0

func (c *Client) CopyPackage(objectId, newName string) error

CopyPackage duplicates a given package on the server with a new name.

func (*Client) CopyProfile added in v0.5.0

func (c *Client) CopyProfile(objectId, newName string) error

CopyProfile duplicates a given profile on the server with a new name.

func (*Client) CopyRepo added in v0.5.0

func (c *Client) CopyRepo(objectId, newName string) error

CopyRepo duplicates a given repository on the server with a new name.

func (*Client) CopySystem added in v0.5.0

func (c *Client) CopySystem(objectId, newName string) error

CopySystem duplicates a given system on the server with a new name.

func (*Client) CreateDistro added in v0.4.1

func (c *Client) CreateDistro(distro Distro) (*Distro, error)

CreateDistro creates a distro.

func (*Client) CreateFile added in v0.5.0

func (c *Client) CreateFile(file File) (*File, error)

CreateFile creates a single file.

func (*Client) CreateImage added in v0.5.0

func (c *Client) CreateImage(image Image) (*Image, error)

CreateImage creates an image.

func (*Client) CreateMenu added in v0.5.0

func (c *Client) CreateMenu(menu Menu) (*Menu, error)

CreateMenu creates a menu.

func (*Client) CreateMgmtClass added in v0.5.0

func (c *Client) CreateMgmtClass(mgmtclass MgmtClass) (*MgmtClass, error)

CreateMgmtClass creates a mgmtclass.

func (*Client) CreatePackage added in v0.5.0

func (c *Client) CreatePackage(linuxpackage Package) (*Package, error)

CreatePackage creates a package.

func (*Client) CreateProfile added in v0.4.1

func (c *Client) CreateProfile(profile Profile) (*Profile, error)

CreateProfile creates a profile. It ensures that a Distro is set and then sets other default values.

func (*Client) CreateRepo added in v0.4.1

func (c *Client) CreateRepo(repo Repo) (*Repo, error)

CreateRepo creates a repo.

func (*Client) CreateSnippet

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

CreateSnippet creates a snippet in Cobbler. Takes a Snippet struct as input Returns true/false and error if creation failed.

func (*Client) CreateSystem

func (c *Client) CreateSystem(system System) (*System, error)

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.1

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.1

func (c *Client) DeleteDistro(name string) error

DeleteDistro deletes a single Distro by its name.

func (*Client) DeleteDistroRecursive added in v0.5.0

func (c *Client) DeleteDistroRecursive(name string, recursive bool) error

DeleteDistroRecursive deletes a single Distro by its name with the option to do so recursively.

func (*Client) DeleteFile added in v0.5.0

func (c *Client) DeleteFile(name string) error

DeleteFile deletes a single File by its name.

func (*Client) DeleteFileRecursive added in v0.5.0

func (c *Client) DeleteFileRecursive(name string, recursive bool) error

DeleteFileRecursive deletes a single File by its name with the option to do so recursively.

func (*Client) DeleteImage added in v0.5.0

func (c *Client) DeleteImage(name string) error

DeleteImage deletes a single Image by its name.

func (*Client) DeleteImageRecursive added in v0.5.0

func (c *Client) DeleteImageRecursive(name string, recursive bool) error

DeleteImageRecursive deletes a single Image by its name with the option to do so recursively.

func (*Client) DeleteMenu added in v0.5.0

func (c *Client) DeleteMenu(name string) error

DeleteMenu deletes a single Menu by its name.

func (*Client) DeleteMenuRecursive added in v0.5.0

func (c *Client) DeleteMenuRecursive(name string, recursive bool) error

DeleteMenuRecursive deletes a single Menu by its name with the option to do so recursively.

func (*Client) DeleteMgmtClass added in v0.5.0

func (c *Client) DeleteMgmtClass(name string) error

DeleteMgmtClass deletes a single MgmtClass by its name.

func (*Client) DeleteMgmtClassRecursive added in v0.5.0

func (c *Client) DeleteMgmtClassRecursive(name string, recursive bool) error

DeleteMgmtClassRecursive deletes a single MgmtClass by its name with the option to do so recursively.

func (*Client) DeletePackage added in v0.5.0

func (c *Client) DeletePackage(name string) error

DeletePackage deletes a single Package by its name.

func (*Client) DeletePackageRecursive added in v0.5.0

func (c *Client) DeletePackageRecursive(name string, recursive bool) error

DeletePackageRecursive deletes a single Package by its name with the option to do so recursively.

func (*Client) DeleteProfile added in v0.4.1

func (c *Client) DeleteProfile(name string) error

DeleteProfile deletes a single profile by its name.

func (*Client) DeleteProfileRecursive added in v0.5.0

func (c *Client) DeleteProfileRecursive(name string, recursive bool) error

DeleteProfileRecursive deletes a single profile by its name.

func (*Client) DeleteRepo added in v0.4.1

func (c *Client) DeleteRepo(name string) error

DeleteRepo deletes a single Repo by its name.

func (*Client) DeleteRepoRecursive added in v0.5.0

func (c *Client) DeleteRepoRecursive(name string, recursive bool) error

DeleteRepoRecursive deletes a single Repo by its name with the option to do so recursively.

func (*Client) DeleteSnippet added in v0.4.1

func (c *Client) DeleteSnippet(name string) error

DeleteSnippet deletes a snippet file in Cobbler. Takes a snippet file name as input. Returns error if delete failed.

func (*Client) DeleteSystem

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

DeleteSystem deletes a single System by its name.

func (*Client) DeleteSystemRecursive added in v0.5.0

func (c *Client) DeleteSystemRecursive(name string, recursive bool) error

DeleteSystemRecursive deletes a single System by its name with the option to do so recursively.

func (*Client) DeleteTemplateFile added in v0.4.1

func (c *Client) DeleteTemplateFile(name string) error

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) ExtendedVersion added in v0.5.0

func (c *Client) ExtendedVersion() (ExtendedVersion, error)

ExtendedVersion returns the version information of the server.

func (*Client) FindDistro added in v0.5.0

func (c *Client) FindDistro(criteria map[string]interface{}) ([]*Distro, error)

FindDistro searches for one or more distros by any of its attributes.

func (*Client) FindDistroNames added in v0.5.0

func (c *Client) FindDistroNames(criteria map[string]interface{}) ([]string, error)

FindDistroNames searches for one or more distros by any of its attributes.

func (*Client) FindFile added in v0.5.0

func (c *Client) FindFile(criteria map[string]interface{}) ([]*File, error)

FindFile searches for one or more files by any of its attributes.

func (*Client) FindFileNames added in v0.5.0

func (c *Client) FindFileNames(criteria map[string]interface{}) ([]string, error)

FindFileNames searches for one or more files by any of its attributes.

func (*Client) FindImage added in v0.5.0

func (c *Client) FindImage(criteria map[string]interface{}) ([]*Image, error)

FindImage searches for one or more images by any of its attributes.

func (*Client) FindImageNames added in v0.5.0

func (c *Client) FindImageNames(criteria map[string]interface{}) ([]string, error)

FindImageNames searches for one or more distros by any of its attributes.

func (*Client) FindItemNames added in v0.5.0

func (c *Client) FindItemNames(what string, criteria map[string]interface{}, sortField string) ([]string, error)

func (*Client) FindItems added in v0.5.0

func (c *Client) FindItems(what string, criteria map[string]interface{}, sortField string, expand bool) ([]interface{}, error)

FindItems searches for one or more items by any of its attributes.

func (*Client) FindItemsPaged added in v0.5.0

func (c *Client) FindItemsPaged(what string, criteria map[string]interface{}, sortField string, page, itemsPerPage int32) (*PagedSearchResult, error)

FindItemsPaged searches for items with the given criteria and returning

func (*Client) FindMenu added in v0.5.0

func (c *Client) FindMenu(criteria map[string]interface{}) ([]*Menu, error)

FindMenu searches for one or more menus by any of its attributes.

func (*Client) FindMenuNames added in v0.5.0

func (c *Client) FindMenuNames(criteria map[string]interface{}) ([]string, error)

FindMenuNames searches for one or more menus by any of its attributes.

func (*Client) FindMgmtClass added in v0.5.0

func (c *Client) FindMgmtClass(criteria map[string]interface{}) ([]*MgmtClass, error)

FindMgmtClass searches for one or more managementclasses by any of its attributes.

func (*Client) FindMgmtClassNames added in v0.5.0

func (c *Client) FindMgmtClassNames(criteria map[string]interface{}) ([]string, error)

FindMgmtClassNames searches for one or more managementclasses by any of its attributes.

func (*Client) FindPackage added in v0.5.0

func (c *Client) FindPackage(criteria map[string]interface{}) ([]*Package, error)

FindPackage is the search method that allows looking for a package by any of its attributes.

func (*Client) FindPackageNames added in v0.5.0

func (c *Client) FindPackageNames(criteria map[string]interface{}) ([]string, error)

FindPackageNames is searching for one or more packages by any of its attributes.

func (*Client) FindProfile added in v0.5.0

func (c *Client) FindProfile(criteria map[string]interface{}) ([]*Profile, error)

FindProfile searches for one or more profiles by any of its attributes.

func (*Client) FindProfileNames added in v0.5.0

func (c *Client) FindProfileNames(criteria map[string]interface{}) ([]string, error)

FindProfileNames searches for one or more profiles by any of its attributes.

func (*Client) FindRepo added in v0.5.0

func (c *Client) FindRepo(criteria map[string]interface{}) ([]*Repo, error)

FindRepo searches for one or more repositories by any of its attributes.

func (*Client) FindRepoNames added in v0.5.0

func (c *Client) FindRepoNames(criteria map[string]interface{}) ([]string, error)

FindRepoNames searches for one or more repositories by any of its attributes.

func (*Client) FindSystem added in v0.5.0

func (c *Client) FindSystem(criteria map[string]interface{}) ([]*System, error)

FindSystem searches for one or more systems by any of its attributes.

func (*Client) FindSystemByDnsName added in v0.5.0

func (c *Client) FindSystemByDnsName(dns_name string) error

FindSystemByDnsName searches for a system with a given DNS name.

func (*Client) FindSystemNames added in v0.5.0

func (c *Client) FindSystemNames(criteria map[string]interface{}) ([]string, error)

FindSystemNames searches for one or more systems by any of its attributes.

func (*Client) GenerateAutoinstall added in v0.5.0

func (c *Client) GenerateAutoinstall(profile string, system string) (string, error)

GenerateAutoinstall generates the autoinstallation file for a given profile or system.

func (*Client) GenerateBootCfg added in v0.5.0

func (c *Client) GenerateBootCfg(profile, system string) error

GenerateBootCfg generates the bootcfg for a given MS Windows profile or system.

func (*Client) GenerateIPxe added in v0.5.0

func (c *Client) GenerateIPxe(profile, image, system string) error

GenerateIPxe generates the iPXE (formerly gPXE) configuration data.

func (*Client) GenerateScript added in v0.5.0

func (c *Client) GenerateScript(profile, system, name string) error

GenerateScript generates for either a profile or sytem the requested script.

func (*Client) GetAuthnModuleName added in v0.5.0

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

GetAuthnModuleName retrieves the currently configured authentication module name.

func (*Client) GetAutoinstallSnippets added in v0.5.0

func (c *Client) GetAutoinstallSnippets() error

GetAutoinstallSnippets retrieves a list of all snippets that are in use by Cobbler.

func (*Client) GetAutoinstallTemplates added in v0.5.0

func (c *Client) GetAutoinstallTemplates() error

GetAutoinstallTemplates retrieves a list of all templates that are in use by Cobbler.

func (*Client) GetBlendedData added in v0.5.0

func (c *Client) GetBlendedData(profile, system string) (map[string]interface{}, error)

GetBlendedData passes a profile or system through Cobblers inheritance chain and returns the result.

func (*Client) GetConfigData added in v0.5.0

func (c *Client) GetConfigData(hostname string) error

GetConfigData retrieves configuration data for a given host.

func (*Client) GetDistro added in v0.4.1

func (c *Client) GetDistro(name string, flattened, resolved bool) (*Distro, error)

GetDistro returns a single distro obtained by its name.

func (*Client) GetDistroHandle added in v0.5.0

func (c *Client) GetDistroHandle(name string) (string, error)

GetDistroHandle gets the internal ID of a Cobbler item.

func (*Client) GetDistros added in v0.4.1

func (c *Client) GetDistros() ([]*Distro, error)

GetDistros returns all distros in Cobbler.

func (*Client) GetDistrosSince added in v0.5.0

func (c *Client) GetDistrosSince(mtime time.Time) ([]*Distro, error)

GetDistrosSince returns all distros which were created after the specified date.

func (*Client) GetEventLog added in v0.5.0

func (c *Client) GetEventLog(eventId string) (string, error)

GetEventLog retrieves the logged messages for a given event id.

func (*Client) GetEvents added in v0.5.0

func (c *Client) GetEvents(forUser string) ([]*CobblerEvent, error)

GetEvents retrieves all events from the Cobbler server

func (*Client) GetFile added in v0.5.0

func (c *Client) GetFile(name string, flattened, resolved bool) (*File, error)

GetFile returns a single file obtained by its name.

func (*Client) GetFileAsRendered added in v0.5.0

func (c *Client) GetFileAsRendered(name string) (map[string]interface{}, error)

GetFileAsRendered returns the datastructure after it has passed through Cobblers inheritance structure.

func (*Client) GetFileHandle added in v0.5.0

func (c *Client) GetFileHandle(name string) (string, error)

GetFileHandle gets the internal ID of a Cobbler item.

func (*Client) GetFiles added in v0.5.0

func (c *Client) GetFiles() ([]*File, error)

GetFiles returns a list of all files.

func (*Client) GetFilesSince added in v0.5.0

func (c *Client) GetFilesSince(mtime time.Time) ([]*File, error)

GetFilesSince returns all files which were created after the specified date.

func (*Client) GetImage added in v0.5.0

func (c *Client) GetImage(name string, flattened, resolved bool) (*Image, error)

GetImage returns a single image obtained by its name.

func (*Client) GetImageAsRendered added in v0.5.0

func (c *Client) GetImageAsRendered(name string) (map[string]interface{}, error)

GetImageAsRendered returns the datastructure after it has passed through Cobblers inheritance structure.

func (*Client) GetImageHandle added in v0.5.0

func (c *Client) GetImageHandle(name string) (string, error)

GetImageHandle gets the internal ID of a Cobbler item.

func (*Client) GetImages added in v0.5.0

func (c *Client) GetImages() ([]*Image, error)

GetImages returns all images in Cobbler.

func (*Client) GetImagesSince added in v0.5.0

func (c *Client) GetImagesSince(mtime time.Time) ([]*Image, error)

GetImagesSince returns all images which were created after the specified date.

func (*Client) GetItem added in v0.5.0

func (c *Client) GetItem(what string, name string, flatten, resolved bool) (map[string]interface{}, error)

GetItem retrieves a single item from the database. An empty map means that the item could not be found.

func (*Client) GetItemHandle added in v0.4.1

func (c *Client) GetItemHandle(what, name string) (string, error)

GetItemHandle gets the internal ID of a Cobbler item.

func (*Client) GetItemNames added in v0.5.0

func (c *Client) GetItemNames(what string) ([]string, error)

GetItemNames returns the list of names for a specified object type present inside Cobbler.

func (*Client) GetItemResolvedValue added in v0.5.0

func (c *Client) GetItemResolvedValue(itemUuid string, attribute string) error

GetItemResolvedValue retrieves the value of a single attribute of a single item which was passed through the inheritance chain of Cobbler.

func (*Client) GetMenu added in v0.5.0

func (c *Client) GetMenu(name string, flattened, resolved bool) (*Menu, error)

GetMenu returns a single menu obtained by its name.

func (*Client) GetMenuAsRendered added in v0.5.0

func (c *Client) GetMenuAsRendered() error

GetMenuAsRendered returns the datastructure after it has passed through Cobblers inheritance structure.

func (*Client) GetMenuHandle added in v0.5.0

func (c *Client) GetMenuHandle(name string) (string, error)

GetMenuHandle gets the internal ID of a Cobbler item.

func (*Client) GetMenus added in v0.5.0

func (c *Client) GetMenus() ([]*Distro, error)

GetMenus returns all menus in Cobbler.

func (*Client) GetMenusSince added in v0.5.0

func (c *Client) GetMenusSince(mtime time.Time) ([]*Menu, error)

GetMenusSince returns all menus which were created after the specified date.

func (*Client) GetMgmtClass added in v0.5.0

func (c *Client) GetMgmtClass(name string, flattened, resolved bool) (*MgmtClass, error)

GetMgmtClass returns a single mgmtclass obtained by its name.

func (*Client) GetMgmtClassAsRendered added in v0.5.0

func (c *Client) GetMgmtClassAsRendered(name string) (map[string]interface{}, error)

GetMgmtClassAsRendered returns the datastructure after it has passed through Cobblers inheritance structure.

func (*Client) GetMgmtClassHandle added in v0.5.0

func (c *Client) GetMgmtClassHandle(name string) (string, error)

GetMgmtClassHandle gets the internal ID of a Cobbler item.

func (*Client) GetMgmtClasses added in v0.5.0

func (c *Client) GetMgmtClasses() ([]*MgmtClass, error)

GetMgmtClasses returns all mgmtclasses in Cobbler.

func (*Client) GetMgmtClassesSince added in v0.5.0

func (c *Client) GetMgmtClassesSince(mtime time.Time) ([]*MgmtClass, error)

GetMgmtClassesSince returns all managementclasses which were created after the specified date.

func (*Client) GetPackage added in v0.5.0

func (c *Client) GetPackage(name string, flattened, resolved bool) (*Package, error)

GetPackage returns a single package obtained by its name.

func (*Client) GetPackageAsRendered added in v0.5.0

func (c *Client) GetPackageAsRendered(name string) (map[string]interface{}, error)

GetPackageAsRendered returns the datastructure after it has passed through Cobblers inheritance structure.

func (*Client) GetPackageHandle added in v0.5.0

func (c *Client) GetPackageHandle(name string) (string, error)

GetPackageHandle gets the internal ID of a Cobbler item.

func (*Client) GetPackages added in v0.5.0

func (c *Client) GetPackages() ([]*Package, error)

GetPackages returns all packages in Cobbler.

func (*Client) GetPackagesSince added in v0.5.0

func (c *Client) GetPackagesSince(mtime time.Time) ([]*Package, error)

GetPackagesSince returns all packages that have been edited since a given timestamp.

func (*Client) GetProfile added in v0.4.1

func (c *Client) GetProfile(name string, flattened, resolved bool) (*Profile, error)

GetProfile returns a single profile obtained by its name.

func (*Client) GetProfileHandle added in v0.5.0

func (c *Client) GetProfileHandle(name string) (string, error)

GetProfileHandle gets the internal ID of a Cobbler item.

func (*Client) GetProfiles added in v0.4.1

func (c *Client) GetProfiles() ([]*Profile, error)

GetProfiles returns all profiles in Cobbler.

func (*Client) GetProfilesSince added in v0.5.0

func (c *Client) GetProfilesSince(mtime time.Time) ([]*Profile, error)

GetProfilesSince returns all profiles which were created after the specified date.

func (*Client) GetRandomMac added in v0.5.0

func (c *Client) GetRandomMac() error

GetRandomMac generates a random MAC address for use with a virtualized system.

func (*Client) GetRepo added in v0.4.1

func (c *Client) GetRepo(name string, flattened, resolved bool) (*Repo, error)

GetRepo returns a single repo obtained by its name.

func (*Client) GetRepoHandle added in v0.5.0

func (c *Client) GetRepoHandle(name string) (string, error)

GetRepoHandle gets the internal ID of a Cobbler item.

func (*Client) GetRepos added in v0.4.1

func (c *Client) GetRepos() ([]*Repo, error)

GetRepos returns all repos in Cobbler.

func (*Client) GetReposCompatibleWithProfile added in v0.5.0

func (c *Client) GetReposCompatibleWithProfile(profile_name string) error

GetReposCompatibleWithProfile returns all repositories that can be potentially assigned to a given profile.

func (*Client) GetReposSince added in v0.5.0

func (c *Client) GetReposSince(mtime time.Time) ([]*Repo, error)

GetReposSince returns all repositories which were created after the specified date.

func (*Client) GetSettings added in v0.5.0

func (c *Client) GetSettings() (*Settings, error)

GetSettings returns the currently active settings.

func (*Client) GetSignatures added in v0.5.0

func (c *Client) GetSignatures() (*DistroSignatures, error)

GetSignatures retrieves the complete signatures that are loaded by Cobbler.

func (*Client) GetSnippet added in v0.4.1

func (c *Client) GetSnippet(name string) (*Snippet, error)

GetSnippet gets a snippet file in Cobbler. Takes a snippet file name as input. Returns *Snippet and error if read failed.

func (*Client) GetStatus added in v0.5.0

func (c *Client) GetStatus(mode string) error

GetStatus retrieves the current status of installation progress that has been reported to Cobbler.

func (*Client) GetSystem added in v0.4.1

func (c *Client) GetSystem(name string, flattened, resolved bool) (*System, error)

GetSystem returns a single system obtained by its name.

func (*Client) GetSystemHandle added in v0.5.0

func (c *Client) GetSystemHandle(name string) (string, error)

GetSystemHandle gets the internal ID of a Cobbler item.

func (*Client) GetSystems added in v0.4.1

func (c *Client) GetSystems() ([]*System, error)

GetSystems returns all systems in Cobbler.

func (*Client) GetSystemsSince added in v0.5.0

func (c *Client) GetSystemsSince(mtime time.Time) ([]*System, error)

GetSystemsSince returns all systems which were created after the specified date.

func (*Client) GetTaskStatus added in v0.5.0

func (c *Client) GetTaskStatus(eventId string) (CobblerEvent, error)

GetTaskStatus takes the event ID from Cobbler and returns its status.

func (*Client) GetTemplateFile added in v0.4.1

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) GetUserFromToken added in v0.5.0

func (c *Client) GetUserFromToken(token string) (string, error)

GetUserFromToken checks what user a given token is belonging to.

func (*Client) GetValidArchs added in v0.5.0

func (c *Client) GetValidArchs() ([]string, error)

GetValidArchs retrieves all valid architectures that Cobbler is offering.

func (*Client) GetValidBreeds added in v0.5.0

func (c *Client) GetValidBreeds() ([]string, error)

GetValidBreeds retrieves all valid OS breeds that a distro can have.

func (*Client) GetValidImageBootLoaders added in v0.5.0

func (c *Client) GetValidImageBootLoaders(imageName string) ([]string, error)

GetValidImageBootLoaders retrieves the list of bootloaders that can be assigned to an image.

func (*Client) GetValidOsVersions added in v0.5.0

func (c *Client) GetValidOsVersions() ([]string, error)

GetValidOsVersions retrieves all valid OS versions that a distro can have.

func (*Client) GetValidOsVersionsForBreed added in v0.5.0

func (c *Client) GetValidOsVersionsForBreed(breed string) ([]string, error)

GetValidOsVersionsForBreed retrieves all valid OS versions for a given breed.

func (*Client) HasItem added in v0.5.0

func (c *Client) HasItem(what string, name string) (bool, error)

HasItem checks if an item with the given name exists.

func (*Client) IsAutoinstallInUse added in v0.5.0

func (c *Client) IsAutoinstallInUse(name string) error

IsAutoinstallInUse checks if a given system has reported that it is currently installing.

func (*Client) IsValueInherit added in v0.5.0

func (c *Client) IsValueInherit(value interface{}) bool

IsValueInherit safely verifies if a given value is set to the magic "<<inherit>>".

func (*Client) LastModifiedTime added in v0.5.0

func (c *Client) LastModifiedTime() (float64, error)

LastModifiedTime retrieves the timestamp when any object in Cobbler was last modified.

func (*Client) ListDistroNames added in v0.5.0

func (c *Client) ListDistroNames() ([]string, error)

ListDistroNames returns a list of all distro names currently available in Cobbler.

func (*Client) ListFileNames added in v0.5.0

func (c *Client) ListFileNames() ([]string, error)

ListFileNames returns a list of all files names currently available in Cobbler.

func (*Client) ListImageNames added in v0.5.0

func (c *Client) ListImageNames() ([]string, error)

ListImageNames returns a list of all known image names.

func (*Client) ListMenuNames added in v0.5.0

func (c *Client) ListMenuNames() ([]string, error)

ListMenuNames returns a list of all menu names currently available in Cobbler.

func (*Client) ListMgmtClassNames added in v0.5.0

func (c *Client) ListMgmtClassNames() ([]string, error)

ListMgmtClassNames returns a list of all managementclass names currently available in Cobbler.

func (*Client) ListPackageNames added in v0.5.0

func (c *Client) ListPackageNames() ([]string, error)

ListPackageNames returns a list of all packages names currently available in Cobbler.

func (*Client) ListProfileNames added in v0.5.0

func (c *Client) ListProfileNames() ([]string, error)

ListProfileNames returns a list of all profile names currently available in Cobbler.

func (*Client) ListRepoNames added in v0.5.0

func (c *Client) ListRepoNames() ([]string, error)

ListRepoNames returns the names of all repositories that exist in Cobbler.

func (*Client) ListSystemNames added in v0.5.0

func (c *Client) ListSystemNames() ([]string, error)

ListSystemNames returns a list of all system names currently available in Cobbler.

func (*Client) Login

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

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

func (*Client) Logout added in v0.5.0

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

Logout performs a logout from the Cobbler server.

func (*Client) ModifyItem added in v0.5.0

func (c *Client) ModifyItem(what, objectId, attribute string, arg interface{}) error

ModifyItem is a generic method to modify items. Changes made with this method are not persisted until a call to SaveItem or one of its other concrete methods.

func (*Client) ModifyItemInPlace added in v0.5.0

func (c *Client) ModifyItemInPlace(what, name, attribute string, value map[string]interface{}) error

ModifyItemInPlace attempts to recreate the functionality of the "in_place" parameter for the "xapi_object_edit" XML-RPC method.

func (*Client) ModifySetting added in v0.5.0

func (c *Client) ModifySetting(name string, value interface{}) (int, error)

ModifySetting modifies a settings if "allow_dynamic_settings" is turned on server side.

func (*Client) NewItem added in v0.5.0

func (c *Client) NewItem(what string, isSubobject bool) error

NewItem creates a new empty item that has to be filled with data. The item does not exist in the database before Client.SaveItem was called.

func (*Client) Ping added in v0.5.0

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

Ping is a simple method to check if the XML-RPC API is available.

func (*Client) PowerSystem added in v0.5.0

func (c *Client) PowerSystem(systemId, power string) (bool, error)

PowerSystem executes a power operation for a single system synchronously.

func (*Client) RegisterNewSystem added in v0.5.0

func (c *Client) RegisterNewSystem(info map[string]interface{}) error

RegisterNewSystem registers a new system without a Cobbler token. This is normally called during unattended installation by a script.

func (*Client) RemoveItem added in v0.5.0

func (c *Client) RemoveItem(what, name string, recursive bool) error

RemoveItem deletes an item from the Cobbler database.

func (*Client) RenameDistro added in v0.5.0

func (c *Client) RenameDistro(objectId, newName string) error

RenameDistro renames a distro with a given object id.

func (*Client) RenameFile added in v0.5.0

func (c *Client) RenameFile(objectId, newName string) error

RenameFile renames a file with a given object id.

func (*Client) RenameImage added in v0.5.0

func (c *Client) RenameImage(objectId, newName string) error

RenameImage renames an image with a given object id.

func (*Client) RenameItem added in v0.5.0

func (c *Client) RenameItem(what, objectId, newName string) error

RenameItem renames an item.

func (*Client) RenameMenu added in v0.5.0

func (c *Client) RenameMenu(objectId, newName string) error

RenameMenu renames a menu with a given object id.

func (*Client) RenameMgmtClass added in v0.5.0

func (c *Client) RenameMgmtClass(objectId, newName string) error

RenameMgmtClass renames a managementclass with a given object id.

func (*Client) RenamePackage added in v0.5.0

func (c *Client) RenamePackage(objectId, newName string) error

RenamePackage renames a package with a given object id.

func (*Client) RenameProfile added in v0.5.0

func (c *Client) RenameProfile(objectId, newName string) error

RenameProfile renames a profile with a given object id.

func (*Client) RenameRepo added in v0.5.0

func (c *Client) RenameRepo(objectId, newName string) error

RenameRepo renames a repository with a given object id.

func (*Client) RenameSystem added in v0.5.0

func (c *Client) RenameSystem(objectId, newName string) error

RenameSystem renames a System with a given object id.

func (*Client) RunInstallTriggers added in v0.5.0

func (c *Client) RunInstallTriggers(mode string, objtype string, name string, ip string) error

RunInstallTriggers runs installation triggers for a given object. This is normally called during unattended installation.

func (*Client) SaveDistro added in v0.5.0

func (c *Client) SaveDistro(objectId, editmode string) error

SaveDistro saves all changes performed via XML-RPC to disk on the server side.

func (*Client) SaveFile added in v0.5.0

func (c *Client) SaveFile(objectId, editmode string) error

SaveFile saves all changes performed via XML-RPC to disk on the server side.

func (*Client) SaveImage added in v0.5.0

func (c *Client) SaveImage(objectId, editmode string) error

SaveImage saves all changes performed via XML-RPC to disk on the server side.

func (*Client) SaveItem added in v0.5.0

func (c *Client) SaveItem(what, objectId, token, editmode string) error

SaveItem saves the changes done via XML-RPC.

func (*Client) SaveMenu added in v0.5.0

func (c *Client) SaveMenu(objectId, editmode string) error

SaveMenu saves all changes performed via XML-RPC to disk on the server side.

func (*Client) SaveMgmtClass added in v0.5.0

func (c *Client) SaveMgmtClass(objectId, editmode string) error

SaveMgmtClass saves all changes performed via XML-RPC to disk on the server side.

func (*Client) SavePackage added in v0.5.0

func (c *Client) SavePackage(objectId, editmode string) error

SavePackage saves all changes performed via XML-RPC to disk on the server side.

func (*Client) SaveProfile added in v0.5.0

func (c *Client) SaveProfile(objectId, editmode string) error

SaveProfile saves all changes performed via XML-RPC to disk on the server side.

func (*Client) SaveRepo added in v0.5.0

func (c *Client) SaveRepo(objectId, editmode string) error

SaveRepo saves all changes performed via XML-RPC to disk on the server side.

func (*Client) SaveSystem added in v0.5.0

func (c *Client) SaveSystem(objectId, editmode string) error

SaveSystem saves all changes performed via XML-RPC to disk on the server side.

func (*Client) Sync

func (c *Client) Sync() error

Sync the system. Returns an error if anything went wrong

func (*Client) SyncDhcp added in v0.5.0

func (c *Client) SyncDhcp() error

SyncDhcp updates the DHCP configuration synchronous.

func (*Client) TokenCheck added in v0.5.0

func (c *Client) TokenCheck(token string) (bool, error)

TokenCheck returns if a given token is still valid or not.

func (*Client) UpdateDistro added in v0.4.1

func (c *Client) UpdateDistro(distro *Distro) error

UpdateDistro updates a single distro.

func (*Client) UpdateFile added in v0.5.0

func (c *Client) UpdateFile(file *File) error

UpdateFile updates a single file.

func (*Client) UpdateImage added in v0.5.0

func (c *Client) UpdateImage(image *Image) error

UpdateImage updates a single image.

func (*Client) UpdateMenu added in v0.5.0

func (c *Client) UpdateMenu(menu *Menu) error

UpdateMenu updates a single menu.

func (*Client) UpdateMgmtClass added in v0.5.0

func (c *Client) UpdateMgmtClass(mgmtclass *MgmtClass) error

UpdateMgmtClass updates a single MgmtClass.

func (*Client) UpdatePackage added in v0.5.0

func (c *Client) UpdatePackage(linuxpackage *Package) error

UpdatePackage updates a single package.

func (*Client) UpdateProfile added in v0.4.1

func (c *Client) UpdateProfile(profile *Profile) error

UpdateProfile updates a single profile.

func (*Client) UpdateRepo added in v0.4.1

func (c *Client) UpdateRepo(repo *Repo) error

UpdateRepo updates a single repo.

func (*Client) UpdateSystem added in v0.4.1

func (c *Client) UpdateSystem(system *System) error

UpdateSystem updates a single system.

func (*Client) Version added in v0.5.0

func (c *Client) Version() (float64, error)

Version is a shorter and easier version representation. Normally you want to call Client.ExtendedVersion.

type ClientConfig

type ClientConfig struct {
	URL      string
	Username string
	Password string
}

ClientConfig is the URL of Cobbler plus login credentials.

type CobblerEvent added in v0.5.0

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

type CobblerVersion added in v0.5.0

type CobblerVersion struct {
	Major int
	Minor int
	Patch int
}

func (*CobblerVersion) Equal added in v0.5.0

func (cv *CobblerVersion) Equal(otherVersion *CobblerVersion) bool

func (*CobblerVersion) GreaterThan added in v0.5.0

func (cv *CobblerVersion) GreaterThan(otherVersion *CobblerVersion) bool

func (*CobblerVersion) LessThan added in v0.5.0

func (cv *CobblerVersion) LessThan(otherVersion *CobblerVersion) bool

func (*CobblerVersion) NotEqual added in v0.5.0

func (cv *CobblerVersion) NotEqual(otherVersion *CobblerVersion) bool

type Distro added in v0.4.1

type Distro struct {
	Item `mapstructure:",squash"`

	// These are internal fields and cannot be modified.
	SourceRepos         []string        `mapstructure:"source_repos"   cobbler:"noupdate"`
	TreeBuildTime       string          `mapstructure:"tree_build_time" cobbler:"noupdate"`
	Arch                string          `mapstructure:"arch"`
	BootLoaders         Value[[]string] `mapstructure:"boot_loaders"`
	Breed               string          `mapstructure:"breed"`
	Initrd              string          `mapstructure:"initrd"`
	RemoteBootInitrd    string          `mapstructure:"remote_boot_initrd"`
	Kernel              string          `mapstructure:"kernel"`
	RemoteBootKernel    string          `mapstructure:"remote_boot_kernel"`
	RedhatManagementKey string          `mapstructure:"redhat_management_key"`
	OSVersion           string          `mapstructure:"os_version"`
}

Distro is a created distro. Get the fields from cobbler/items/distro.py

func NewDistro added in v0.5.0

func NewDistro() Distro

type DistroSignatures added in v0.5.0

type DistroSignatures struct {
	Breeds map[string]map[string]OsVersion `json:"breeds" mapstructure:"breeds"`
}

type ExtendedVersion added in v0.5.0

type ExtendedVersion struct {
	Gitdate      string
	Gitstamp     string
	Builddate    string
	Version      string
	VersionTuple []int
}

type File added in v0.5.0

type File struct {
	Resource `mapstructure:",squash"`

	// File specific fields
	IsDir bool `mapstructure:"is_dir"`
}

File is a created file. Get the fields from cobbler/items/file.py

func NewFile added in v0.5.0

func NewFile() File

type HTTPClient

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

HTTPClient is the interface which defines the API required for the Client to work correctly. Normally this is satisfied by a http.DefaultClient.

type Image added in v0.5.0

type Image struct {
	Item `mapstructure:",squash"`

	// Image specific fields
	// Arch                 Architecture
	// ImageType            ImageType      `mapstructure:"image_type"`
	// VirtDiskDriver       VirtDiskDriver `mapstructure:"virt_disk_driver"`
	// VirtType             VirtType `mapstructure:"virt_type"`
	Arch                 string         `mapstructure:"arch"`
	Autoinstall          string         `mapstructure:"autoinstall"`
	Breed                string         `mapstructure:"breed"`
	File                 string         `mapstructure:"file"`
	ImageType            string         `mapstructure:"image_type"`
	NetworkCount         int            `mapstructure:"network_count"`
	OsVersion            string         `mapstructure:"os_version"`
	BootLoaders          []string       `mapstructure:"boot_loaders"`
	Menu                 string         `mapstructure:"menu"`
	VirtAutoBoot         bool           `mapstructure:"virt_auto_boot"`
	VirtBridge           string         `mapstructure:"virt_bridge"`
	VirtCpus             int            `mapstructure:"virt_cpus"`
	VirtDiskDriver       string         `mapstructure:"virt_disk_driver"`
	VirtFileSize         Value[float64] `mapstructure:"virt_file_size"`
	VirtPath             string         `mapstructure:"virt_path"`
	VirtRam              Value[int]     `mapstructure:"virt_ram"`
	VirtType             string         `mapstructure:"virt_type"`
	SupportedBootLoaders []string       `mapstructure:"supported_boot_loaders"`

	Client
}

Image is a created image. Get the fields from cobbler/items/image.py

func NewImage added in v0.5.0

func NewImage() Image

type ImageType added in v0.5.0

type ImageType int64

func (ImageType) String added in v0.5.0

func (i ImageType) String() string

type Interface added in v0.4.1

type Interface struct {
	BondingOpts        string   `mapstructure:"bonding_opts" structs:"bonding_opts"`
	BridgeOpts         string   `mapstructure:"bridge_opts" structs:"bridge_opts"`
	CNAMEs             []string `mapstructure:"cnames" structs:"cnames"`
	ConnectedMode      bool     `mapstructure:"connected_mode"`
	DHCPTag            string   `mapstructure:"dhcp_tag" structs:"dhcp_tag"`
	DNSName            string   `mapstructure:"dns_name" structs:"dns_name"`
	Gateway            string   `mapstructure:"if_gateway" structs:"if_gateway"`
	IPAddress          string   `mapstructure:"ip_address" structs:"ip_address"`
	IPv6Address        string   `mapstructure:"ipv6_address" structs:"ipv6_address"`
	IPv6DefaultGateway string   `mapstructure:"ipv6_default_gateway" structs:"ipv6_default_gateway"`
	IPv6MTU            string   `mapstructure:"ipv6_mtu" structs:"ipv6_mtu"`
	IPv6Prefix         string   `mapstructure:"ipv6_prefix" structs:"ipv6_prefix"`
	IPv6Secondaries    []string `mapstructure:"ipv6_secondaries" structs:"ipv6_secondaries"`
	IPv6StaticRoutes   []string `mapstructure:"ipv6_static_routes" structs:"ipv6_static_routes"`
	InterfaceMaster    string   `mapstructure:"interface_master" structs:"interface_master"`
	InterfaceType      string   `mapstructure:"interface_type" structs:"interface_type"`
	MACAddress         string   `mapstructure:"mac_address" structs:"mac_address"`
	MTU                string   `mapstructure:"mtu" structs:"mtu"`
	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.

func NewInterface added in v0.5.0

func NewInterface() Interface

type Interfaces added in v0.4.1

type Interfaces map[string]Interface

Interfaces is a collection of interfaces in a system.

type Item added in v0.5.0

type Item struct {
	// Meta information about an item
	Meta ItemMeta `cobbler:"noupdate"`

	// Item fields
	Parent            string                        `mapstructure:"parent"`
	Depth             int                           `mapstructure:"depth"          cobbler:"noupdate"`
	Children          []string                      `mapstructure:"children"       cobbler:"noupdate"`
	CTime             float64                       `mapstructure:"ctime"          cobbler:"noupdate"`
	MTime             float64                       `mapstructure:"mtime"          cobbler:"noupdate"`
	Uid               string                        `mapstructure:"uid"            cobbler:"noupdate"`
	Name              string                        `mapstructure:"name"`
	Comment           string                        `mapstructure:"comment"`
	KernelOptions     Value[map[string]interface{}] `mapstructure:"kernel_options"`
	KernelOptionsPost Value[map[string]interface{}] `mapstructure:"kernel_options_post"`
	AutoinstallMeta   Value[map[string]interface{}] `mapstructure:"autoinstall_meta"`
	FetchableFiles    Value[map[string]interface{}] `mapstructure:"fetchable_files"`
	BootFiles         Value[map[string]interface{}] `mapstructure:"boot_files"`
	TemplateFiles     Value[map[string]interface{}] `mapstructure:"template_files"`
	Owners            Value[[]string]               `mapstructure:"owners"`
	MgmtClasses       Value[[]string]               `mapstructure:"mgmt_classes"`
	MgmtParameters    Value[map[string]interface{}] `mapstructure:"mgmt_parameters"`
}

Item general fields

func NewItem added in v0.5.0

func NewItem() Item

NewItem is a method to initialize the struct with the values that the server-side would internally use. Using this is important since the client overwrites all fields with those chosen locally inside the item.

type ItemMeta added in v0.5.0

type ItemMeta struct {
	IsFlattened bool
	IsResolved  bool
	// This flag signals if the item was modified by a called method server-side.
	IsDirty bool
}
type Menu struct {
	Item `mapstructure:",squash"`

	// Menu specific fields
	DisplayName string `mapstructure:"display_name"`
}

Menu is a created menu. Get the fields from cobbler/items/menu.py

func NewMenu added in v0.5.0

func NewMenu() Menu

type MgmtClass added in v0.5.0

type MgmtClass struct {
	Item `mapstructure:",squash"`

	// Mgmtclass specific fields
	IsDefiniton bool              `mapstructure:"is_definition"`
	Params      map[string]string `mapstructure:"params"`
	ClassName   string            `mapstructure:"class_name"`
	Files       []string          `mapstructure:"files"`
	Packages    []string          `mapstructure:"packages"`
}

func NewMgmtClass added in v0.5.0

func NewMgmtClass() MgmtClass

type OsVersion added in v0.5.0

type OsVersion struct {
	Signatures          []string            `json:"signatures" mapstructure:"signatures"`
	VersionFile         string              `json:"version_file" mapstructure:"version_file"`
	VersionFileRegex    string              `json:"version_file_regex" mapstructure:"version_file_regex"`
	KernelArch          string              `json:"kernel_arch" mapstructure:"kernel_arch"`
	KernelArchRegex     string              `json:"kernel_arch_regex" mapstructure:"kernel_arch_regex"`
	SupportedArches     []string            `json:"supported_arches" mapstructure:"supported_arches"`
	SupportedRepoBreeds []string            `json:"supported_repo_breeds" mapstructure:"supported_repo_breeds"`
	KernelFile          string              `json:"kernel_file" mapstructure:"kernel_file"`
	InitrdFile          string              `json:"initrd_file" mapstructure:"initrd_file"`
	IsolinuxOk          bool                `json:"isolinux_ok" mapstructure:"isolinux_ok"`
	DefaultAutoinstall  string              `json:"default_autoinstall" mapstructure:"default_autoinstall"`
	KernelOptions       string              `json:"kernel_options" mapstructure:"kernel_options"`
	KernelOptionsPost   string              `json:"kernel_options_post" mapstructure:"kernel_options_post"`
	TemplateFiles       string              `json:"template_files" mapstructure:"template_files"`
	BootFiles           []string            `json:"boot_files" mapstructure:"boot_files"`
	BootLoaders         map[string][]string `json:"boot_loaders" mapstructure:"boot_loaders"`
}

type Package added in v0.5.0

type Package struct {
	Resource `mapstructure:",squash"`

	// Package specific attributes
	Installer string `mapstructure:"installer"`
	Version   string `mapstructure:"version"`
}

Package is a created package. Get the fields from cobbler/items/package.py

func NewPackage added in v0.5.0

func NewPackage() Package

type PageInfo added in v0.5.0

type PageInfo struct {
	Page             int   `mapstructure:"page"`
	PrevPage         int   `mapstructure:"prev_page"`
	NextPage         int   `mapstructure:"next_page"`
	Pages            []int `mapstructure:"pages"`
	NumPages         int   `mapstructure:"num_pages"`
	NumItems         int   `mapstructure:"num_items"`
	StartItem        int   `mapstructure:"start_item"`
	EndItem          int   `mapstructure:"end_item"`
	ItemsPerPage     int   `mapstructure:"items_per_page"`
	ItemsPerPageList []int `mapstructure:"items_per_page_list"`
}

type PagedSearchResult added in v0.5.0

type PagedSearchResult struct {
	FoundItems []interface{} `mapstructure:"items"`
	PageInfo   PageInfo      `mapstructure:"pageinfo"`
}

type Profile added in v0.4.1

type Profile struct {
	Item `mapstructure:",squash"`

	// These are internal fields and cannot be modified.
	ReposEnabled bool `mapstructure:"repos_enabled"          cobbler:"noupdate"`

	Autoinstall         string          `mapstructure:"autoinstall"`
	BootLoaders         Value[[]string] `mapstructure:"boot_loaders"`
	DHCPTag             string          `mapstructure:"dhcp_tag"`
	Distro              string          `mapstructure:"distro"`
	EnableIPXE          Value[bool]     `mapstructure:"enable_ipxe"`
	EnableMenu          Value[bool]     `mapstructure:"enable_menu"`
	Filename            string          `mapstructure:"filename"`
	Menu                string          `mapstructure:"menu"`
	NameServers         Value[[]string] `mapstructure:"name_servers"`
	NameServersSearch   Value[[]string] `mapstructure:"name_servers_search"`
	NextServerv4        string          `mapstructure:"next_server_v4"`
	NextServerv6        string          `mapstructure:"next_server_v6"`
	Proxy               string          `mapstructure:"proxy"`
	RedhatManagementKey string          `mapstructure:"redhat_management_key"`
	Repos               []string        `mapstructure:"repos"`
	Server              string          `mapstructure:"server"`
	VirtAutoBoot        Value[bool]     `mapstructure:"virt_auto_boot"`
	VirtBridge          string          `mapstructure:"virt_bridge"`
	VirtCPUs            int             `mapstructure:"virt_cpus"`
	VirtDiskDriver      string          `mapstructure:"virt_disk_driver"`
	VirtFileSize        Value[float64]  `mapstructure:"virt_file_size"`
	VirtPath            string          `mapstructure:"virt_path"`
	VirtRAM             Value[int]      `mapstructure:"virt_ram"`
	VirtType            string          `mapstructure:"virt_type"`

	Client
}

Profile is a created profile. Get the fields from cobbler/items/profile.py

func NewProfile added in v0.5.0

func NewProfile() Profile

type ReplicateOptions added in v0.5.0

type ReplicateOptions struct {
	Master            string `mapstructure:"master"`
	Port              string `mapstructure:"port"`
	DistroPatterns    string `mapstructure:"distro_patterns"`
	ProfilePatterns   string `mapstructure:"profile_patterns"`
	SystemPatterns    string `mapstructure:"system_patterns"`
	RepoPatterns      string `mapstructure:"repo_patterns"`
	Imagepatterns     string `mapstructure:"image_patterns"`
	MgmtclassPatterns string `mapstructure:"mgmtclass_patterns"`
	PackagePatterns   string `mapstructure:"package_patterns"`
	FilePatterns      string `mapstructure:"file_patterns"`
	Prune             bool   `mapstructure:"prune"`
	OmitData          bool   `mapstructure:"omit_data"`
	SyncAll           bool   `mapstructure:"sync_all"`
	UseSsl            bool   `mapstructure:"use_ssl"`
}

ReplicateOptions is a struct which descibres the options one can set for the replicate action of Cobbler.

type Repo added in v0.4.1

type Repo struct {
	Item `mapstructure:",squash"`

	// These are internal fields and cannot be modified.
	TreeBuildTime string `mapstructure:"tree_build_time" cobbler:"noupdate"`

	AptComponents   []string          `mapstructure:"apt_components"`
	AptDists        []string          `mapstructure:"apt_dists"`
	Arch            string            `mapstructure:"arch"`
	Breed           string            `mapstructure:"breed"`
	CreateRepoFlags Value[string]     `mapstructure:"createrepo_flags"`
	Environment     map[string]string `mapstructure:"environment"`
	KeepUpdated     bool              `mapstructure:"keep_updated"`
	Mirror          string            `mapstructure:"mirror"`
	MirrorLocally   bool              `mapstructure:"mirror_locally"`
	MirrorType      string            `mapstructure:"mirror_type"`
	Priority        int               `mapstructure:"priority"`
	Proxy           Value[string]     `mapstructure:"proxy" cobbler:"newfield"`
	RsyncOpts       map[string]string `mapstructure:"rsyncopts"`
	RpmList         []string          `mapstructure:"rpm_list"`
	YumOpts         map[string]string `mapstructure:"yumopts"`
}

Repo is a created repo. Get the fileds from cobbler/items/repo.py

func NewRepo added in v0.5.0

func NewRepo() Repo

type Resource added in v0.5.0

type Resource struct {
	Item `mapstructure:",squash"`

	// Resource specific attributes
	// Action   ResourceAction `mapstructure:"action"`
	Action   string `mapstructure:"action"`
	Mode     string `mapstructure:"mode"`
	Owner    string `mapstructure:"owner"`
	Group    string `mapstructure:"group"`
	Path     string `mapstructure:"path"`
	Template string `mapstructure:"template"`
}

Resource is an abstract item type that cannot be directly instantiated. Get the fields from cobbler/items/resource.py

func NewResource added in v0.5.0

func NewResource() Resource

type ResourceAction added in v0.5.0

type ResourceAction int64

func (ResourceAction) String added in v0.5.0

func (r ResourceAction) String() string

type Settings added in v0.5.0

type Settings struct {
	AllowDuplicateHostnames           bool                                  `json:"allow_duplicate_hostnames" mapstructure:"allow_duplicate_hostnames"`
	AllowDuplicateIPs                 bool                                  `json:"allow_duplicate_ips" mapstructure:"allow_duplicate_ips"`
	AllowDuplicateMACs                bool                                  `json:"allow_duplicate_macs" mapstructure:"allow_duplicate_macs"`
	AllowDynamicSettings              bool                                  `json:"allow_dynamic_settings" mapstructure:"allow_dynamic_settings"`
	AlwaysWriteDhcpEntries            bool                                  `json:"always_write_dhcp_entries" mapstructure:"always_write_dhcp_entries"`
	AnamonEnabled                     bool                                  `json:"anamon_enabled" mapstructure:"anamon_enabled"`
	AuthTokenExpiration               int                                   `json:"auth_token_expiration" mapstructure:"auth_token_expiration"`
	AuthnPamService                   string                                `json:"authn_pam_service" mapstructure:"authn_pam_service"`
	AutoMigrateSettings               bool                                  `json:"auto_migrate_settings" mapstructure:"auto_migrate_settings"`
	Autoinstall                       string                                `json:"autoinstall" mapstructure:"autoinstall"`
	AutoinstallSnippetsDirectory      string                                `json:"autoinstall_snippets_dir" mapstructure:"autoinstall_snippets_dir"`
	AutoinstallTemplatesDirectory     string                                `json:"autoinstall_templates_dir" mapstructure:"autoinstall_templates_dir"`
	BUildReportingIgnorelist          []string                              `json:"build_reporting_ignorelist" mapstructure:"build_reporting_ignorelist"`
	BindChrootPath                    string                                `json:"bind_chroot_path" mapstructure:"bind_chroot_path"`
	BindManageIpmi                    bool                                  `json:"bind_manage_ipmi" mapstructure:"bind_manage_ipmi"`
	BindMaster                        string                                `json:"bind_master" mapstructure:"bind_master"`
	BindZonefilePath                  string                                `json:"bind_zonefile_path" mapstructure:"bind_zonefile_path"`
	BootloaderConfTemplateDirectory   string                                `json:"boot_loader_conf_template_dir" mapstructure:"boot_loader_conf_template_dir"`
	BootloaderDirectory               string                                `json:"bootloaders_dir" mapstructure:"bootloaders_dir"`
	BootloaderFormats                 map[string][]BootloaderFormatSettings `json:"bootloaders_formats" mapstructure:"bootloaders_formats"`
	BootloaderIPXEFolder              string                                `json:"bootloaders_ipxe_folder" mapstructure:"bootloaders_ipxe_folder"`
	BootloaderModules                 []string                              `json:"bootloaders_modules" mapstructure:"bootloaders_modules"`
	BootloaderShimDirectory           string                                `json:"bootloaders_shim_folder" mapstructure:"bootloaders_shim_folder"`
	BootloaderShimFile                string                                `json:"bootloaders_shim_file" mapstructure:"bootloaders_shim_file"`
	BuildReportingEmail               []string                              `json:"build_reporting_email" mapstructure:"build_reporting_email"`
	BuildReportingEnabled             bool                                  `json:"build_reporting_enabled" mapstructure:"build_reporting_enabled"`
	BuildReportingSender              string                                `json:"build_reporting_sender" mapstructure:"build_reporting_sender"`
	BuildReportingSmtpServer          string                                `json:"build_reporting_smtp_server" mapstructure:"build_reporting_smtp_server"`
	BuildReportingSubject             string                                `json:"build_reporting_subject" mapstructure:"build_reporting_subject"`
	BuildisoDirectory                 string                                `json:"buildisodir" mapstructure:"buildisodir"`
	CacheEnabled                      bool                                  `json:"cache_enabled" mapstructure:"cache_enabled"`
	CheetahImportWhitelist            []string                              `json:"cheetah_import_whitelist" mapstructure:"cheetah_import_whitelist"`
	ClientUseHttps                    bool                                  `json:"client_use_https" mapstructure:"client_use_https"`
	ClientUseLocalhost                bool                                  `json:"client_use_localhost" mapstructure:"client_use_localhost"`
	CobblerMaster                     string                                `json:"cobbler_master" mapstructure:"cobbler_master"`
	ConvertServerToIp                 bool                                  `json:"convert_server_to_ip" mapstructure:"convert_server_to_ip"`
	CreaterepoFlags                   string                                `json:"createrepo_flags" mapstructure:"createrepo_flags"`
	DefaultNameServers                []string                              `json:"default_name_servers" mapstructure:"default_name_servers"`
	DefaultNameServersSearch          []string                              `json:"default_name_servers_search" mapstructure:"default_name_servers_search"`
	DefaultOwnership                  []string                              `json:"default_ownership" mapstructure:"default_ownership"`
	DefaultPasswordCrypted            string                                `json:"default_password_crypted" mapstructure:"default_password_crypted"`
	DefaultTemplateType               string                                `json:"default_template_type" mapstructure:"default_template_type"`
	DefaultVirtBridge                 string                                `json:"default_virt_bridge" mapstructure:"default_virt_bridge"`
	DefaultVirtDiskDriver             string                                `json:"default_virt_disk_driver" mapstructure:"default_virt_disk_driver"`
	DefaultVirtFileSize               float64                               `json:"default_virt_file_size" mapstructure:"default_virt_file_size"`
	DefaultVirtRam                    int                                   `json:"default_virt_ram" mapstructure:"default_virt_ram"`
	DefaultVirtType                   string                                `json:"default_virt_type" mapstructure:"default_virt_type"`
	EnableIpxe                        bool                                  `json:"enable_ipxe" mapstructure:"enable_ipxe"`
	EnableMenu                        bool                                  `json:"enable_menu" mapstructure:"enable_menu"`
	ExtraSettingsList                 []string                              `json:"extra_settings_list" mapstructure:"extra_settings_list"`
	Grub2ModDirectory                 string                                `json:"grub2_mod_dir" mapstructure:"grub2_mod_dir"`
	GrubconfigDirectory               string                                `json:"grubconfig_dir" mapstructure:"grubconfig_dir"`
	HttpPort                          int                                   `json:"http_port" mapstructure:"http_port"`
	Include                           []string                              `json:"include" mapstructure:"include"`
	IsoTemplateDirectory              string                                `json:"iso_template_dir" mapstructure:"iso_template_dir"`
	Jinja2IncludeDirectory            string                                `json:"jinja2_includedir" mapstructure:"jinja2_includedir"`
	KernelOptions                     map[string]string                     `json:"kernel_options" mapstructure:"kernel_options"`
	LazyStart                         bool                                  `json:"lazy_start" mapstructure:"lazy_start"`
	LdapAnonymousBind                 bool                                  `json:"ldap_anonymous_bind" mapstructure:"ldap_anonymous_bind"`
	LdapBaseDn                        string                                `json:"ldap_base_dn" mapstructure:"ldap_base_dn"`
	LdapPort                          int                                   `json:"ldap_port" mapstructure:"ldap_port"`
	LdapSearchBindDn                  string                                `json:"ldap_search_bind_dn" mapstructure:"ldap_search_bind_dn"`
	LdapSearchPasswd                  string                                `json:"ldap_search_passwd" mapstructure:"ldap_search_passwd"`
	LdapSearchPrefix                  string                                `json:"ldap_search_prefix" mapstructure:"ldap_search_prefix"`
	LdapServer                        string                                `json:"ldap_server" mapstructure:"ldap_server"`
	LdapTls                           bool                                  `json:"ldap_tls" mapstructure:"ldap_tls"`
	LdapTlsCaCertDirectory            string                                `json:"ldap_tls_cacertdir" mapstructure:"ldap_tls_cacertdir"`
	LdapTlsCaCertFile                 string                                `json:"ldap_tls_cacertfile" mapstructure:"ldap_tls_cacertfile"`
	LdapTlsCertFile                   string                                `json:"ldap_tls_certfile" mapstructure:"ldap_tls_certfile"`
	LdapTlsCipherSuite                string                                `json:"ldap_tls_cipher_suite" mapstructure:"ldap_tls_cipher_suite"`
	LdapTlsKeyFile                    string                                `json:"ldap_tls_keyfile" mapstructure:"ldap_tls_keyfile"`
	LdapTlsReqcert                    string                                `json:"ldap_tls_reqcert" mapstructure:"ldap_tls_reqcert"`
	ManageDhcp                        bool                                  `json:"manage_dhcp" mapstructure:"manage_dhcp"`
	ManageDhcpV4                      bool                                  `json:"manage_dhcp_v4" mapstructure:"manage_dhcp_v4"`
	ManageDhcpV6                      bool                                  `json:"manage_dhcp_v6" mapstructure:"manage_dhcp_v6"`
	ManageDns                         bool                                  `json:"manage_dns" mapstructure:"manage_dns"`
	ManageForwardZones                []string                              `json:"manage_forward_zones" mapstructure:"manage_forward_zones"`
	ManageGenders                     bool                                  `json:"manage_genders" mapstructure:"manage_genders"`
	ManageReverseZones                []string                              `json:"manage_reverse_zones" mapstructure:"manage_reverse_zones"`
	ManageRsync                       bool                                  `json:"manage_rsync" mapstructure:"manage_rsync"`
	ManageTftpd                       bool                                  `json:"manage_tftpd" mapstructure:"manage_tftpd"`
	MgmtClasses                       []string                              `json:"mgmt_classes" mapstructure:"mgmt_classes"`
	MgmtParameters                    map[string]string                     `json:"mgmt_parameters" mapstructure:"mgmt_parameters"`
	NextServerV4                      string                                `json:"next_server_v4" mapstructure:"next_server_v4"`
	NextServerV6                      string                                `json:"next_server_v6" mapstructure:"next_server_v6"`
	NoPxeWithTriggers                 bool                                  `json:"nopxe_with_triggers" mapstructure:"nopxe_with_triggers"`
	NsupdateEnabled                   bool                                  `json:"nsupdate_enabled" mapstructure:"nsupdate_enabled"`
	NsupdateLog                       string                                `json:"nsupdate_log" mapstructure:"nsupdate_log"`
	NsupdateTsigAlorithm              string                                `json:"nsupdate_tsig_algorithm" mapstructure:"nsupdate_tsig_algorithm"`
	NsupdateTsigKey                   []string                              `json:"nsupdate_tsig_key" mapstructure:"nsupdate_tsig_key"`
	PowerManagementDefaultType        string                                `json:"power_management_default_type" mapstructure:"power_management_default_type"`
	Proxies                           []string                              `json:"proxies" mapstructure:"proxies"`
	ProxyUrlExternal                  string                                `json:"proxy_url_ext" mapstructure:"proxy_url_ext"`
	ProxyUrlInternal                  string                                `json:"proxy_url_int" mapstructure:"proxy_url_int"`
	PuppetAutoSetup                   bool                                  `json:"puppet_auto_setup" mapstructure:"puppet_auto_setup"`
	PuppetCaPath                      string                                `json:"puppetca_path" mapstructure:"puppetca_path"`
	PuppetParametrizedClasses         bool                                  `json:"puppet_parameterized_classes" mapstructure:"puppet_parameterized_classes"`
	PuppetServer                      string                                `json:"puppet_server" mapstructure:"puppet_server"`
	PuppetVersion                     int                                   `json:"puppet_version" mapstructure:"puppet_version"`
	PxeJustOnce                       bool                                  `json:"pxe_just_once" mapstructure:"pxe_just_once"`
	RedhatManagementKey               string                                `json:"redhat_management_key" mapstructure:"redhat_management_key"`
	RedhatManagementPermissive        bool                                  `json:"redhat_management_permissive" mapstructure:"redhat_management_permissive"`
	RedhatManagementServer            string                                `json:"redhat_management_server" mapstructure:"redhat_management_server"`
	RegisterNewInstalls               bool                                  `json:"register_new_installs" mapstructure:"register_new_installs"`
	RemoveOldPuppetCertsAutomatically bool                                  `json:"remove_old_puppet_certs_automatically" mapstructure:"remove_old_puppet_certs_automatically"`
	ReplicateRepoRsyncOptions         string                                `json:"replicate_repo_rsync_options" mapstructure:"replicate_repo_rsync_options"`
	ReplicateRsyncOptions             string                                `json:"replicate_rsync_options" mapstructure:"replicate_rsync_options"`
	ReposyncFlags                     string                                `json:"reposync_flags" mapstructure:"reposync_flags"`
	ReposyncRsyncFlags                string                                `json:"reposync_rsync_flags" mapstructure:"reposync_rsync_flags"`
	RestartDhcp                       bool                                  `json:"restart_dhcp" mapstructure:"restart_dhcp"`
	RestartDns                        bool                                  `json:"restart_dns" mapstructure:"restart_dns"`
	RunInstallTriggers                bool                                  `json:"run_install_triggers" mapstructure:"run_install_triggers"`
	SambaDistroShare                  string                                `json:"samba_distro_share" mapstructure:"samba_distro_share"`
	ScmPushScript                     string                                `json:"scm_push_script" mapstructure:"scm_push_script"`
	ScmTrackAuthor                    string                                `json:"scm_track_author" mapstructure:"scm_track_author"`
	ScmTrackEnabled                   bool                                  `json:"scm_track_enabled" mapstructure:"scm_track_enabled"`
	ScmTrackMode                      string                                `json:"scm_track_mode" mapstructure:"scm_track_mode"`
	SerializerPrettyJson              bool                                  `json:"serializer_pretty_json" mapstructure:"serializer_pretty_json"`
	Server                            string                                `json:"server" mapstructure:"server"`
	SignPuppetCertsAutomatically      bool                                  `json:"sign_puppet_certs_automatically" mapstructure:"sign_puppet_certs_automatically"`
	SignaturePath                     string                                `json:"signature_path" mapstructure:"signature_path"`
	SignatureUrl                      string                                `json:"signature_url" mapstructure:"signature_url"`
	SyslinuxDirectory                 string                                `json:"syslinux_dir" mapstructure:"syslinux_dir"`
	SyslinuxMemdiskDirectory          string                                `json:"syslinux_memdisk_folder" mapstructure:"syslinux_memdisk_folder"`
	SyslinuxPxelinuxDirectory         string                                `json:"syslinux_pxelinux_folder" mapstructure:"syslinux_pxelinux_folder"`
	TftpbootLocation                  string                                `json:"tftpboot_location" mapstructure:"tftpboot_location"`
	VirtAutoBoot                      bool                                  `json:"virt_auto_boot" mapstructure:"virt_auto_boot"`
	WebDirectory                      string                                `json:"webdir" mapstructure:"webdir"`
	WebDirectoryWhitelist             []string                              `json:"webdir_whitelist" mapstructure:"webdir_whitelist"`
	WindowsEnabled                    bool                                  `json:"windows_enabled" mapstructure:"windows_enabled"`
	WindowsTemplateDirectory          string                                `json:"windows_template_dir" mapstructure:"windows_template_dir"`
	XmlrpcPort                        int                                   `json:"xmlrpc_port" mapstructure:"xmlrpc_port"`
	YumDistroPriority                 int                                   `json:"yum_distro_priority" mapstructure:"yum_distro_priority"`
	YumDownloaderFlags                string                                `json:"yumdownloader_flags" mapstructure:"yumdownloader_flags"`
	YumPostInstallMirror              bool                                  `json:"yum_post_install_mirror" mapstructure:"yum_post_install_mirror"`
}

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 StubHTTPClient added in v0.5.0

type StubHTTPClient struct {
	ShouldVerify bool // Make sure that the expected and the actual sent payload match.
	// contains filtered or unexported fields
}

func NewStubHTTPClient added in v0.5.0

func NewStubHTTPClient(t *testing.T) *StubHTTPClient

func (*StubHTTPClient) Post added in v0.5.0

func (s *StubHTTPClient) Post(uri, bodyType string, req io.Reader) (*http.Response, error)

func (*StubHTTPClient) Verify added in v0.5.0

func (s *StubHTTPClient) Verify()

type System

type System struct {
	Item `mapstructure:",squash"`

	// These are internal fields and cannot be modified.
	IPv6Autoconfiguration bool            `mapstructure:"ipv6_autoconfiguration" cobbler:"noupdate"`
	ReposEnabled          bool            `mapstructure:"repos_enabled"          cobbler:"noupdate"`
	Autoinstall           string          `mapstructure:"autoinstall"`
	BootLoaders           Value[[]string] `mapstructure:"boot_loaders"`
	EnableIPXE            Value[bool]     `mapstructure:"enable_ipxe"`
	EnableMenu            Value[bool]     `mapstructure:"enable_menu"`
	Filename              string          `mapstructure:"filename"`
	Gateway               string          `mapstructure:"gateway"`
	Hostname              string          `mapstructure:"hostname"`
	IPv6DefaultDevice     string          `mapstructure:"ipv6_default_device"`
	Image                 string          `mapstructure:"image"`
	Interfaces            Interfaces      `mapstructure:"interfaces" cobbler:"noupdate"`
	Menu                  string          `mapstructure:"menu"`
	NameServers           []string        `mapstructure:"name_servers"`
	NameServersSearch     []string        `mapstructure:"name_servers_search"`
	NetbootEnabled        bool            `mapstructure:"netboot_enabled"`
	NextServerv4          string          `mapstructure:"next_server_v4"`
	NextServerv6          string          `mapstructure:"next_server_v6"`
	PowerAddress          string          `mapstructure:"power_address"`
	PowerID               string          `mapstructure:"power_id"`
	PowerIdentityFile     string          `mapstructure:"power_identity_file"`
	PowerOptions          string          `mapstructure:"power_options"`
	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"`
	SerialBaudRate        int             `mapstructure:"serial_baud_rate"`
	SerialDevice          int             `mapstructure:"serial_device"`
	Server                string          `mapstructure:"server"`
	Status                string          `mapstructure:"status"`
	VirtAutoBoot          Value[bool]     `mapstructure:"virt_auto_boot"`
	VirtCPUs              Value[int]      `mapstructure:"virt_cpus"`
	VirtDiskDriver        string          `mapstructure:"virt_disk_driver"`
	VirtFileSize          Value[float64]  `mapstructure:"virt_file_size"`
	VirtPXEBoot           bool            `mapstructure:"virt_pxe_boot"`
	VirtPath              string          `mapstructure:"virt_path"`
	VirtRAM               Value[int]      `mapstructure:"virt_ram"`
	VirtType              string          `mapstructure:"virt_type"`

	Client
}

System is a created system.

func NewSystem added in v0.5.0

func NewSystem() System

func (*System) CreateInterface added in v0.4.1

func (s *System) CreateInterface(name string, iface Interface) error

CreateInterface creates network interfaces in Cobbler

func (*System) DeleteInterface added in v0.4.1

func (s *System) DeleteInterface(name string) error

DeleteInterface deletes a single interface in a System.

func (*System) GetInterface added in v0.4.1

func (s *System) GetInterface(name string) (Interface, error)

GetInterface returns a single interface in a System.

func (*System) GetInterfaces added in v0.4.1

func (s *System) GetInterfaces() (Interfaces, error)

GetInterfaces returns all interfaces in a System.

type TemplateFile added in v0.4.1

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

type Value added in v0.5.0

type Value[T any] struct {
	// Data contains the unresolved or resolved data of the attribute. This is not set in case the value is flattened.
	Data T
	// FlattenedValue contains the unresolved or resolved flattened data of the Attribute. This is not set in case the
	// value is not flattened.
	FlattenedValue string
	// IsInherited is a flag that signals if the attribute is inherited or not. If this flag is true then both Data and
	// FlattenedValue are not set.
	IsInherited bool
	// RawData contains the data as received by the API. This field is not evaluated when updating an Item via the
	// API.
	RawData interface{}
}

Value is a helper struct that wraps the multi-typed values being returned from the Cobbler API.

type VirtDiskDriver added in v0.5.0

type VirtDiskDriver int64

func (VirtDiskDriver) String added in v0.5.0

func (v VirtDiskDriver) String() string

type VirtType added in v0.5.0

type VirtType int64

func (VirtType) String added in v0.5.0

func (v VirtType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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