nqm

package
v0.0.0-...-5416f79 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2017 License: Apache-2.0, Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbFacade *f.DbFacade

Functions

func AddAgent

func AddAgent(addedAgent *nqmModel.AgentForAdding) (*nqmModel.Agent, error)

Add and retrieve detail data of agent

Errors:

ErrDuplicatedNqmAgent - The agent is existing with the same connection id
ErrNotInSameHierarchy - The city is not belonging to the province

func AddAndGetPingtask

func AddAndGetPingtask(pm *nqmModel.PingtaskModify) *nqmModel.PingtaskView

func AddTarget

func AddTarget(newTarget *nqmModel.TargetForAdding) (*nqmModel.Target, error)

Add and retrieve detail data of target

Errors:

ErrDuplicatedNqmTarget - The target is existing with the same host
ErrNotInSameHierarchy - The city is not belonging to the province

func AssignPingtaskToAgentForAgent

func AssignPingtaskToAgentForAgent(aID int32, pID int32) (*nqmModel.Agent, error)

func AssignPingtaskToAgentForPingtask

func AssignPingtaskToAgentForPingtask(aID int32, pID int32) (*nqmModel.PingtaskView, error)

func BuildCacheOfPingList

func BuildCacheOfPingList(agentId int32, checkedTime time.Time) *nqmModel.PingListLog

1. Update(or INSERT) the refresh time 2. Re-build the list of targets

func DeleteCachedTargetsOfAgentById

func DeleteCachedTargetsOfAgentById(idArg int32) *nqmModel.ClearCacheView

Clear the cached targets of an agent by the agent's ID

func GetAgentById

func GetAgentById(agentId int32) *nqmModel.Agent

func GetPingListFromCache

func GetPingListFromCache(agent *nqmModel.NqmAgent, checkedTime time.Time) ([]commonModel.NqmTarget, *nqmModel.PingListLog)

Gets the ping list from cache

func GetPingtaskById

func GetPingtaskById(id int32) *nqmModel.PingtaskView

func GetSimpleAgent1ById

func GetSimpleAgent1ById(agentId int32) *nqmModel.SimpleAgent1

func GetSimpleTarget1ById

func GetSimpleTarget1ById(targetId int32) *nqmModel.SimpleTarget1

Gets the target object or nil if the id is not existing

func GetTargetById

func GetTargetById(targetId int32) *nqmModel.Target

func ListAgents

func ListAgents(query *nqmModel.AgentQuery, paging commonModel.Paging) ([]*nqmModel.Agent, *commonModel.Paging)

Lists the agents by query condition

func ListAgentsWithPingTask

func ListAgentsWithPingTask(query *nqmModel.AgentQueryWithPingTask, paging commonModel.Paging) ([]*nqmModel.AgentWithPingTask, *commonModel.Paging)

Lists the agents by query condition

func ListPingtasks

func ListPingtasks(query *nqmModel.PingtaskQuery, paging commonModel.Paging) ([]*nqmModel.PingtaskView, *commonModel.Paging)

Lists the pingtasks according to the query parameters

func ListTargets

func ListTargets(query *nqmModel.TargetQuery, paging commonModel.Paging) ([]*nqmModel.Target, *commonModel.Paging)

func ListTargetsOfAgentById

func ListTargetsOfAgentById(query *nqmModel.TargetsOfAgentQuery, paging commonModel.Paging) (*nqmModel.TargetsOfAgent, *commonModel.Paging)

Lists the targets of an agent by the agent's ID

func LoadEffectiveAgentsInProvince

func LoadEffectiveAgentsInProvince(provinceId int16) []*nqmModel.SimpleAgent1InCity

func LoadSimpleAgent1sByFilter

func LoadSimpleAgent1sByFilter(filter *nqmModel.AgentFilter) []*nqmModel.SimpleAgent1

func LoadSimpleTarget1sByFilter

func LoadSimpleTarget1sByFilter(filter *nqmModel.TargetFilter) []*nqmModel.SimpleTarget1

Gets the targets by filter

func RefreshAgentInfo

func RefreshAgentInfo(agent *nqmModel.NqmAgent, checkedTime time.Time) *commonModel.NqmAgent

Inserts a new agent or updates existing one

returns true if the agent is enabled

func RemovePingtaskFromAgentForAgent

func RemovePingtaskFromAgentForAgent(aID int32, pID int32) (*nqmModel.Agent, error)

func RemovePingtaskFromAgentForPingtask

func RemovePingtaskFromAgentForPingtask(aID int32, pID int32) (*nqmModel.PingtaskView, error)

func UpdateAgent

func UpdateAgent(oldAgent *nqmModel.Agent, updatedAgent *nqmModel.AgentForAdding) (*nqmModel.Agent, error)

func UpdateAndGetPingtask

func UpdateAndGetPingtask(id int32, pm *nqmModel.PingtaskModify) *nqmModel.PingtaskView

func UpdateTarget

func UpdateTarget(oldTarget *nqmModel.Target, updatedTarget *nqmModel.TargetForAdding) (*nqmModel.Target, error)

Update and retrieve detail data of target

Types

type ErrDuplicatedNqmAgent

type ErrDuplicatedNqmAgent struct {
	ConnectionId string
}

func (ErrDuplicatedNqmAgent) Error

func (err ErrDuplicatedNqmAgent) Error() string

type ErrDuplicatedNqmTarget

type ErrDuplicatedNqmTarget struct {
	Host string
}

func (ErrDuplicatedNqmTarget) Error

func (err ErrDuplicatedNqmTarget) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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