api

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool added in v0.0.3

func Bool(b bool) *bool

Bool returns a pointer to bool b.

func String added in v0.0.3

func String(s string) *string

String returns a pointer to string s.

Types

type ActionRef

type ActionRef struct {
	ActionID  string `json:"action_id"`
	AlertType Status `json:"alert_type"`
}

type CurrentStatusListOptions added in v0.0.3

type CurrentStatusListOptions struct {
	APMRequired       *bool   `url:"apm_required,omitempty"`
	GroupRequired     *bool   `url:"group_required,omitempty"`
	SuspendedRequired *bool   `url:"suspended_required,omitempty"`
	LocationsRequired *bool   `url:"locations_required,omitempty"`
	StatusRequired    *string `url:"status_required,omitempty"`
}

CurrentStatusListOptions hold the options that can be specified to filter current monitor statuses.

type ErrorResponse

type ErrorResponse struct {
	ErrorCode int                    `json:"error_code"`
	Message   string                 `json:"message"`
	ErrorInfo map[string]interface{} `json:"error_info"`
}
type Header struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ITAutomation

type ITAutomation struct {
	ActionID               string `json:"action_id,omitempty"`
	ActionName             string `json:"action_name"`
	ActionUrl              string `json:"action_url"`
	ActionTimeout          int    `json:"action_timeout"`
	ActionType             int    `json:"action_type"`
	ActionMethod           string `json:"action_method"`
	SuppressAlert          bool   `json:"suppress_alert,omitempty"`
	SendIncidentParameters bool   `json:"send_incident_parameters"`
	SendCustomParameters   bool   `json:"send_custom_parameters"`
	CustomParameters       string `json:"custom_parameters"`
	SendInJsonFormat       bool   `json:"send_in_json_format"`
	AuthMethod             string `json:"auth_method,omitempty"`
	Username               string `json:"username,omitempty"`
	Password               string `json:"password,omitempty"`
	OAuth2Provider         string `json:"oauth2_provider,omitempty"`
	UserAgent              string `json:"user_agent,omitempty"`
}

ITAutomation prioritize and remediate routine actions automatically, increase IT efficiency and streamline your processes to reduce performance degrade

type Location added in v0.0.2

type Location struct {
	LocationID  string `json:"location_id"`
	CountryName string `json:"country_name"`
	DisplayName string `json:"display_name"`
	UseIPV6     bool   `json:"use_ipv6"`
	CityName    string `json:"city_name"`
	CityShort   string `json:"city_short"`
	Continent   string `json:"continent"`
}

Location is a physical location Site24x7 performs monitor checks from. The LocationID field maps to the IDs used in the PrimaryLocation and SecondaryLocations fields of LocationProfile values.

type LocationProfile

type LocationProfile struct {
	ProfileID          string   `json:"profile_id,omitempty"`
	ProfileName        string   `json:"profile_name"`
	PrimaryLocation    string   `json:"primary_location"`
	SecondaryLocations []string `json:"secondary_locations,omitempty"`
	RestrictAltLoc     bool     `json:"restrict_alt_loc"`
}

LocationProfiles make it convenient to set monitoring locations consistently across many websites or monitors

type LocationTemplate added in v0.0.2

type LocationTemplate struct {
	Locations []*Location `json:"locations"`
}

LocationTemplate holds locations Site24x7 performs their monitor checks from.

type Monitor

type Monitor struct {
	MonitorID             string            `json:"monitor_id,omitempty"`
	DisplayName           string            `json:"display_name"`
	Type                  string            `json:"type"`
	Website               string            `json:"website"`
	CheckFrequency        string            `json:"check_frequency"`
	HTTPMethod            string            `json:"http_method"`
	AuthUser              string            `json:"auth_user"`
	AuthPass              string            `json:"auth_pass"`
	MatchingKeyword       *ValueAndSeverity `json:"matching_keyword,omitempty"`
	UnmatchingKeyword     *ValueAndSeverity `json:"unmatching_keyword,omitempty"`
	MatchRegex            *ValueAndSeverity `json:"match_regex,omitempty"`
	MatchCase             bool              `json:"match_case"`
	UserAgent             string            `json:"user_agent"`
	CustomHeaders         []Header          `json:"custom_headers,omitempty"`
	Timeout               int               `json:"timeout"`
	LocationProfileID     string            `json:"location_profile_id"`
	NotificationProfileID string            `json:"notification_profile_id"`
	ThresholdProfileID    string            `json:"threshold_profile_id"`
	MonitorGroups         []string          `json:"monitor_groups,omitempty"`
	UserGroupIDs          []string          `json:"user_group_ids,omitempty"`
	ActionIDs             []ActionRef       `json:"action_ids,omitempty"`
	UseNameServer         bool              `json:"use_name_server"`
	UpStatusCodes         string            `json:"up_status_codes"`
}

