Documentation
¶
Index ¶
- Variables
- func CheckImageExists(image string) error
- func CheckWrite(csw *sled.WriteResponse) *sled.ErrorPackage
- func GetCommand(mac string) (*sled.CommandSet, error)
- func RegisterMac(ru *sled.DaemonProto) error
- func StartFireServer()
- func UpdateTask(id, cmd, mac string, update *sled.Response) (*sled.NackResponse, error)
- func WithSledcInterface(dpi, dpp string, f func(sled.SledcProtocolClient) (interface{}, error)) (interface{}, error)
- type WriteMiscUpdate
Constants ¶
This section is empty.
Variables ¶
var ( // SledAPIHost name or ip of location of sledapi SledAPIHost = "localhost" // nolint:gochecknoglobals // SledAPIPort port of location of sledapi SledAPIPort = "9913" // nolint:gochecknoglobals )
var ( SleddRequestOps = promauto.NewCounter(prometheus.CounterOpts{ Name: fmt.Sprintf("sledd_%s_all_req", instanceID), Help: "The total number of sledd requested events", }) SleddCmdOps = promauto.NewCounter(prometheus.CounterOpts{ Name: fmt.Sprintf("sledd_%s_cmd_req", instanceID), Help: "The total number of sleed command request events", }) SleddWipeOps = promauto.NewCounter(prometheus.CounterOpts{ Name: fmt.Sprintf("sledd_%s_wipe_req", instanceID), Help: "The total number of sledd wipe request events", }) SleddWriteOps = promauto.NewCounter(prometheus.CounterOpts{ Name: fmt.Sprintf("sledd_%s_write_req", instanceID), Help: "The total number of sledd write request events", }) SleddKexecOps = promauto.NewCounter(prometheus.CounterOpts{ Name: fmt.Sprintf("sledd_%s_kexec_req", instanceID), Help: "The total number of sledd kexec request events", }) SleddNetWriteDuration = prometheus.NewSummaryVec( prometheus.SummaryOpts{ Name: "sledd_network_write_durations", Help: "Latency of network writes for sledd requests", Objectives: map[float64]float64{}, }, []string{"service"}, ) SleddNetGRPC = prometheus.NewSummaryVec( prometheus.SummaryOpts{ Name: "sledd_sledapi_grpc_latency", Help: "Latency of network writes for sledd requests", Objectives: map[float64]float64{}, }, []string{"service"}, ) )
var ( //SledMount is the image directory location SledMount string = "/var/img" // nolint:gochecknoglobals // ConnTimeout is the default connection timeout for grpc ConnTimeout time.Duration = 10 * time.Second // nolint:gochecknoglobals // SledTimeout is the default connection timeout for sledc communications // it is much longer in the case of downloading images SledTimeout time.Duration = 5 * time.Minute // nolint:gochecknoglobals )
Functions ¶
func CheckImageExists ¶
CheckImageExists simple function to check if image exists in predefined location.
func CheckWrite ¶ added in v0.6.0
func CheckWrite(csw *sled.WriteResponse) *sled.ErrorPackage
CheckWrite checks that each image (kernel, initramfs, device) exists on the storage server.
func GetCommand ¶ added in v0.6.0
func GetCommand(mac string) (*sled.CommandSet, error)
GetCommand requests from sledapi the command set for a sled client. It is the primary function used by sledd/sledc.
func RegisterMac ¶ added in v0.6.0
func RegisterMac(ru *sled.DaemonProto) error
RegisterMac communicates with the sledapi the sledc's mac address for daemon mode.
func StartFireServer ¶ added in v0.8.0
func StartFireServer()
StartFireServer begins the prometheus server endpoint.
func UpdateTask ¶ added in v0.6.0
UpdateTask changes the status of a task for every commandset, each task is updated on receipt of a sledc update.
func WithSledcInterface ¶ added in v0.6.0
func WithSledcInterface(dpi, dpp string, f func(sled.SledcProtocolClient) (interface{}, error)) (interface{}, error)
WithSledcInterface wrapper for sledapi connections that returns wrapper and allows additional computation to take place outside the grpc connection.