api

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AutoTagRuleTypeCustomDevice AutoTagRuleType = "CUSTOM_DEVICE"
	AutoTagRuleTypeHost                         = "HOST"
	AutoTagRuleTypeProcessGroup                 = "PROCESS_GROUP"
	AutoTagRuleTypeService                      = "SERVICE"
)
View Source
const (
	EventTypeAvailabilityEvent    = "AVAILABILITY_EVENT"
	EventTypeCustomAlert          = "CUSTOM_ALERT"
	EventTypeCustomAnnotation     = "CUSTOM_ANNOTATION"
	EventTypeCustomConfiguration  = "CUSTOM_CONFIGURATION"
	EventTypeCustomDeployment     = "CUSTOM_DEPLOYMENT"
	EventTypeCustomInfo           = "CUSTOM_INFO"
	EventTypeErrorEvent           = "ERROR_EVENT"
	EventTypeMarkedForTermination = "MARKED_FOR_TERMINATION"
	EventTypePerformanceEvent     = "PERFORMANCE_EVENT"
	EventTypeResourceContention   = "RESOURCE_CONTENTION"
)

Variables

This section is empty.

Functions

func StatusError

func StatusError(status int) error

Types

type AffectedCounts added in v1.0.1

type AffectedCounts struct {
	INFRASTRUCTURE int `json:"INFRASTRUCTURE"`
	SERVICE        int `json:"SERVICE"`
	APPLICATION    int `json:"APPLICATION"`
	ENVIRONMENT    int `json:"ENVIRONMENT"`
}

type AffectedEntities added in v1.0.1

type AffectedEntities struct {
	EntityID EntityID `json:"entityId"`
	Name     string   `json:"name"`
}

type AutoTag

type AutoTag struct {
	ID          string        `json:"id"`
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Rules       []AutoTagRule `json:"rules"`
}

AutoTags

type AutoTagResponse

type AutoTagResponse struct {
	Values []AutoTag `json:"values"`
}

type AutoTagRule

type AutoTagRule struct {
	Type             AutoTagRuleType              `json:"type"`
	Enabled          bool                         `json:"enabled"`
	ValueFormat      string                       `json:"valueFormat"`
	PropagationTypes []AutoTagRulePropagationType `json:"propagationTypes"`
	Conditions       []AutoTagRuleCondition       `json:"conditions"`
}

type AutoTagRuleCondition

type AutoTagRuleCondition struct {
	Key            AutoTagRuleConditionKey            `json:"key"`
	ComparisonInfo AutoTagRuleConditionComparisonInfo `json:"comparisonInfo"`
}

type AutoTagRuleConditionComparisonInfo

type AutoTagRuleConditionComparisonInfo struct {
	Type          string `json:"type"`
	Operator      string `json:"operator"`
	Value         string `json:"value"`
	Negate        bool   `json:"negate"`
	CaseSensitive bool   `json:"caseSensitive"`
}

type AutoTagRuleConditionKey

type AutoTagRuleConditionKey struct {
	Attribute string `json:"attribute"`
}

type AutoTagRulePropagationType

type AutoTagRulePropagationType string
const (
	ServiceToProcessGroupLike  AutoTagRulePropagationType = "SERVICE_TO_PROCESS_GROUP_LIKE"
	ServiceToHostLike          AutoTagRulePropagationType = "SERVICE_TO_HOST_LIKE"
	ProcessGroupToHost         AutoTagRulePropagationType = "PROCESS_GROUP_TO_HOST"
	ProcessGroupToService      AutoTagRulePropagationType = "PROCESS_GROUP_TO_SERVICE"
	HostToProcessGroupInstance AutoTagRulePropagationType = "HOST_TO_PROCESS_GROUP_INSTANCE"
)

type AutoTagRuleType

type AutoTagRuleType string

type Client

type Client struct {
	AutoTags     *autoTagsService
	Dashboards   *dashboardService
	Events       *eventsService
	CustomDevice *customDeviceService
	Problem      *problemService

	RestyClient *resty.Client

	Log *log.Logger
	// contains filtered or unexported fields
}