Monitor performance of websites and internet services

type MonitorGroup

type MonitorGroup struct {
	GroupID              string   `json:"group_id,omitempty"`
	DisplayName          string   `json:"display_name"`
	Description          string   `json:"description,omitempty"`
	Monitors             []string `json:"monitors,omitempty"`
	HealthThresholdCount int      `json:"health_threshold_count,omitempty"`
	DependencyReourceID  string   `json:"dependency_resource_id,omitempty"`
	SuppressAlert        bool     `json:"suppress_alert"`
}

MonitorGroup organizes Monitor resources into groups.

type MonitorStatus added in v0.0.3

type MonitorStatus struct {
	Name           string   `json:"name"`
	MonitorID      string   `json:"monitor_id"`
	MonitorType    string   `json:"monitor_type"`
	Status         Status   `json:"status"`
	LastPolledTime string   `json:"last_polled_time"`
	Unit           string   `json:"unit"`
	OutageID       string   `json:"outage_id"`
	DowntimeMillis string   `json:"downtime_millis"`
	DownReason     string   `json:"down_reason"`
	Duration       string   `json:"duration"`
	ServerType     string   `json:"server_type"`
	Tags           []string `json:"tags"`
}

MonitorStatus describes a monitor status response as defined here: https://www.site24x7.com/help/api/#retrieve-current-status.

type MonitorsStatus added in v0.0.3

type MonitorsStatus struct {
	Monitors []*MonitorStatus `json:"monitors"`
}

MonitorsStatus describes the response for the current status endpoint as defined here: https://www.site24x7.com/help/api/#retrieve-current-status.

type NotificationProfile

type NotificationProfile struct {
	ProfileID                   string   `json:"profile_id,omitempty"`
	ProfileName                 string   `json:"profile_name"`
	RcaNeeded                   bool     `json:"rca_needed"`
	NotifyAfterExecutingActions bool     `json:"notify_after_executing_actions"`
	DowntimeNotificationDelay   int      `json:"downtime_notification_delay,omitempty"`
	PersistentNotification      int      `json:"persistent_notification,omitempty"`
	EscalationUserGroupId       string   `json:"escalation_user_group_id,omitempty"`
	EscalationWaitTime          int      `json:"escalation_wait_time"`
	EscalationAutomations       []string `json:"escalation_automations,omitempty"`
	EscalationServices          []string `json:"escalation_services,omitempty"`
	TemplateID                  string   `json:"template_id,omitempty"`
}

NotificationProfile allows tweaking when alerts have to be sent out.

type Response

type Response struct {
	Code    int             `json:"code"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data"`
}

type Status

type Status int
const (
	Down               Status = 0
	Up                 Status = 1
	Trouble            Status = 2
	Critical           Status = 3
	Suspended          Status = 5
	Maintenance        Status = 7
	Discovery          Status = 9
	ConfigurationError Status = 10
)

func (*Status) UnmarshalJSON added in v0.0.4

func (status *Status) UnmarshalJSON(rawValue []byte) error

Custom unmarshaller that allows the value to be both a string and an integer, always unmarshals into integer

The Site24x7 API has a bug where it accepts integers, but returns them as strings.

type ThresholdProfile

type ThresholdProfile struct {
	ProfileID              string `json:"profile_id,omitempty"`
	Type                   string `json:"type"`
	ProfileName            string `json:"profile_name"`
	DownLocationThreshold  int    `json:"down_location_threshold"`
	WebsiteContentModified bool   `json:"website_content_modified"`
}

ThresholdProfile help the alarms engine to decide if a specific resource has to be declared critical or down

type UserGroup

type UserGroup struct {
	UserGroupID      string   `json:"user_group_id,omitempty"`
	DisplayName      string   `json:"display_name"`
	Users            []string `json:"users,omitempty"`
	AttributeGroupID string   `json:"attribute_group_id,omitempty"`
}

UserGroup help organize individuals so that they receive alerts and reports based on their responsibility.

type ValueAndSeverity

type ValueAndSeverity struct {
	Value    string `json:"value"`
	Severity Status `json:"severity"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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