Documentation ¶
Index ¶
- Constants
- Variables
- func BulkForward(caller, url, user, pass string, toSend []ElkBulkUpdateItem)
- func GetRoomsBulk(rooms []string) ([]statedefinition.StaticRoom, *nerr.E)
- func MakeELKRequest(method, endpoint string, body interface{}) ([]byte, *nerr.E)
- func MakeGenericELKRequest(addr, method string, body interface{}, user, pass string) ([]byte, *nerr.E)
- type Alert
- type AllQuery
- type BulkUpdateResponse
- type DeviceUpdateInfo
- type ElkBulkUpdateItem
- type ElkDeleteHeader
- type ElkUpdateHeader
- type GenericQuery
- type HeaderIndex
- type IDQuery
- type MatchQuery
- type RoomIssueQueryResponse
- type StaticDeviceQueryResponse
- type StaticRoomQueryResponse
- type UpdateBody
- type UpdateHeader
Constants ¶
View Source
const ( ALERTING_TRUE = 1 ALERTING_FALSE = 0 POWER_STANDBY = "standby" POWER_ON = "on" )
Variables ¶
View Source
var (
APIAddr = os.Getenv("ELK_DIRECT_ADDRESS") // or should this be ELK_ADDR?
)
Functions ¶
func BulkForward ¶
func BulkForward(caller, url, user, pass string, toSend []ElkBulkUpdateItem)
BulkForward preps a bulk request and forwards it. Leave user and pass blank to use the env variables defined above.
func GetRoomsBulk ¶
func GetRoomsBulk(rooms []string) ([]statedefinition.StaticRoom, *nerr.E)
func MakeELKRequest ¶
MakeELKRequest .
Types ¶
type BulkUpdateResponse ¶
type BulkUpdateResponse struct {
Errors bool `json:"errors"`
}
there are other types, but we don't worry about them, since we don't really do any smart parsing at this time.
type DeviceUpdateInfo ¶
type ElkBulkUpdateItem ¶
type ElkBulkUpdateItem struct { Index ElkUpdateHeader Delete ElkDeleteHeader Doc interface{} }
type ElkDeleteHeader ¶
type ElkDeleteHeader struct {
Header HeaderIndex `json:"delete"`
}
type ElkUpdateHeader ¶
type ElkUpdateHeader struct {
Header HeaderIndex `json:"index"`
}
type GenericQuery ¶
type HeaderIndex ¶
type MatchQuery ¶
type RoomIssueQueryResponse ¶
type StaticDeviceQueryResponse ¶
type StaticDeviceQueryResponse struct { Hits struct { Wrappers []struct { ID string `json:"_id"` Device statedefinition.StaticDevice `json:"_source"` } `json:"hits"` } `json:"hits"` }
type StaticRoomQueryResponse ¶
type StaticRoomQueryResponse struct { Hits struct { Wrappers []struct { ID string `json:"_id"` Room statedefinition.StaticRoom `json:"_source"` } `json:"hits"` } `json:"hits"` }
type UpdateBody ¶
type UpdateHeader ¶
Click to show internal directories.
Click to hide internal directories.