Documentation ¶
Index ¶
- Variables
- type Dashboard
- type DashboardFilter
- type DashboardMetadata
- type DashboardWidget
- type DashboardWidgetData
- type DashboardWidgetDataCompareWith
- type DashboardWidgetDataCompareWithPresentation
- type DashboardWidgetDataMetric
- type DashboardWidgetLayout
- type DashboardWidgetPresentation
- type DashboardWidgetThreshold
- type Dashboards
- func (dashboards *Dashboards) CreateDashboard(dashboard Dashboard) (*Dashboard, error)
- func (dashboards *Dashboards) DeleteDashboard(dashboardID int) (*Dashboard, error)
- func (dashboards *Dashboards) GetDashboard(dashboardID int) (*Dashboard, error)
- func (dashboards *Dashboards) ListDashboards(params *ListDashboardsParams) ([]Dashboard, error)
- func (dashboards *Dashboards) UpdateDashboard(dashboard Dashboard) (*Dashboard, error)
- type EditableType
- type ListDashboardsParams
- type VisibilityType
Constants ¶
This section is empty.
Variables ¶
var ( // Visibility specifies the possible options for a dashboard's visibility. Visibility = struct { Owner VisibilityType All VisibilityType }{ Owner: "owner", All: "all", } // Editable specifies the possible options for who can edit a dashboard. Editable = struct { Owner EditableType All EditableType ReadOnly EditableType }{ Owner: "editable_by_owner", All: "editable_by_all", ReadOnly: "read_only", } )
var BaseURLs = config.DefaultBaseURLs
BaseURLs represents the base API URLs for the different environments of the New Relic REST API V2.
Functions ¶
This section is empty.
Types ¶
type Dashboard ¶
type Dashboard struct { ID int `json:"id"` Title string `json:"title,omitempty"` Icon string `json:"icon,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` Visibility VisibilityType `json:"visibility,omitempty"` Editable EditableType `json:"editable,omitempty"` UIURL string `json:"ui_url,omitempty"` APIURL string `json:"api_url,omitempty"` OwnerEmail string `json:"owner_email,omitempty"` Metadata DashboardMetadata `json:"metadata"` Filter DashboardFilter `json:"filter,omitempty"` Widgets []DashboardWidget `json:"widgets,omitempty"` }
Dashboard represents information about a New Relic dashboard.
type DashboardFilter ¶
type DashboardFilter struct { EventTypes []string `json:"event_types,omitempty"` Attributes []string `json:"attributes,omitempty"` }
DashboardFilter represents the filter in a dashboard.
type DashboardMetadata ¶
type DashboardMetadata struct {
Version int `json:"version"`
}
DashboardMetadata represents metadata about the dashboard (like version)
type DashboardWidget ¶
type DashboardWidget struct { Visualization string `json:"visualization,omitempty"` ID int `json:"widget_id,omitempty"` AccountID int `json:"account_id,omitempty"` Data []DashboardWidgetData `json:"data,omitempty"` Presentation DashboardWidgetPresentation `json:"presentation,omitempty"` Layout DashboardWidgetLayout `json:"layout,omitempty"` }
DashboardWidget represents a widget in a dashboard.
type DashboardWidgetData ¶
type DashboardWidgetData struct { NRQL string `json:"nrql,omitempty"` Source string `json:"source,omitempty"` Duration int `json:"duration,omitempty"` EndTime int `json:"end_time,omitempty"` EntityIds []int `json:"entity_ids,omitempty"` CompareWith []DashboardWidgetDataCompareWith `json:"compare_with,omitempty"` Metrics []DashboardWidgetDataMetric `json:"metrics,omitempty"` RawMetricName string `json:"raw_metric_name,omitempty"` Facet string `json:"facet,omitempty"` OrderBy string `json:"order_by,omitempty"` Limit int `json:"limit,omitempty"` }
DashboardWidgetData represents the data backing a dashboard widget.
type DashboardWidgetDataCompareWith ¶
type DashboardWidgetDataCompareWith struct { OffsetDuration string `json:"offset_duration,omitempty"` Presentation DashboardWidgetDataCompareWithPresentation `json:"presentation,omitempty"` }
DashboardWidgetDataCompareWith represents the compare with configuration of the widget.
type DashboardWidgetDataCompareWithPresentation ¶
type DashboardWidgetDataCompareWithPresentation struct { Name string `json:"name,omitempty"` Color string `json:"color,omitempty"` }
DashboardWidgetDataCompareWithPresentation represents the compare with presentation configuration of the widget.
type DashboardWidgetDataMetric ¶
type DashboardWidgetDataMetric struct { Name string `json:"name,omitempty"` Units string `json:"units,omitempty"` Scope string `json:"scope,omitempty"` Values []string `json:"values,omitempty"` }
DashboardWidgetDataMetric represents the metrics data of the widget.
type DashboardWidgetLayout ¶
type DashboardWidgetLayout struct { Width int `json:"width"` Height int `json:"height"` Row int `json:"row"` Column int `json:"column"` }
DashboardWidgetLayout represents the layout of a widget in a dashboard.
type DashboardWidgetPresentation ¶
type DashboardWidgetPresentation struct { Title string `json:"title,omitempty"` Notes string `json:"notes,omitempty"` DrilldownDashboardID int `json:"drilldown_dashboard_id,omitempty"` Threshold *DashboardWidgetThreshold `json:"threshold,omitempty"` }
DashboardWidgetPresentation represents the visual presentation of a dashboard widget.
type DashboardWidgetThreshold ¶
type DashboardWidgetThreshold struct { Red float64 `json:"red,omitempty"` Yellow float64 `json:"yellow,omitempty"` }
DashboardWidgetThreshold represents the threshold configuration of a dashboard widget.
type Dashboards ¶
type Dashboards struct {
// contains filtered or unexported fields
}
Dashboards is used to communicate with the New Relic Dashboards product.
func New ¶
func New(config config.Config) Dashboards
New is used to create a new Dashboards client instance.
func (*Dashboards) CreateDashboard ¶
func (dashboards *Dashboards) CreateDashboard(dashboard Dashboard) (*Dashboard, error)
CreateDashboard is used to create a New Relic dashboard.
func (*Dashboards) DeleteDashboard ¶
func (dashboards *Dashboards) DeleteDashboard(dashboardID int) (*Dashboard, error)
DeleteDashboard is used to delete a New Relic dashboard.
func (*Dashboards) GetDashboard ¶
func (dashboards *Dashboards) GetDashboard(dashboardID int) (*Dashboard, error)
GetDashboard is used to retrieve a single New Relic dashboard.
func (*Dashboards) ListDashboards ¶
func (dashboards *Dashboards) ListDashboards(params *ListDashboardsParams) ([]Dashboard, error)
ListDashboards is used to retrieve New Relic dashboards.
func (*Dashboards) UpdateDashboard ¶
func (dashboards *Dashboards) UpdateDashboard(dashboard Dashboard) (*Dashboard, error)
UpdateDashboard is used to update a New Relic dashboard.
type EditableType ¶
type EditableType string
EditableType represents an option for the dashboard's editable field.
type ListDashboardsParams ¶
type ListDashboardsParams struct { Category string `url:"filter[category],omitempty"` CreatedAfter *time.Time `url:"filter[created_after],omitempty"` CreatedBefore *time.Time `url:"filter[created_before],omitempty"` Page int `url:"page,omitempty"` PerPage int `url:"per_page,omitempty"` Sort string `url:"sort,omitempty"` Title string `url:"filter[title],omitempty"` UpdatedAfter *time.Time `url:"filter[updated_after],omitempty"` UpdatedBefore *time.Time `url:"filter[updated_before],omitempty"` }
ListDashboardsParams represents a set of filters to be used when querying New Relic dashboards.
type VisibilityType ¶
type VisibilityType string
VisibilityType represents an option for the dashboard's visibility field.