inventory

package
v0.0.0-...-84310d3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMatch

func IsMatch(s *pb.Selector, h *pb.HostInfo) bool

func NewServer

func NewServer() pb.InventoryServer

NewServer returns a new inventory grpc server

Types

type InvServer

type InvServer struct {
	sync.RWMutex

	AllHosts *hostSet
	Sets     map[string]*hostSet
	Session  server.Session
	Cfg      server.InventoryConfiguration
}

InvServer serves the inventory through named hostsets

func NewInvServer

func NewInvServer(hosts []*server.Host, cfg server.InventoryConfiguration, session server.Session) *InvServer

NewInvServer creates a new inventory server instance

func (*InvServer) Add

func (srv *InvServer) Add(to string, ids []string) (string, error)

Add adds new hosts to an inventory

func (*InvServer) GetHost

func (srv *InvServer) GetHost(req []string) ([]*server.Host, error)

GetHost returns information about some hosts

func (*InvServer) GetHostIDs

func (srv *InvServer) GetHostIDs(id string) ([]string, error)

GetHostIDs returns the host ids for all the hosts in an inventory

func (*InvServer) GetHostInfo

func (srv *InvServer) GetHostInfo(req []string) ([]*pb.HostInfo, error)

GetHostInfo returns information about some hosts

func (*InvServer) Make

func (srv *InvServer) Make(req []string) (string, error)

Make creates a new inventory containing the given hosts

func (*InvServer) Release

func (srv *InvServer) Release(id string)

Release notifies the server that the inventory id is no longer in use

func (*InvServer) Select

func (srv *InvServer) Select(from string, selectors ...*pb.Selector) (string, error)

Select selects a subset of an inventory based on the given criteria, and returns a new inventory id representing the subset

func (*InvServer) Union

func (srv *InvServer) Union(req []string) (string, error)

Union takes a union of a set of inventories and returns a new inventory containing all the hosts in the combined inventories

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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