func New

func New(config Config) Client

New returns a new Client for the specified apiKey.

func (*Client) AllApplicationNameDetectionRules

func (c *Client) AllApplicationNameDetectionRules() ([]NameDetectionRule, error)

Get all application naming rules in order

func (*Client) CreateApplicationNameDetectionRule

func (c *Client) CreateApplicationNameDetectionRule(body NameDetectionRuleDetail) (NameDetectionRule, error)

Create an application name detection rule. If the API responds with a non-2xx status code, an error is returned.

func (*Client) DeleteApplicationNameDetectionRule

func (c *Client) DeleteApplicationNameDetectionRule(id string) error

Delete an application name detection rule.

func (*Client) Do

func (c *Client) Do(method string, path string, body interface{}, response interface{}) (*resty.Response, error)

func (*Client) GetApplicationNameDetectionRule

func (c *Client) GetApplicationNameDetectionRule(id string) (NameDetectionRuleDetail, error)

Get an application name detection rule. If the rule does not exist, an empty NameDetectionRuleDetail will be returned with an Id of ""

func (*Client) UpdateApplicationNameDetectionRule

func (c *Client) UpdateApplicationNameDetectionRule(id string, body NameDetectionRuleDetail) error

Update an application name detection rule. If the API responds with a non-2xx status code, an error is returned.

func (*Client) UpdateApplicationNameDetectionRuleOrder

func (c *Client) UpdateApplicationNameDetectionRuleOrder(ids []string) error

type Config

type Config struct {
	APIKey    string
	BaseURL   string
	Debug     bool
	Retries   int
	RetryTime time.Duration
	Log       *log.Logger
}

type ConfigurationMetadata

type ConfigurationMetadata struct {
	ConfigurationVersions []int  `json:"configurationVersions,omitempty"`
	ClusterVersion        string `json:"clusterVersion,omitempty"`
}

type ConstraintViolation

type ConstraintViolation struct {
	Path              string                               `json:"path,omitempty"`
	Message           string                               `json:"message,omitempty"`
	ParameterLocation ConstraintViolationParameterLocation `json:"parameterLocation,omitempty"`
	Location          string                               `json:"location,omitempty"`
}

type ConstraintViolationParameterLocation

type ConstraintViolationParameterLocation string
const (
	ConstraintViolationParameterLocationPath        ConstraintViolationParameterLocation = "PATH"
	ConstraintViolationParameterLocationPayloadBody ConstraintViolationParameterLocation = "PAYLOAD_BODY"
	ConstraintViolationParameterLocationQuery       ConstraintViolationParameterLocation = "QUERY"
)

type CustomDevicePushMessage added in v1.0.1

type CustomDevicePushMessage struct {
	DisplayName string            `json:"displayName,omitempty"`
	Group       string            `json:"group,omitempty"`
	IPAddresses []string          `json:"ipAddresses,omitempty"`
	ListenPorts []int             `json:"listenPorts,omitempty"`
	Favicon     string            `json:"favicon,omitempty"`
	ConfigURL   string            `json:"configUrl,omitempty"`
	Type        string            `json:"type,omitempty"`
	Properties  map[string]string `json:"properties,omitempty"`
	Tags        []string          `json:"tags,omitempty"`
	HostNames   []string          `json:"hostNames,omitempty"`
}

type CustomDevicePushResult added in v1.0.1

type CustomDevicePushResult struct {
	EntityID string `json:"entityId"`
	GroupID  string `json:"groupId"`
}

type CustomFilterChartConfig

type CustomFilterChartConfig struct {
	Type           CustomFilterChartConfigType      `json:"type"`
	Series         *[]CustomFilterChartSeriesConfig `json:"series"`
	ResultMetadata string                           `json:"resulMetadata,omitempty"`
}

type CustomFilterChartConfigType

