Documentation ¶
Index ¶
- Constants
- Variables
- func Provider() *schema.Provider
- type Arguments
- type Client
- type ClientClasses
- type Config
- type ControlSocket
- type DHCPDDNS
- type DHCPQueueControl
- type Dhcp4
- type ExpiredLeasesProcessing
- type HooksLibraries
- type InterfacesConfig
- type LeaseDatabase
- type Loggers
- type NestedElem
- type OptionData
- type OutputOptions
- type Pools
- type Relay
- type Reservations
- type Response
- type SanityChecks
- type Subnet4
Constants ¶
const ( KEA_SUCCESS int = iota KEA_ERROR KEA_UNSUPPORTED KEA_EMPTY )
REST API response codes
Variables ¶
var SERVICE []string = []string{"dhcp4"}
SERVICE define which IP version we are use (currently only dhcp4 supported)
Functions ¶
Types ¶
type Client ¶
type Client struct { Config *Config // contains filtered or unexported fields }
Client for connections
func (*Client) DeleteLease ¶
func (c *Client) DeleteLease(r Reservations) error
DeleteLease resource
func (*Client) NewLease ¶
func (c *Client) NewLease(r Reservations) error
NewLease method to create new lease fot kea-dhcpd4 works!
func (*Client) ReadLease ¶
func (c *Client) ReadLease(r Reservations) bool
ReadLease method to check if lease exists in kea-dhcpd4
func (*Client) SaveConfig ¶
SaveConfig method to save a config file for kea-dhcpd4
func (*Client) UpdateLease ¶
func (c *Client) UpdateLease(r Reservations) error
UpdateLease resource works!
type ClientClasses ¶
type ClientClasses struct { Name string `json:"name"` OptionData []OptionData `json:"option-data"` Test string `json:"test"` }
ClientClasses structure
type ControlSocket ¶
type ControlSocket struct { SocketName string `json:"socket-name"` SocketType string `json:"socket-type"` }
ControlSocket structure
type DHCPDDNS ¶
type DHCPDDNS struct { EnableUpdates bool `json:"enable-updates"` GeneratedPrefix string `json:"generated-prefix"` MaxQueueSize int `json:"max-queue-size"` NCRFormat string `json:"ncr-format"` NCRProtocol string `json:"ncr-protocol"` OverrideClientUpdate bool `json:"override-client-update"` OverrideNoUpdate bool `json:"override-no-update"` QualifyingSuffix string `json:"qualifying-suffix"` ReplaceClientName string `json:"replace-client-name"` SenderIP string `json:"sender-ip"` SenderPort int `json:"sender-port"` ServerIP string `json:"server-ip"` ServerPort int `json:"server-port"` }
DHCPDDNS structure
type DHCPQueueControl ¶
type DHCPQueueControl struct { Capacity int `json:"capacity"` EnableQueue bool `json:"enable-queue"` QueueType string `json:"queue-type"` }
DHCPQueueControl structure
type Dhcp4 ¶
type Dhcp4 struct { Authoritative bool `json:"authoritative"` BootFileName string `json:"boot-file-name"` CalculateTeeTimes bool `json:"calculate-tee-times"` ClientClasses []ClientClasses `json:"client-classes,omitempty"` ControlSocket ControlSocket `json:"control-socket"` DDNSGeneratedPrefix string `json:"ddns-generated-prefix,omitempty"` DDNSOverrideClientUpdates bool `json:"ddns-override-client-update,omitempty"` DDNSOverrideNoUpdate bool `json:"ddns-override-no-update,omitempty"` DDNSQualifyingSuffix string `json:"ddns-qualifying-suffix,omitempty"` DDNSReplaceClientName string `json:"ddns-replace-client-name,omitempty"` DDNSSendUpdates bool `json:"ddns-send-updates,omitempty"` DeclineProbationPeriod int `json:"decline-probation-period"` DHCPDDNS DHCPDDNS `json:"dhcp-ddns"` DHCPQueueControl DHCPQueueControl `json:"dhcp-queue-control"` DHCP4o6Port int `json:"dhcp4o6-port"` EchoClientId bool `json:"echo-client-id"` ExpiredLeasesProcessing ExpiredLeasesProcessing `json:"expired-leases-processing"` HooksLibraries []HooksLibraries `json:"hooks-libraries"` HostReservationIdentifiers []string `json:"host-reservation-identifiers"` InterfacesConfig InterfacesConfig `json:"interfaces-config"` LeaseDatabase LeaseDatabase `json:"lease-database"` Loggers []Loggers `json:"loggers"` MatchClientId bool `json:"match-client-id"` NextServer string `json:"next-server"` OptionData []OptionData `json:"option-data"` OptionDef interface{} `json:"option-def,omitempty"` // Not implemented RebindTimer int `json:"rebind-timer"` RenewTimer int `json:"renew-timer"` ReservationMode string `json:"reservation-mode,omitempty"` SanityChecks SanityChecks `json:"sanity-checks"` ServerHostname string `json:"server-hostname"` ServerTag string `json:"server-tag"` Subnet4 []Subnet4 `json:"subnet4"` T1Percent float64 `json:"t1-percent"` T2Percent float64 `json:"t2-percent"` ValidLifetime int `json:"valid-lifetime"` }
Dhcp4 structure
type ExpiredLeasesProcessing ¶
type ExpiredLeasesProcessing struct { FlushReclaimedTimerWaitTime int `json:"flush-reclaimed-timer-wait-time"` HoldReclaimedTime int `json:"hold-reclaimed-time"` MaxReclaimLeases int `json:"max-reclaim-leases"` MaxReclaimTime int `json:"max-reclaim-time"` ReclaimTimerWaitTime int `json:"reclaim-timer-wait-time"` UnwarnedReclaimCycles int `json:"unwarned-reclaim-cycles"` }
ExpiredLeasesProcessing structure
type HooksLibraries ¶
type HooksLibraries struct {
Library string `json:"library"`
}
HooksLibraries structure
type InterfacesConfig ¶
type InterfacesConfig struct { Interfaces []string `json:"interfaces"` ReDetect bool `json:"re-detect"` }
InterfacesConfig structure
type LeaseDatabase ¶
type LeaseDatabase struct { LFCInterval int `json:"lfc-interval"` Name string `json:"name"` Persist bool `json:"persist"` Type string `json:"type"` }
LeaseDatabase structure
type Loggers ¶
type Loggers struct { DebugLevel int `json:"debuglevel"` Name string `json:"name"` OutputOptions []OutputOptions `json:"output_options"` Severity string `json:"severity"` }
Loggers structure
type NestedElem ¶
NestedElem elements in root
type OptionData ¶
type OptionData struct { AlwaysSend bool `json:"always-send"` Code int `json:"code,omitempty"` CSVFormat bool `json:"csv-format"` Data string `json:"data"` Name string `json:"name,omitempty"` Space string `json:"space"` }
OptionData structure
type OutputOptions ¶
type OutputOptions struct {
Output string `json:"output"`
}
OutputOptions structure
type Pools ¶
type Pools struct { OptionData []OptionData `json:"option-data"` Pool string `json:"pool"` }
Pools structure
type Relay ¶
type Relay struct {
IPAddresses interface{} `json:"ip-addresses"` // Not implemented
}
Relay structure
type Reservations ¶
type Reservations struct { BootFileName string `json:"boot-file-name"` ClientClasses []string `json:"client-classes"` Hostname string `json:"hostname"` HWAddress string `json:"hw-address"` IPAddress string `json:"ip-address"` NextServer string `json:"next-server"` OptionData []OptionData `json:"option-data"` ServerHostname string `json:"server-hostname"` }
Reservations structure
type SanityChecks ¶
type SanityChecks struct {
LeaseChecks string `json:"lease-checks"`
}
SanityChecks structure
type Subnet4 ¶
type Subnet4 struct { FourOverSixInterface string `json:"4o6-interface"` FourOverSixInterfaceId string `json:"4o6-interface-id"` FourOverSixSubnet string `json:"4o6-subnet"` Authoritative bool `json:"authoritative"` CalculateTeeTimes bool `json:"calculate-tee-times"` Id int `json:"id"` MatchClientId bool `json:"match-client-id"` NextServer string `json:"next-server"` OptionData []OptionData `json:"option-data"` Pools []Pools `json:"pools"` RebindTimer int `json:"rebind-timer"` Relay interface{} `json:"relay"` RenewTimer int `json:"renew-timer"` ReservationMode string `json:"reservation-mode,omitempty"` Reservations []Reservations `json:"reservations"` Subnet string `json:"subnet"` T1Percent float64 `json:"t1-percent"` T2Percent float64 `json:"t2-percent"` ValidLifetime int `json:"valid-lifetime"` }
Subnet4 structure