Documentation
¶
Index ¶
- Variables
- func FetchRemoteConfig(factumConfig *util.ConfigFactum) (*util.ConfigOxidized, error)
- func NewOxidizedClient(c util.ConfigOxidized) *oxidizedClient
- func RemoteClient(factumConfig *util.ConfigFactum) (*oxidizedClient, error)
- func SplitNodeFull(nodeFull string) (group, node string)
- type Diff
- type FactumOxidizedClient
- type Node
- type OxidizedDevice
- type Version
- type VersionAuthor
Constants ¶
This section is empty.
Variables ¶
var ErrNotConfigured = fmt.Errorf("oxidized API URL is not configured")
ErrNotConfigured is returned when Settings.OxidizedApiURL is empty.
var ErrNotImplemented = errors.New("not implemented")
ErrNotImplemented is returned by GetDevice, which oxidized has no single- device lookup API for - only a full router.db dump (LoadDevices/GetDevices) or a fetch of a device's last stored config (GetDeviceConfig).
Functions ¶
func FetchRemoteConfig ¶
func FetchRemoteConfig(factumConfig *util.ConfigFactum) (*util.ConfigOxidized, error)
FetchRemoteConfig pulls the Oxidized API connection settings from the primary, authenticated with factumConfig.Token (checked against the primary's Settings.FactumApiToken - see web.Controller.checkServiceToken).
func NewOxidizedClient ¶
func NewOxidizedClient(c util.ConfigOxidized) *oxidizedClient
func RemoteClient ¶
func RemoteClient(factumConfig *util.ConfigFactum) (*oxidizedClient, error)
RemoteClient is the FetchRemoteConfig + NewOxidizedClient convenience most callers want.
func SplitNodeFull ¶ added in v1.0.3
SplitNodeFull mirrors oxidized-web's node_full parsing: the last '/' separates group from node, so groups themselves may contain slashes.
Types ¶
type Diff ¶ added in v1.0.3
type Diff struct {
Patch string `json:"patch"`
Added int `json:"added"`
Removed int `json:"removed"`
}
Diff is a unified patch between two versions of one node's config.
type FactumOxidizedClient ¶
type FactumOxidizedClient struct {
Config *util.ConfigFactum
OxidizedConfig *util.ConfigOxidized
Oxidized *oxidizedClient
}
func NewFactumOxidizedClient ¶
func NewFactumOxidizedClient(config *util.ConfigFactum) (*FactumOxidizedClient, error)
NewFactumOxidizedClient fetches the Oxidized API connection settings and the oxidized-sync settings (router.db path, ignore lists) from the primary over REST - config.Oxidized is never used, since factum2-oxidized typically runs on a different host than the primary and has no local oxidized config of its own (see util.ConfigOxidized's doc comment).
type Node ¶ added in v1.0.3
type Node struct {
Name string `json:"name"`
FullName string `json:"full_name"`
IP string `json:"ip"`
Group string `json:"group"`
Model string `json:"model"`
Status string `json:"status"`
Time string `json:"time"`
Mtime string `json:"mtime"`
}
Node is one entry from GET /nodes.json after oxidized-web flattens last-status onto the row.
type OxidizedDevice ¶
OxidizedDevice is one entry from oxidized's own router.db file.
type Version ¶ added in v1.0.3
type Version struct {
OID string `json:"oid"`
Date string `json:"date"`
Time string `json:"time"`
Author VersionAuthor `json:"author"`
Message string `json:"message"`
}
Version is one git commit that touched a node's config (GET /node/version.json).
type VersionAuthor ¶ added in v1.0.3
VersionAuthor is the git committer oxidized recorded for a version.