type CustomFilterChartConfigType string
const (
	PIE          CustomFilterChartConfigType = "PIE"
	SINGLE_VALUE CustomFilterChartConfigType = "SINGLE_VALUE"
	TIMESERIES   CustomFilterChartConfigType = "TIMESERIES"
	TOP_LIST     CustomFilterChartConfigType = "TOP_LIST"
)

type CustomFilterChartSeriesConfig

type CustomFilterChartSeriesConfig struct {
	Metric        string                                   `json:"metric"`
	Aggregation   CustomFilterChartSeriesConfigAggregation `json:"aggregation"`
	Percentile    *int                                     `json:"percentile"`
	Type          CustomFilterChartSeriesConfigType        `json:"type"`
	EntityType    string                                   `json:"entityType"`
	Dimensions    []CustomFilterChartSeriesDimensionConfig `json:"dimensions"`
	SortAscending bool                                     `json:"sortAscending"`
	SortColumn    bool                                     `json:"sortColumn"`
}

type CustomFilterChartSeriesConfigType

type CustomFilterChartSeriesConfigType string

type CustomFilterChartSeriesDimensionConfig

type CustomFilterChartSeriesDimensionConfig struct {
	ID               string   `json:"id"`
	Values           []string `json:"values"`
	UsedForSplitting bool     `json:"usedForSplitting,omitempty"`
	EntityDimension  bool     `json:"entityDimension,omitempty"`
}

type CustomFilterConfig

type CustomFilterConfig struct {
	Type                 string                         `json:"type"`
	CustomName           string                         `json:"customName"`
	DefaultName          string                         `json:"defaultName,omitempty"`
	ChartConfig          *CustomFilterChartConfig       `json:"chartConfig"`
	FiltersPerEntityType map[string]map[string][]string `json:"filtersPerEntityType,omitempty"`
}

type Dashboard

type Dashboard struct {
	ID                string                 `json:"id,omitempty"`
	Metadata          *ConfigurationMetadata `json:"metadata,omitempty"`
	DashboardMetadata *DashboardMetadata     `json:"dashboardMetadata,omitempty"`
	Tiles             []Tile                 `json:"tiles"`
}

type DashboardFilter

type DashboardFilter struct {
	Timeframe      string                     `json:"tismeframe,omitempty"`
	ManagementZone *EntityShortRepresentation `json:"managementZone"`
}

type DashboardMetadata

type DashboardMetadata struct {
	Name            string           `json:"name"`
	Shared          bool             `json:"shared,omitempty"`
	Owner           string           `json:"owner,omitempty"`
	SharingDetails  *SharingInfo     `json:"sharingDetails,omitempty"`
	DashboardFilter *DashboardFilter `json:"dashboardFilter"`
}

type DashboardResponse

type DashboardResponse struct {
	Dashboards []DashboardStub `json:"dashboards"`
}

Dashboard Types

type DashboardStub

type DashboardStub struct {
	ID    string `json:"id"`
	Name  string `json:"name,omitempty"`
	Owner string `json:"owner,omitempty"`
}

type Details added in v1.0.1

type Details struct {
	EvidenceType      string         `json:"evidenceType"`
	DisplayName       string         `json:"displayName"`
	Entity            Entity         `json:"entity"`
	GroupingEntity    GroupingEntity `json:"groupingEntity"`
	RootCauseRelevant bool           `json:"rootCauseRelevant"`
	EventID           string         `json:"eventId"`
	EventType         string         `json:"eventType"`
	StartTime         int64          `json:"startTime"`
}

type Entity added in v1.0.1

type Entity struct {
	EntityID EntityID `json:"entityId"`
	Name     string   `json:"name"`
}

type EntityID added in v1.0.1

type EntityID struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

type EntityShortRepresentation

