Documentation ¶
Index ¶
- func GetSource() string
- func IsAuthenticationError(err error) bool
- func IsDisabled(err error) bool
- func IsDuplicate(err error) (bool, int64)
- func IsNotFoundError(err error) bool
- func IsRequestError(err error) bool
- type Alert
- type Api
- func (api *Api) AddObjectToGroup(objectName string, object Object, group Object) error
- func (api *Api) AlertSolution(alert *Alert, solutionType string) (string, error)
- func (api *Api) CreateEvent(name, description, attributeDescriptions, source, typeString string) (string, error)
- func (api *Api) CreateMetric(name, description, datatype, unit, subject, source string, period int) (string, error)
- func (api *Api) CreateMetricGroup(name, description, Type, state, subject, source string) (string, error)
- func (api *Api) CreateServer(name string, description string, serverType, source string) (string, error)
- func (api *Api) CreateServerGroup(name, description, Type, state, source string) (string, error)
- func (api *Api) DeleteEvent(event *Event) error
- func (api *Api) DeleteObject(objectName string, object *Object) error
- func (api *Api) DeleteObjectFromGroup(objectName string, object Object, group Object) error
- func (api *Api) GetAlertsBy(query string) (string, error)
- func (api *Api) GetData(start, stop int, metricId int64, subjectIds, aggregator string, ...) (string, error)
- func (api *Api) GetEventData(id int64) (string, error)
- func (api *Api) GetMetricsByGroup(metricGroup *MetricGroup) (string, error)
- func (api *Api) GetObejctRefByName(objectName string, name string, result Object) error
- func (api *Api) GetObject(objectName string, id int64) (string, error)
- func (api *Api) GetObjectByName(objectName string, name string) (string, error)
- func (api *Api) GetObjectRef(objectName string, id int64, result Object) error
- func (api *Api) GetObjects(objectName string) (string, error)
- func (api *Api) InsertData(data *ApiData) (string, error)
- func (api *Api) InsertEventData(id int64, message, subject, attribute string, timestamp, stopTime int64) (string, error)
- func (api *Api) Login() error
- func (api *Api) UpdateEvent(event *Event) (string, error)
- func (api *Api) UpdateMetric(metric *Metric) (string, error)
- func (api *Api) UpdateMetricGroup(metricGroup *MetricGroup) (string, error)
- func (api *Api) UpdateServer(server *Server) (string, error)
- func (api *Api) UpdateServerGroup(serverGroup *ServerGroup) (string, error)
- type ApiConfiguration
- type ApiData
- type AuthenticationError
- type DataPoint
- type Disabled
- type Duplicate
- type Event
- type LoginData
- type Metric
- type MetricGroup
- type NotFoundError
- type Object
- type RequestError
- type RequestErrorResponse
- type Server
- type ServerAttribute
- type ServerGroup
- type UnauthorizedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAuthenticationError ¶
Checks if an error is a AuthenticationError.
func IsDisabled ¶
Check if an error indicates that the feature was disabled.
func IsDuplicate ¶
Check if the error is a duplicate error, if true, this also returns the duplicate id.
Types ¶
type Alert ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) AddObjectToGroup ¶
AddObjectToGroup adds a object (metric, event, etc) to a group of objects.
func (*Api) AlertSolution ¶
AlertSolution will be used to acknowledge/ resolve a alert
func (*Api) CreateEvent ¶
func (*Api) CreateMetric ¶
func (*Api) CreateMetricGroup ¶
func (api *Api) CreateMetricGroup(name, description, Type, state, subject, source string) (string, error)
CreateMetricGroup creates a new metric group.
func (*Api) CreateServer ¶
func (api *Api) CreateServer(name string, description string, serverType, source string) (string, error)
CreateServer creates a new server.
func (*Api) CreateServerGroup ¶
CreateServerGroup creates a new server group.
func (*Api) DeleteEvent ¶
func (*Api) DeleteObject ¶
DeleteObject will delete a object
func (*Api) DeleteObjectFromGroup ¶
AddObjectToGroup remove a object (metric, event, etc) from a group of objects.
func (*Api) GetAlertsBy ¶
GetAlertsBy will use a custom query to get a alert by unresolved/unacknowledged
func (*Api) GetMetricsByGroup ¶
func (api *Api) GetMetricsByGroup(metricGroup *MetricGroup) (string, error)
GetMetricsByGroup will return all the metrics from a metricgroup
func (*Api) GetObejctRefByName ¶
GetObejctRefByName will put in result a reference to the oject specified by objectName and name
func (*Api) GetObject ¶
GetObject will return the object (json) specified by objectName that have a certain id
func (*Api) GetObjectByName ¶
GetObjectByName will return the object (json) specified by objectName and name
func (*Api) GetObjectRef ¶
GetObjectRef will put in result a reference to a object specified by objectName and that have a certain id
func (*Api) GetObjects ¶
GetObjects will get all the objects (json) specified by objectName. eg: all the metrics or all the servers
func (*Api) InsertData ¶
InsertData inserts a batch of data. Returns the number of pending actions.
func (*Api) InsertEventData ¶
func (*Api) UpdateMetricGroup ¶
func (api *Api) UpdateMetricGroup(metricGroup *MetricGroup) (string, error)
UpdateMetricGroup updates the name of the metricgroup.
func (*Api) UpdateServerGroup ¶
func (api *Api) UpdateServerGroup(serverGroup *ServerGroup) (string, error)
UpdateServerGroup updates the name of the servergroup.
type ApiConfiguration ¶
type ApiConfiguration struct { BaseUrl string AccessToken string AppId string TemplateId int64 Certificate string }
ApiConfiguration contains all information to connect with the api.
func ReadApiConfiguration ¶
func ReadApiConfiguration(filename string) (*ApiConfiguration, error)
ReadApiConfiguration reads the api configuration from a file.
type ApiData ¶
func ParseDataPoint ¶
dataPoint is provided by user on the command line the format is this:
M2:S100:60:1000,10,0,10,20,30,40,50,60,70,80,90,95,99,100 <SAMPLES>,<PERCENTILE WIDTH>,<PERCENTILE DATA>
type AuthenticationError ¶
type AuthenticationError string
func (AuthenticationError) Error ¶
func (ue AuthenticationError) Error() string
type Event ¶
type Metric ¶
type MetricGroup ¶
type MetricGroup struct { ID int64 Name string Description string Type string MetricGroups []*MetricGroup Source string State string Subject string Version int64 }
func (MetricGroup) GetId ¶
func (e MetricGroup) GetId() int64
type NotFoundError ¶
type NotFoundError string
func (NotFoundError) Error ¶
func (nfe NotFoundError) Error() string
type RequestError ¶
type RequestError string
func (RequestError) Error ¶
func (re RequestError) Error() string
type RequestErrorResponse ¶
RequestErrorResponse is response in case of a RequestError.
type Server ¶
type ServerAttribute ¶
type ServerGroup ¶
type ServerGroup struct { ID int64 Name string Description string Type string Source string State string Version int64 }
func (ServerGroup) GetId ¶
func (e ServerGroup) GetId() int64
type UnauthorizedError ¶
type UnauthorizedError string
func (UnauthorizedError) Error ¶
func (ue UnauthorizedError) Error() string