entities

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

BaseURLs represents the base API URLs for the different environments of the New Relic REST API V2.

View Source
var (
	// EntityAlertSeverities specifies the possible alert severities for a New Relic One entity.
	EntityAlertSeverities = struct {
		Critical      EntityAlertSeverityType
		NotAlerting   EntityAlertSeverityType
		NotConfigured EntityAlertSeverityType
		Warning       EntityAlertSeverityType
	}{
		Critical:      "APM",
		NotAlerting:   "NOT_ALERTING",
		NotConfigured: "NOT_CONFIGURED",
		Warning:       "WARNING",
	}
)
View Source
var (
	// EntityDomains specifies the possible domains for a New Relic One entity.
	EntityDomains = struct {
		APM            EntityDomainType
		Browser        EntityDomainType
		Infrastructure EntityDomainType
		Mobile         EntityDomainType
		Synthetics     EntityDomainType
	}{
		APM:            "APM",
		Browser:        "BROWSER",
		Infrastructure: "INFRA",
		Mobile:         "MOBILE",
		Synthetics:     "SYNTH",
	}
)
View Source
var (
	// EntityTypes specifies the possible types for a New Relic One entity.
	EntityTypes = struct {
		Application EntityType
		Dashboard   EntityType
		Host        EntityType
		Monitor     EntityType
	}{
		Application: "APPLICATION",
		Dashboard:   "DASHBOARD",
		Host:        "HOST",
		Monitor:     "MONITOR",
	}
)

Functions

This section is empty.

Types

type Entities

type Entities struct {
	// contains filtered or unexported fields
}

Entities is used to communicate with the New Relic Entities product.

func New

func New(config config.Config) Entities

New returns a new client for interacting with New Relic One entities.

func (*Entities) AddTags

func (e *Entities) AddTags(guid string, tags []Tag) error

AddTags writes tags to the entity specified by the provided entity GUID.

func (*Entities) DeleteTagValues

func (e *Entities) DeleteTagValues(guid string, tagValues []TagValue) error

DeleteTagValues deletes specific tag key and value pairs from the entity.

func (*Entities) DeleteTags

func (e *Entities) DeleteTags(guid string, tagKeys []string) error

DeleteTags deletes specific tag keys from the entity.

func (*Entities) GetEntities

func (e *Entities) GetEntities(guids []string) ([]*Entity, error)

GetEntities retrieves a set of New Relic One entities by their entity guids.

func (*Entities) GetEntity

func (e *Entities) GetEntity(guid string) (*Entity, error)

GetEntity retrieve a set of New Relic One entities by their entity guids.

func (*Entities) ListTags

func (e *Entities) ListTags(guid string) ([]*Tag, error)

ListTags returns a collection of tags for a given entity by entity GUID.

func (*Entities) ReplaceTags

func (e *Entities) ReplaceTags(guid string, tags []Tag) error

ReplaceTags replaces the entity's entire set of tags with the provided tag set.

func (*Entities) SearchEntities

func (e *Entities) SearchEntities(params ListEntitiesParams) ([]*Entity, error)

SearchEntities searches New Relic One entities based on the provided search parameters.

type Entity

type Entity struct {
	AccountID  int
	Domain     EntityDomainType
	EntityType EntityType
	GUID       string
	Name       string
	Permalink  string
	Reporting  bool
	Type       string
}

Entity represents a New Relic One entity.

type EntityAlertSeverityType

type EntityAlertSeverityType string

EntityAlertSeverityType represents a New Relic One entity alert severity.

type EntityDomainType

type EntityDomainType string

EntityDomainType represents a New Relic One entity domain.

type EntityType

type EntityType string

EntityType represents a New Relic One entity type.

type ListEntitiesParams

type ListEntitiesParams struct {
	AlertSeverity                 EntityAlertSeverityType `json:"alertSeverity,omitempty"`
	Domain                        EntityDomainType        `json:"domain,omitempty"`
	InfrastructureIntegrationType string                  `json:"infrastructureIntegrationType,omitempty"`
	Name                          string                  `json:"name,omitempty"`
	Reporting                     *bool                   `json:"reporting,omitempty"`
	Tags                          []Tag                   `json:"tags,omitempty"`
	Type                          EntityType              `json:"type,omitempty"`
}

ListEntitiesParams represents a set of search parameters for retrieving New Relic One entities.

type Tag

type Tag struct {
	Key    string
	Values []string
}

Tag represents a New Relic One entity tag.

type TagValue

type TagValue struct {
	Key   string
	Value string
}

TagValue represents a New Relic One entity tag and value pair.

Jump to

Keyboard shortcuts

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