type EntityShortRepresentation struct {
	ID          string `json:"id"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type ErrorDetail

type ErrorDetail struct {
	Code                 int64                 `json:"code,omitempty"`
	Message              string                `json:"message,omitempty"`
	ConstraintViolations []ConstraintViolation `json:"constraintViolations"`
}

type ErrorResponse

type ErrorResponse struct {
	Detail *ErrorDetail `json:"error,omitempty"`
}

Error Types

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type EventCreation

type EventCreation struct {
	EventType             EventType            `json:"eventType,omitempty"`
	Start                 int64                `json:"start,omitempty"`
	End                   int64                `json:"end,omitempty"`
	TimeoutMinutes        int32                `json:"timeoutMinutes,omitempty"`
	Source                string               `json:"source,omitempty"`
	AnnotationType        string               `json:"annotationType,omitempty"`
	AnnotationDescription string               `json:"annotationDescription,omitempty"`
	AttachRules           PushEventAttachRules `json:"attachRules,omitempty"`
	Description           string               `json:"description,omitempty"`
	Title                 string               `json:"title,omitempty"`
	CustomProperties      map[string]string    `json:"customProperties,omitempty"`
	AllowDavisMerge       bool                 `json:"allowDavisMerge"`
}

type EventStoreResult

type EventStoreResult struct {
	StoredEventIds       []int    `json:"storedEventIds,omitempty"`
	StoredIds            []string `json:"storedIds,omitempty"`
	StoredCorrelationIds []string `json:"storedCorrelationIds,omitempty"`
}

type EventType

type EventType string

type EvidenceDetails added in v1.0.1

type EvidenceDetails struct {
	TotalCount int       `json:"totalCount"`
	Details    []Details `json:"details"`
}

type GroupingEntity added in v1.0.1

type GroupingEntity struct {
	EntityID EntityID `json:"entityId"`
	Name     string   `json:"name"`
}

type ImpactedEntities added in v1.0.1

type ImpactedEntities struct {
	EntityID EntityID `json:"entityId"`
	Name     string   `json:"name"`
}

type Monitored added in v1.0.1

type Monitored struct {
	INFRASTRUCTURE int `json:"INFRASTRUCTURE"`
	SERVICE        int `json:"SERVICE"`
	APPLICATION    int `json:"APPLICATION"`
	ENVIRONMENT    int `json:"ENVIRONMENT"`
}

type NameDetectionResponse

type NameDetectionResponse struct {
	Values []NameDetectionRule `json:"values"`
}

type NameDetectionRule

type NameDetectionRule struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type NameDetectionRuleDetail

type NameDetectionRuleDetail struct {
	Id                    string                               `json:"id,omitempty"`
	Metadata              NameDetectionRuleMetadata            `json:"metadata"`
	ApplicationIdentifier string                               `json:"applicationIdentifier"`
	FilterConfig          NameDetectionRuleFilterConfiguration `json:"filterConfig"`
}

type NameDetectionRuleFilterConfiguration

type NameDetectionRuleFilterConfiguration struct {
	Pattern                string `json:"pattern"`
	ApplicationMatchType   string `json:"applicationMatchType"`
	ApplicationMatchTarget string `json:"applicationMatchTarget"`
}

type NameDetectionRuleMetadata

type NameDetectionRuleMetadata struct {
	ClusterVersion        string  `json:"clusterVersion"`
	ConfigurationVersions []int64 `json:"configurationVersions"`
}

type NameDetectionRuleOrderRequest

type NameDetectionRuleOrderRequest struct {
	Values []NameDetectionRule `json:"values"`
}

type Problem added in v1.0.1

type Problem struct {
	ProblemID        string             `json:"problemId"`
	DisplayID        string             `json:"displayId"`
	Title            string             `json:"title"`
	ImpactLevel      string             `json:"impactLevel"`
	SeverityLevel    string             `json:"severityLevel"`
	Status           string             `json:"status"`
	AffectedEntities []AffectedEntities `json:"affectedEntities"`
	ImpactedEntities []ImpactedEntities `json:"impactedEntities"`
	RootCauseEntity  interface{}        `json:"rootCauseEntity"`
	ManagementZones  []interface{}      `json:"managementZones"`
	EntityTags       []interface{}      `json:"entityTags"`
	ProblemFilters   []ProblemFilters   `json:"problemFilters"`
	StartTime        int64              `json:"startTime"`
	EndTime          int                `json:"endTime"`
	EvidenceDetails  EvidenceDetails    `json:"evidenceDetails"`
}

type ProblemClose added in v1.0.1

type ProblemClose struct {
	Message string `json:"message"`
}

type ProblemFilters added in v1.0.1

type ProblemFilters struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type ProblemV1 added in v1.0.1

type ProblemV1 struct {
	ID                     string          `json:"id"`
	StartTime              int64           `json:"startTime"`
	EndTime                int             `json:"endTime"`
	DisplayName            string          `json:"displayName"`
	ImpactLevel            string          `json:"impactLevel"`
	Status                 string          `json:"status"`
	SeverityLevel          string          `json:"severityLevel"`
	CommentCount           int             `json:"commentCount"`
	TagsOfAffectedEntities []interface{}   `json:"tagsOfAffectedEntities"`
	RankedEvents           []RankedEvents  `json:"rankedEvents"`
	RankedImpacts          []RankedImpacts `json:"rankedImpacts"`
	AffectedCounts         AffectedCounts  `json:"affectedCounts"`
	RecoveredCounts        RecoveredCounts `json:"recoveredCounts"`
	HasRootCause           bool            `json:"hasRootCause"`
}

type ProblemV1Result added in v1.0.1

type ProblemV1Result struct {
	Result Result `json:"result"`
}

type ProblemsResponse added in v1.0.1

type ProblemsResponse struct {
	TotalCount int       `json:"totalCount"`
	PageSize   int       `json:"pageSize"`
	Problems   []Problem `json:"problems"`
}

type PushEventAttachRules

type PushEventAttachRules struct {
	EntityIds     []string       `json:"entityIds,omitempty"`
	TagMatchRules []TagMatchRule `json:"tagRule,omitempty"`
}

type RankedEvents added in v1.0.1

type RankedEvents struct {
	StartTime             int64             `json:"startTime"`
	EndTime               int               `json:"endTime"`
	EntityID              string            `json:"entityId"`
	EntityName            string            `json:"entityName"`
	SeverityLevel         string            `json:"severityLevel"`
	ImpactLevel           string            `json:"impactLevel"`
	EventType             string            `json:"eventType"`
	Status                string            `json:"status"`
	Severities            []interface{}     `json:"severities"`
	IsRootCause           bool              `json:"isRootCause"`
	CustomProperties      map[string]string `json:"customProperties"`
	Source                string            `json:"source"`
	AnnotationDescription string            `json:"annotationDescription"`
	CorrelationID         string            `json:"correlationId"`
}

type RankedImpacts added in v1.0.1

type RankedImpacts struct {
	EntityID      string `json:"entityId"`
	EntityName    string `json:"entityName"`
	SeverityLevel string `json:"severityLevel"`
	ImpactLevel   string `json:"impactLevel"`
	EventType     string `json:"eventType"`
}

type RecoveredCounts added in v1.0.1

type RecoveredCounts struct {
	INFRASTRUCTURE int `json:"INFRASTRUCTURE"`
	SERVICE        int `json:"SERVICE"`
	APPLICATION    int `json:"APPLICATION"`
	ENVIRONMENT    int `json:"ENVIRONMENT"`
}

type Result added in v1.0.1

type Result struct {
	Problems  []ProblemV1 `json:"problems"`
	Monitored Monitored   `json:"monitored"`
}

type SharingInfo

type SharingInfo struct {
	LinkShared bool `json:"linkShared,omitempty"`
	Published  bool `json:"published,omitempty"`
}

type TagInfo

type TagInfo struct {
	Context string `json:"context,omitempty"`
	Key     string `json:"key,omitempty"`
}

type TagMatchRule

type TagMatchRule struct {
	MeTypes []string  `json:"meTypes,omitempty"`
	Tags    []TagInfo `json:"tags,omitempty"`
}

type Tile

type Tile struct {
	Name       string      `json:"name"`
	TileType   TileType    `json:"tileType"`
	Configured bool        `json:"configured,omitempty"`
	Bounds     *TileBounds `json:"bounds"`
	TileFilter *TileFilter `json:"tileFilter"`

	// CustomChartingTile
	CustomFilterConfig *CustomFilterConfig `json:"filterConfig,omitempty"`
}

type TileBounds

type TileBounds struct {
	Top    int `json:"top"`
	Left   int `json:"left"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

type TileFilter

type TileFilter struct {
	ManagementZone *EntityShortRepresentation `json:"managementZone"`
}

type TileType

type TileType string
const (
	TileTypeApplication             TileType = "APPLICATION"
	TileTypeApplications            TileType = "APPLICATIONS"
	TileTypeApplicationsMostActive  TileType = "APPLICATIONS_MOST_ACTIVE"
	TileTypeApplicationMethod       TileType = "APPLICATION_METHOD"
	TileTypeApplicationWorldMap     TileType = "APPLICATION_WORLDMAP"
	TileTypeAWS                     TileType = "AWS"
	TileTypeBounceRate              TileType = "BOUNCE_RATE"
	TileTypeCustomApplication       TileType = "CUSTOM_APPLICATION"
	TileTypeCustomCharting          TileType = "CUSTOM_CHARTING"
	TileTypeDatabase                TileType = "DATABASE"
	TileTypeDAtabasesOverview       TileType = "DATABASES_OVERVIEW"
	TileTypeDCRUMServices           TileType = "DCRUM_SERVICES"
	TileTypeDocker                  TileType = "DOCKER"
	TileTypeDTAQL                   TileType = "DTAQL"
	TileTypeHeader                  TileType = "HEADER"
	TileTypeHost                    TileType = "HOST"
	TileTypeHosts                   TileType = "HOSTS"
	TileTypeLogAnalytics            TileType = "LOG_ANALYTICS"
	TileTypeMarkdown                TileType = "MARKDOWN"
	TileTypeMobileApplication       TileType = "MOBILE_APPLICATION"
	TileTypeNetwork                 TileType = "NETWORK"
	TileTypeNetworkMedium           TileType = "NETWORK_MEDIUM"
	TileTypeOpenProblems            TileType = "OPEN_PROBLEMS"
	TileTypeProcessGroupsOne        TileType = "PROCESS_GROUPS_ONE"
	TileTypePureModel               TileType = "PURE_MODEL"
	TileTypeResources               TileType = "RESOURCES"
	TileTypeServices                TileType = "SERVICES"
	TileTypeServiceVersatile        TileType = "SERVICE_VERSATILE"
	TileTypeSessionMetrics          TileType = "SESSION_METRICS"
	TileTypeSyntheticHTTPMonitor    TileType = "SYNTHETIC_HTTP_MONITOR"
	TileTypeSyntheticSingleExitTest TileType = "SYNTHETIC_SINGLE_EXT_TEST"
	TileTypeSyntheticSingleWebcheck TileType = "SYNTHETIC_SINGLE_WEBCHECK"
	TileTypeSyntheticTests          TileType = "SYNTHETIC_TESTS"
	TileTypeTechnologyLandscape     TileType = "TECHNOLOGY_LANDSCAPE"
	TileTypeThirdPartyMostActive    TileType = "THIRD_PARTY_MOST_ACTIVE"
	TileTypeUEMActiveSessions       TileType = "UEM_ACTIVE_SESSIONS"
	TileTypeUEMConversionsOverall   TileType = "UEM_CONVERSIONS_OVERALL"
	TileTypeUEMConversionsPerGoal   TileType = "UEM_CONVERSIONS_PER_GOAL"
	TileTypeUEMJSErrorsOverall      TileType = "UEM_JSERRORS_OVERALL"
	TileTypeUEMKeyUserActions       TileType = "UEM_KEY_USER_ACTIONS"
	TileTypeUsers                   TileType = "USERS"
	TileTypeVirtualization          TileType = "VIRTUALIZATION"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL