Documentation ¶
Overview ¶
Package node implements nodes. They do chef-client runs.
Index ¶
- func Count() int64
- func DeleteNodeStatusesByAge(dur time.Duration) (int, error)
- func DoesExist(nodeName string) (bool, util.Gerror)
- func GetList() []string
- func ImportStatus(nodeJSON map[string]interface{}) error
- type ByTime
- type Node
- func AllNodes() []*Node
- func Get(nodeName string) (*Node, util.Gerror)
- func GetFromEnv(envName string) ([]*Node, error)
- func GetMulti(nodeNames []string) ([]*Node, util.Gerror)
- func GetNodesByStatus(nodeNames []string, status string) ([]*Node, error)
- func New(name string) (*Node, util.Gerror)
- func NewFromJSON(jsonNode map[string]interface{}) (*Node, util.Gerror)
- func UnseenNodes() ([]*Node, error)
- func (n *Node) AllStatuses() ([]*NodeStatus, error)
- func (n *Node) Delete() error
- func (n *Node) DocID() string
- func (n *Node) Flatten() map[string]interface{}
- func (n *Node) GetName() string
- func (n *Node) Index() string
- func (n *Node) LatestStatus() (*NodeStatus, error)
- func (n *Node) Save() error
- func (n *Node) URLType() string
- func (n *Node) UpdateFromJSON(jsonNode map[string]interface{}) util.Gerror
- func (n *Node) UpdateStatus(status string) error
- type NodeStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteNodeStatusesByAge ¶ added in v0.11.7
DeleteNodeStatusesByAge deletes node status older than the given duration. It returns the number of statuses deleted, and an error if any.
func ImportStatus ¶ added in v0.8.0
ImportStatus is used by the import function to import node statuses from the exported JSON dump.
Types ¶
type ByTime ¶ added in v0.11.7
type ByTime []*NodeStatus
type Node ¶
type Node struct { Name string `json:"name"` ChefEnvironment string `json:"chef_environment"` RunList []string `json:"run_list"` JSONClass string `json:"json_class"` ChefType string `json:"chef_type"` Automatic map[string]interface{} `json:"automatic"` Normal map[string]interface{} `json:"normal"` Default map[string]interface{} `json:"default"` Override map[string]interface{} `json:"override"` // contains filtered or unexported fields }
Node is a basic Chef node, holding the run list and attributes of the node.
func AllNodes ¶ added in v0.5.2
func AllNodes() []*Node
AllNodes returns all the nodes on the server
func GetFromEnv ¶ added in v0.5.0
GetFromEnv returns all nodes that belong to the given environment.
func GetNodesByStatus ¶ added in v0.8.0
GetNodesByStatus returns the nodes that currently have the given status.
func NewFromJSON ¶ added in v0.6.0
NewFromJSON creates a new node from the uploaded JSON.
func UnseenNodes ¶ added in v0.8.0
UnseenNodes returns all nodes that have not sent status reports for a while.
func (*Node) AllStatuses ¶ added in v0.8.0
func (n *Node) AllStatuses() ([]*NodeStatus, error)
AllStatuses returns all of the node's status reports to date.
func (*Node) LatestStatus ¶ added in v0.8.0
func (n *Node) LatestStatus() (*NodeStatus, error)
LatestStatus returns the node's latest status.
func (*Node) UpdateFromJSON ¶ added in v0.6.0
UpdateFromJSON updates an existing node with the uploaded JSON.
func (*Node) UpdateStatus ¶ added in v0.8.0
UpdateStatus updates a node's current status (up, down, or new).
type NodeStatus ¶ added in v0.8.0
NodeStatus records a node's status at a particular time.
func AllNodeStatuses ¶ added in v0.8.0
func AllNodeStatuses() []*NodeStatus
AllNodeStatuses returns all node status reports on the server, from all nodes.
func (*NodeStatus) ToJSON ¶ added in v0.8.0
func (ns *NodeStatus) ToJSON() map[string]string
ToJSON formats a node status report for export to JSON.