node

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package node implements nodes. They do chef-client runs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetList

func GetList() []string

GetList gets a list of the nodes on this server.

Types

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"`
}

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 Get

func Get(nodeName string) (*Node, error)

Get a node.

func GetFromEnv added in v0.5.0

func GetFromEnv(envName string) ([]*Node, error)

GetFromEnv returns all nodes that belong to the given environment.

func New

func New(name string) (*Node, util.Gerror)

New makes a new node.

func NewFromJSON added in v0.6.0

func NewFromJSON(jsonNode map[string]interface{}) (*Node, util.Gerror)

NewFromJSON creates a new node from the uploaded JSON.

func (*Node) Delete

func (n *Node) Delete() error

Delete the node.

func (*Node) DocID added in v0.6.0

func (n *Node) DocID() string

DocID returns the node's name.

func (*Node) Flatten

func (n *Node) Flatten() []string

Flatten a node for indexing.

func (*Node) GetName

func (n *Node) GetName() string

GetName returns the node's name.

func (*Node) Index

func (n *Node) Index() string

Index tells the indexer where the node should go.

func (*Node) Save

func (n *Node) Save() error

Save the node.

func (*Node) URLType

func (n *Node) URLType() string

URLType returns the base element of a node's URL.

func (*Node) UpdateFromJSON added in v0.6.0

func (n *Node) UpdateFromJSON(jsonNode map[string]interface{}) util.Gerror

UpdateFromJSON updates an existing node with the uploaded JSON.

Jump to

Keyboard shortcuts

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