Documentation
¶
Index ¶
- Constants
- func AddBulkDevices(devices []structs.Device) []structs.BulkUpdateResponse
- func GetAllAttributeGroups() ([]structs.Group, *nerr.E)
- func GetAllBuildings() ([]structs.Building, *nerr.E)
- func GetAllDevices() ([]structs.Device, *nerr.E)
- func GetAllRooms() ([]structs.Room, *nerr.E)
- func GetAllStaticDeviceRecords() ([]sd.StaticDevice, *nerr.E)
- func GetAllStaticRoomRecords() ([]sd.StaticRoom, *nerr.E)
- func GetAllUIConfigs() ([]structs.UIConfig, *nerr.E)
- func GetAttributeGroup(groupID string) (structs.Group, *nerr.E)
- func GetBuilding(buildingID string) (structs.Building, *nerr.E)
- func GetDMPSBuildings() ([]structs.Building, *nerr.E)
- func GetDMPSRooms() ([]structs.Room, *nerr.E)
- func GetDevice(deviceID string) (structs.Device, *nerr.E)
- func GetDeviceRawIPAddress(hostname string) (string, *nerr.E)
- func GetDeviceRoles() ([]structs.Role, *nerr.E)
- func GetDeviceTypes() ([]structs.DeviceType, *nerr.E)
- func GetDevicesByRoom(roomID string) ([]structs.Device, *nerr.E)
- func GetDevicesByRoomAndRole(roomID, roleID string) ([]structs.Device, *nerr.E)
- func GetDevicesByTypeAndRole(typeID, roleID string) ([]structs.Device, *nerr.E)
- func GetIcons() ([]string, *nerr.E)
- func GetMenuTree() (structs.MenuTree, *nerr.E)
- func GetRoomConfigurations() ([]structs.RoomConfiguration, *nerr.E)
- func GetRoomDesignations() ([]string, *nerr.E)
- func GetRoomsByBuilding(buildingID string) ([]structs.Room, *nerr.E)
- func GetStaticDeviceRecord(id string) (sd.StaticDevice, *nerr.E)
- func GetTemplates() ([]structs.Template, *nerr.E)
- func GetUIConfig(configID string) (structs.UIConfig, *nerr.E)
- func NukeRoom(id string) *nerr.E
- func UpdateStaticRoom(roomID string, room sd.StaticRoom) *nerr.E
- type BuildingStatus
- type ChangeRecord
- type DBResponse
- func AddBuilding(buildingID string, building structs.Building) (DBResponse, *nerr.E)
- func AddDevice(deviceID string, device structs.Device) (DBResponse, *nerr.E)
- func AddRoom(roomID string, room structs.Room) (DBResponse, *nerr.E)
- func AddUIConfig(configID string, config structs.UIConfig) (DBResponse, *nerr.E)
- func DeleteBuilding(buildingID string) (DBResponse, *nerr.E)
- func DeleteDevice(deviceID string) (DBResponse, *nerr.E)
- func DeleteRoom(roomID string) (DBResponse, *nerr.E)
- func DeleteUIConfig(configID string) (DBResponse, *nerr.E)
- func DoUIConfigDatabaseAction(config structs.UIConfig, configID, username, action string) (DBResponse, *nerr.E)
- func RecordBulkDeviceChanges(responses []structs.BulkUpdateResponse, username string) []DBResponse
- func UpdateBuilding(buildingID string, building structs.Building) (DBResponse, *nerr.E)
- func UpdateDevice(deviceID string, device structs.Device) (DBResponse, *nerr.E)
- func UpdateRoom(roomID string, room structs.Room) (DBResponse, *nerr.E)
- func UpdateUIConfig(configID string, config structs.UIConfig) (DBResponse, *nerr.E)
- type MetricsResponse
- type RoomCombinedState
- type RoomStatus
- type RoomWithGraph
Constants ¶
const ( AddAction = "add" UpdateAction = "update" DeleteAction = "delete" )
A list of actions to be used in reporting
const ( BuildingsTag = "[buildings]" RoomsTag = "[rooms]" DevicesTag = "[devices]" UIConfigsTag = "[uiconfigs]" OptionsTag = "[options]" AlertsTag = "[alerts]" MetricsTag = "[metrics]" StaticTag = "[static]" )
A list of tags for logging
Variables ¶
This section is empty.
Functions ¶
func AddBulkDevices ¶
func AddBulkDevices(devices []structs.Device) []structs.BulkUpdateResponse
AddBulkDevices adds multiples devices to the database
func GetAllAttributeGroups ¶
GetAllAttributeGroups gets a list of all the attribute sets from the database
func GetAllBuildings ¶
GetAllBuildings gets all buildings from the database
func GetAllDevices ¶
GetAllDevices gets all devices from the database
func GetAllRooms ¶
GetAllRooms gets a list of all rooms in the database
func GetAllStaticDeviceRecords ¶
func GetAllStaticDeviceRecords() ([]sd.StaticDevice, *nerr.E)
GetAllStaticDeviceRecords returns a list of all the static device records
func GetAllStaticRoomRecords ¶
func GetAllStaticRoomRecords() ([]sd.StaticRoom, *nerr.E)
GetAllStaticRoomRecords returns a list of all the static room records
func GetAllUIConfigs ¶
GetAllUIConfigs gets all uiconfigs from the database
func GetAttributeGroup ¶
GetAttributeGroup gets one attribute set from the database
func GetBuilding ¶
GetBuilding gets a building from the database
func GetDMPSBuildings ¶
GetDMPSBuildings gets the list of buildings that have DMPS systems
func GetDMPSRooms ¶
GetDMPSRooms gets the list of rooms that have DMPS systems
func GetDeviceRawIPAddress ¶
GetDeviceRawIPAddress takes a device's hostname and return the IP address associated to it
func GetDeviceRoles ¶
GetDeviceRoles gets a list of possible device roles
func GetDeviceTypes ¶
func GetDeviceTypes() ([]structs.DeviceType, *nerr.E)
GetDeviceTypes gets a list of possible device types
func GetDevicesByRoom ¶
GetDevicesByRoom gets all the devices in a room
func GetDevicesByRoomAndRole ¶
GetDevicesByRoomAndRole gets all the devices in a room with the given role
func GetDevicesByTypeAndRole ¶
GetDevicesByTypeAndRole gets all the devices of the given type that have the given role
func GetMenuTree ¶
GetMenuTree returns the fully built out menu tree
func GetRoomConfigurations ¶
func GetRoomConfigurations() ([]structs.RoomConfiguration, *nerr.E)
GetRoomConfigurations gets a list of possible room configurations
func GetRoomDesignations ¶
GetRoomDesignations gets a list of possible room designations
func GetRoomsByBuilding ¶
GetRoomsByBuilding gets a list of all rooms in a building
func GetStaticDeviceRecord ¶
func GetStaticDeviceRecord(id string) (sd.StaticDevice, *nerr.E)
func GetTemplates ¶
GetTemplates gets a list of templates from the database
func GetUIConfig ¶
GetUIConfig gets a uiconfig from the database
func UpdateStaticRoom ¶
func UpdateStaticRoom(roomID string, room sd.StaticRoom) *nerr.E
Update the static rooms (putting them in and out of maintenance mode etc.)
Types ¶
type BuildingStatus ¶
type BuildingStatus struct { BuildingID string `json:"building-id"` RoomCount int `json:"room-count"` AlertingRoomCount int `json:"alerting-room-count"` GoodRoomCount int `json:"good-room-count"` RoomStates map[string]RoomStatus `json:"room-states,omitempty"` }
BuildingStatus contains information about the status of a building
type ChangeRecord ¶
type ChangeRecord struct { AttributeName string `json:"attribute_name"` OldValue string `json:"old_value"` NewValue string `json:"new_value"` }
ChangeRecord contains the information about what was changed about the object when it was updated
type DBResponse ¶
type DBResponse struct { ObjectID string `json:"object_id"` Action string `json:"action"` Success bool `json:"success"` Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` }
DBResponse contains the information to be reported back upon changes being made to the database
func AddBuilding ¶
AddBuilding adds a building to the database
func AddUIConfig ¶
AddUIConfig adds a uiconfig to the database
func DeleteBuilding ¶
func DeleteBuilding(buildingID string) (DBResponse, *nerr.E)
DeleteBuilding deletes a building from the database
func DeleteDevice ¶
func DeleteDevice(deviceID string) (DBResponse, *nerr.E)
DeleteDevice deletes a device from the database
func DeleteRoom ¶
func DeleteRoom(roomID string) (DBResponse, *nerr.E)
DeleteRoom deletes a room in the database
func DeleteUIConfig ¶
func DeleteUIConfig(configID string) (DBResponse, *nerr.E)
DeleteUIConfig deletes a uiconfig from the database
func DoUIConfigDatabaseAction ¶
func DoUIConfigDatabaseAction(config structs.UIConfig, configID, username, action string) (DBResponse, *nerr.E)
DoUIConfigDatabaseAction performs various actions on the database
func RecordBulkDeviceChanges ¶
func RecordBulkDeviceChanges(responses []structs.BulkUpdateResponse, username string) []DBResponse
RecordBulkDeviceChanges takes the responses from calling the CreateBulkDevices database function and makes change records for all of that information
func UpdateBuilding ¶
UpdateBuilding updates a building in the database
func UpdateDevice ¶
UpdateDevice updates a device in the database
func UpdateRoom ¶
UpdateRoom updates a room in the database
func UpdateUIConfig ¶
UpdateUIConfig updates a uiconfig in the database
type MetricsResponse ¶
type MetricsResponse struct { ObjectID string `json:"object_id"` Action string `json:"action"` Username string `json:"username"` Timestamp string `json:"timestamp"` Changes []ChangeRecord `json:"changes,omitempty"` }
MetricsResponse contains the information to be reported back when asked for metrics data
type RoomCombinedState ¶
type RoomCombinedState struct { RoomID string `json:"roomID"` StaticRoom sd.StaticRoom `json:"static-room"` RoomIssues []structs.RoomIssue `json:"room-issues"` AllAlerts []structs.Alert `json:"all-alerts"` ActiveAlertCount int `json:"active-alert-count"` TotalAlertCount int `json:"total-alert-count"` StaticDevices []sd.StaticDevice `json:"static-devices"` }
RoomCombinedState -
func GetAllRoomCombinedStateRecords ¶
func GetAllRoomCombinedStateRecords() ([]RoomCombinedState, *nerr.E)
GetAllRoomCombinedStateRecords returns a list of combined room state records
func GetRoomCombinedStateRecord ¶
func GetRoomCombinedStateRecord(roomID string) (RoomCombinedState, *nerr.E)
GetRoomCombinedStateRecord returns a a single toom state record
type RoomStatus ¶
type RoomStatus struct { RoomID string `json:"room-id"` DeviceCount int `json:"device-count"` AlertingDeviceCount int `json:"alerting-device-count"` GoodDeviceCount int `json:"good-device-count"` Alerts map[string]statedefinition.Alert `json:"alerts"` DeviceStates []statedefinition.StaticDevice `json:"device-states,omitempty"` }
RoomStatus contains information about the status of a room