Documentation ¶
Overview ¶
Package dashboards provides a programmatic API for interacting with New Relic dashboards.
Code generated by tutone: DO NOT EDIT
Package dashboards provides a programmatic API for interacting with New Relic Insights dashboards. It can be used to create, read, update and delete dashboards. Refer to the Insights dashboard documentation for more information on working with these resources:
https://docs.newrelic.com/docs/insights/insights-api/manage-dashboards/insights-dashboard-api
Authentication ¶
You will need a Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key:
https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys
Code generated by tutone: DO NOT EDIT
Example (Dashboard) ¶
// Initialize the client configuration. A Personal API key is required to // communicate with the backend API. cfg := config.New() cfg.PersonalAPIKey = os.Getenv("NEW_RELIC_API_KEY") // Initialize the client. client := New(cfg) // Search the dashboards for the current account by title. listParams := &ListDashboardsParams{ Title: "Example dashboard", } dashboards, err := client.ListDashboards(listParams) if err != nil { log.Fatal("error listing dashboards:", err) } // Get dashboard by ID. This example assumes that at least one dashboard // has been returned by the list endpoint, but in practice it is possible // that an empty slice is returned. dashboard, err := client.GetDashboard(dashboards[0].ID) if err != nil { log.Fatal("error getting dashboard:", err) } // Create a new dashboard. applicationName := "Example application" dashboard = &Dashboard{ Title: "Example dashboard", Icon: DashboardIconTypes.BarChart, } requestsPerMinute := DashboardWidget{ Visualization: VisualizationTypes.Billboard, Data: []DashboardWidgetData{ { NRQL: fmt.Sprintf("FROM Transaction SELECT rate(count(*), 1 minute) WHERE appName = '%s'", applicationName), }, }, Presentation: DashboardWidgetPresentation{ Title: "Requests per minute", }, Layout: DashboardWidgetLayout{ Row: 1, Column: 1, }, } errorRate := DashboardWidget{ Visualization: VisualizationTypes.Gauge, Data: []DashboardWidgetData{ { NRQL: fmt.Sprintf("FROM Transaction SELECT percentage(count(*), WHERE error IS true) WHERE appName = '%s'", applicationName), }, }, Presentation: DashboardWidgetPresentation{ Title: "Error rate", Threshold: &DashboardWidgetThreshold{ Red: 2.5, }, }, Layout: DashboardWidgetLayout{ Row: 1, Column: 2, }, } notes := DashboardWidget{ Visualization: VisualizationTypes.Markdown, Data: []DashboardWidgetData{ { Source: "### Helpful Links\n\n* [New Relic One](https://one.newrelic.com)\n* [Developer Portal](https://developer.newrelic.com)", }, }, Presentation: DashboardWidgetPresentation{ Title: "Dashboard note", }, Layout: DashboardWidgetLayout{ Row: 1, Column: 3, }, } dashboard.Widgets = []DashboardWidget{ requestsPerMinute, errorRate, notes, } created, err := client.CreateDashboard(*dashboard) if err != nil { log.Fatal("error creating dashboard:", err) } // Add a widget to an existing dashboard. topApdex := DashboardWidget{ Visualization: VisualizationTypes.FacetTable, Data: []DashboardWidgetData{ { NRQL: fmt.Sprintf("FROM Transaction SELECT rate(count(*), 1 minute) FACET name WHERE appName = '%s'", applicationName), }, }, Presentation: DashboardWidgetPresentation{ Title: "Requests per minute, by transaction", }, Layout: DashboardWidgetLayout{ Row: 1, Column: 2, Width: 3, }, } created.Widgets = append(created.Widgets, topApdex) updated, err := client.UpdateDashboard(*created) if err != nil { log.Fatal("error updating dashboard:", err) } // Delete a dashaboard. _, err = client.DeleteDashboard(updated.ID) if err != nil { log.Fatal("error deleting dashboard:", err) }
Output:
Index ¶
- Constants
- Variables
- type Dashboard
- type DashboardAreaWidgetConfigurationInput
- type DashboardBarWidgetConfigurationInput
- type DashboardBillboardWidgetConfigurationInput
- type DashboardBillboardWidgetThresholdInput
- type DashboardCreateError
- type DashboardCreateErrorType
- type DashboardCreateResponse
- type DashboardCreateResult
- type DashboardDeleteError
- type DashboardDeleteErrorType
- type DashboardDeleteResponse
- type DashboardDeleteResult
- type DashboardDeleteResultStatus
- type DashboardEntityResult
- type DashboardFilter
- type DashboardIconType
- type DashboardInput
- type DashboardLineWidgetConfigurationInput
- type DashboardMarkdownWidgetConfigurationInput
- type DashboardMetadata
- type DashboardPageInput
- type DashboardPieWidgetConfigurationInput
- type DashboardTableWidgetConfigurationInput
- type DashboardUpdateError
- type DashboardUpdateErrorType
- type DashboardUpdateResponse
- type DashboardUpdateResult
- type DashboardWidget
- type DashboardWidgetConfigurationInput
- type DashboardWidgetData
- type DashboardWidgetDataCompareWith
- type DashboardWidgetDataCompareWithPresentation
- type DashboardWidgetDataMetric
- type DashboardWidgetInput
- type DashboardWidgetLayout
- type DashboardWidgetLayoutInput
- type DashboardWidgetPresentation
- type DashboardWidgetQueryInput
- type DashboardWidgetThreshold
- type DashboardWidgetVisualizationInput
- type Dashboards
- func (d *Dashboards) CreateDashboard(dashboard Dashboard) (*Dashboard, error)
- func (a *Dashboards) DashboardCreate(accountID int, dashboard DashboardInput) (*DashboardCreateResult, error)
- func (a *Dashboards) DashboardDelete(gUID entities.EntityGUID) (*DashboardDeleteResult, error)
- func (a *Dashboards) DashboardUpdate(dashboard DashboardInput, gUID entities.EntityGUID) (*DashboardUpdateResult, error)
- func (d *Dashboards) DeleteDashboard(dashboardID int) (*Dashboard, error)
- func (d *Dashboards) GetDashboard(dashboardID int) (*Dashboard, error)
- func (d *Dashboards) GetDashboardEntity(gUID entities.EntityGUID) (*entities.DashboardEntity, error)
- func (d *Dashboards) ListDashboards(params *ListDashboardsParams) ([]*Dashboard, error)
- func (d *Dashboards) UpdateDashboard(dashboard Dashboard) (*Dashboard, error)
- type EditableType
- type Float
- type GridColumnCountType
- type ListDashboardsParams
- type VisibilityType
- type VisualizationType
Examples ¶
Constants ¶
const DashboardCreateMutation = `` /* 6631-byte string literal not displayed */
const DashboardDeleteMutation = `mutation(
$guid: EntityGuid!,
) { dashboardDelete(
guid: $guid,
) {
errors {
description
type
}
status
} }`
const DashboardUpdateMutation = `` /* 6623-byte string literal not displayed */
Variables ¶
var DashboardCreateErrorTypeTypes = struct { // Invalid input error INVALID_INPUT DashboardCreateErrorType }{ INVALID_INPUT: "INVALID_INPUT", }
var DashboardDeleteErrorTypeTypes = struct { // Dashboard not found in the system DASHBOARD_NOT_FOUND DashboardDeleteErrorType // User is not allowed to execute the operation FORBIDDEN_OPERATION DashboardDeleteErrorType }{ DASHBOARD_NOT_FOUND: "DASHBOARD_NOT_FOUND", FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION", }
var DashboardDeleteResultStatusTypes = struct { // FAILURE. FAILURE DashboardDeleteResultStatus // SUCCESS. SUCCESS DashboardDeleteResultStatus }{ FAILURE: "FAILURE", SUCCESS: "SUCCESS", }
var ( // DashboardIconTypes specifies the possible options for dashboard icons. DashboardIconTypes = struct { Adjust DashboardIconType Archive DashboardIconType BarChart DashboardIconType Bell DashboardIconType Bolt DashboardIconType Bug DashboardIconType Bullhorn DashboardIconType Bullseye DashboardIconType Clock DashboardIconType Cloud DashboardIconType Cog DashboardIconType Comments DashboardIconType Crosshairs DashboardIconType Dashboard DashboardIconType Envelope DashboardIconType Fire DashboardIconType Flag DashboardIconType Flask DashboardIconType Globe DashboardIconType Heart DashboardIconType Leaf DashboardIconType Legal DashboardIconType LifeRing DashboardIconType LineChart DashboardIconType Magic DashboardIconType Mobile DashboardIconType Money DashboardIconType None DashboardIconType PaperPlane DashboardIconType PieChart DashboardIconType PuzzlePiece DashboardIconType Road DashboardIconType Rocket DashboardIconType ShoppingCart DashboardIconType Sitemap DashboardIconType Sliders DashboardIconType Tablet DashboardIconType ThumbsDown DashboardIconType ThumbsUp DashboardIconType Trophy DashboardIconType USD DashboardIconType User DashboardIconType Users DashboardIconType }{ Adjust: "adjust", Archive: "archive", BarChart: "bar-chart", Bell: "bell", Bolt: "bolt", Bug: "bug", Bullhorn: "bullhorn", Bullseye: "bullseye", Clock: "clock-o", Cloud: "cloud", Cog: "cog", Comments: "comments-o", Crosshairs: "crosshairs", Dashboard: "dashboard", Envelope: "envelope", Fire: "fire", Flag: "flag", Flask: "flask", Globe: "globe", Heart: "heart", Leaf: "leaf", Legal: "legal", LifeRing: "life-ring", LineChart: "line-chart", Magic: "magic", Mobile: "mobile", Money: "money", None: "none", PaperPlane: "paper-plane", PieChart: "pie-chart", PuzzlePiece: "puzzle-piece", Road: "road", Rocket: "rocket", ShoppingCart: "shopping-cart", Sitemap: "sitemap", Sliders: "sliders", Tablet: "tablet", ThumbsDown: "thumbs-down", ThumbsUp: "thumbs-up", Trophy: "trophy", USD: "usd", User: "user", Users: "users", } )
var DashboardUpdateErrorTypeTypes = struct { // User is not allowed to execute the operation FORBIDDEN_OPERATION DashboardUpdateErrorType // Invalid input error INVALID_INPUT DashboardUpdateErrorType }{ FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION", INVALID_INPUT: "INVALID_INPUT", }
var ( // EditableTypes specifies the possible options for who can edit a dashboard. EditableTypes = struct { Owner EditableType All EditableType ReadOnly EditableType }{ Owner: "editable_by_owner", All: "editable_by_all", ReadOnly: "read_only", } )
var ( GridColumnCountTypes = struct { Insights GridColumnCountType One GridColumnCountType }{ Insights: 3, One: 12, } )
var ( // VisibilityTypes specifies the possible options for a dashboard's visibility. VisibilityTypes = struct { Owner VisibilityType All VisibilityType }{ Owner: "owner", All: "all", } )
var ( // VisualizationTypes specifies the possible options for dashboard widget types. VisualizationTypes = struct { ApplicationBreakdown VisualizationType AttributeSheet VisualizationType Billboard VisualizationType BillboardComparison VisualizationType ComparisonLineChart VisualizationType EventFeed VisualizationType EventTable VisualizationType FacetBarChart VisualizationType FacetPieChart VisualizationType FacetTable VisualizationType FacetedAreaChart VisualizationType FacetedLineChart VisualizationType Funnel VisualizationType Gauge VisualizationType Heatmap VisualizationType Histogram VisualizationType LineChart VisualizationType Markdown VisualizationType MetricLineChart VisualizationType RawJSON VisualizationType SingleEvent VisualizationType UniquesList VisualizationType }{ ApplicationBreakdown: "application_breakdown", AttributeSheet: "attribute_sheet", Billboard: "billboard", BillboardComparison: "billboard_comparison", ComparisonLineChart: "comparison_line_chart", EventFeed: "event_feed", EventTable: "event_table", FacetBarChart: "facet_bar_chart", FacetPieChart: "facet_pie_chart", FacetTable: "facet_table", FacetedAreaChart: "faceted_area_chart", FacetedLineChart: "faceted_line_chart", Funnel: "funnel", Gauge: "gauge", Heatmap: "heatmap", Histogram: "histogram", LineChart: "line_chart", Markdown: "markdown", MetricLineChart: "metric_line_chart", RawJSON: "raw_json", SingleEvent: "single_event", UniquesList: "uniques_list", } )
Functions ¶
This section is empty.
Types ¶
type Dashboard ¶
type Dashboard struct { ID int `json:"id"` Title string `json:"title,omitempty"` Icon DashboardIconType `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"` GridColumnCount GridColumnCountType `json:"grid_column_count,omitempty"` }
Dashboard represents information about a New Relic dashboard.
type DashboardAreaWidgetConfigurationInput ¶ added in v0.53.0
type DashboardAreaWidgetConfigurationInput struct { // queries Queries []DashboardWidgetQueryInput `json:"queries,omitempty"` }
DashboardAreaWidgetConfigurationInput - Configuration for visualization type 'viz.area'
type DashboardBarWidgetConfigurationInput ¶ added in v0.53.0
type DashboardBarWidgetConfigurationInput struct { // queries Queries []DashboardWidgetQueryInput `json:"queries,omitempty"` }
DashboardBarWidgetConfigurationInput - Configuration for visualization type 'viz.bar'
type DashboardBillboardWidgetConfigurationInput ¶ added in v0.53.0
type DashboardBillboardWidgetConfigurationInput struct { // queries Queries []DashboardWidgetQueryInput `json:"queries,omitempty"` // thresholds Thresholds []DashboardBillboardWidgetThresholdInput `json:"thresholds,omitempty"` }
DashboardBillboardWidgetConfigurationInput - Configuration for visualization type 'viz.billboard'
type DashboardBillboardWidgetThresholdInput ¶ added in v0.53.0
type DashboardBillboardWidgetThresholdInput struct { // alert severity. AlertSeverity entities.DashboardAlertSeverity `json:"alertSeverity,omitempty"` // value. Value float64 `json:"value,omitempty"` }
DashboardBillboardWidgetThresholdInput - Billboard widget threshold input.
type DashboardCreateError ¶ added in v0.53.0
type DashboardCreateError struct { // Error description Description string `json:"description,omitempty"` // Error type Type DashboardCreateErrorType `json:"type"` }
DashboardCreateError - Error information to add as first citizen in create operations
type DashboardCreateErrorType ¶ added in v0.53.0
type DashboardCreateErrorType string
DashboardCreateErrorType - List of expected error types that can be thrown by a dashboard create operation
type DashboardCreateResponse ¶ added in v0.53.0
type DashboardCreateResponse struct {
DashboardCreateResult DashboardCreateResult `json:"DashboardCreate"`
}
type DashboardCreateResult ¶ added in v0.53.0
type DashboardCreateResult struct { // Dashboard creation result EntityResult DashboardEntityResult `json:"entityResult,omitempty"` // Expected errors while processing request Errors []DashboardCreateError `json:"errors,omitempty"` }
DashboardCreateResult - Create mutation results
type DashboardDeleteError ¶ added in v0.53.0
type DashboardDeleteError struct { // Error description Description string `json:"description,omitempty"` // Error type Type DashboardDeleteErrorType `json:"type"` }
DashboardDeleteError - Expected error that can be thrown by a Dashboard delete operation
type DashboardDeleteErrorType ¶ added in v0.53.0
type DashboardDeleteErrorType string
DashboardDeleteErrorType - Expected error type that can be thrown by a Dashboard delete operation
type DashboardDeleteResponse ¶ added in v0.53.0
type DashboardDeleteResponse struct {
DashboardDeleteResult DashboardDeleteResult `json:"DashboardDelete"`
}
type DashboardDeleteResult ¶ added in v0.53.0
type DashboardDeleteResult struct { // Expected errors while processing request Errors []DashboardDeleteError `json:"errors,omitempty"` // The status of the attempted delete. Status DashboardDeleteResultStatus `json:"status,omitempty"` }
DashboardDeleteResult - Result from a Dashboard delete operation.
type DashboardDeleteResultStatus ¶ added in v0.53.0
type DashboardDeleteResultStatus string
DashboardDeleteResultStatus - Result status from a Dashboard delete operation.
type DashboardEntityResult ¶ added in v0.53.0
type DashboardEntityResult struct { // Account ID. AccountID int `json:"accountId,omitempty"` // Dashboard creation timestamp. CreatedAt nrtime.DateTime `json:"createdAt,omitempty"` // Dashboard description. Description string `json:"description,omitempty"` // Unique entity identifier. GUID entities.EntityGUID `json:"guid,omitempty"` // Dashboard name. Name string `json:"name,omitempty"` // Dashboard owner Owner entities.DashboardOwnerInfo `json:"owner,omitempty"` // Dashboard pages. Pages []entities.DashboardPage `json:"pages,omitempty"` // Dashboard permissions configuration. Permissions entities.DashboardPermissions `json:"permissions,omitempty"` // Dashboard update timestamp. UpdatedAt nrtime.DateTime `json:"updatedAt,omitempty"` }
DashboardEntityResult - public schema - `DashboardEntity` result representation for mutations. It's a subset of the `DashboardEntity` that inherits from the Entity type, but a complete different type.
type DashboardFilter ¶
type DashboardFilter struct { EventTypes []string `json:"event_types,omitempty"` Attributes []string `json:"attributes,omitempty"` }
DashboardFilter represents the filter in a dashboard.
type DashboardIconType ¶ added in v0.17.0
type DashboardIconType string
DashboardIconType represents an option for the dashboard's icon field.
type DashboardInput ¶ added in v0.53.0
type DashboardInput struct { // Dashboard description. Description string `json:"description,omitempty"` // Dashboard name. Name string `json:"name"` // Dashboard page input. Pages []DashboardPageInput `json:"pages,omitempty"` // Dashboard permissions configuration. Permissions entities.DashboardPermissions `json:"permissions"` }
DashboardInput - Dashboard input
type DashboardLineWidgetConfigurationInput ¶ added in v0.53.0
type DashboardLineWidgetConfigurationInput struct { // queries Queries []DashboardWidgetQueryInput `json:"queries,omitempty"` }
DashboardLineWidgetConfigurationInput - Configuration for visualization type 'viz.line'
type DashboardMarkdownWidgetConfigurationInput ¶ added in v0.53.0
type DashboardMarkdownWidgetConfigurationInput struct { // Markdown content of the widget Text string `json:"text"` }
DashboardMarkdownWidgetConfigurationInput - Configuration for visualization type 'viz.markdown'
type DashboardMetadata ¶
type DashboardMetadata struct {
Version int `json:"version"`
}
DashboardMetadata represents metadata about the dashboard (like version)
type DashboardPageInput ¶ added in v0.53.0
type DashboardPageInput struct { // Page description. Description string `json:"description,omitempty"` // Unique entity identifier of the Page to be updated. When null, it means a new Page will be created. GUID entities.EntityGUID `json:"guid,omitempty"` // Page name. Name string `json:"name"` // Page widgets. Widgets []DashboardWidgetInput `json:"widgets,omitempty"` }
DashboardPageInput - Page input
type DashboardPieWidgetConfigurationInput ¶ added in v0.53.0
type DashboardPieWidgetConfigurationInput struct { // queries Queries []DashboardWidgetQueryInput `json:"queries,omitempty"` }
DashboardPieWidgetConfigurationInput - Configuration for visualization type 'viz.pie'
type DashboardTableWidgetConfigurationInput ¶ added in v0.53.0
type DashboardTableWidgetConfigurationInput struct { // queries Queries []DashboardWidgetQueryInput `json:"queries,omitempty"` }
DashboardTableWidgetConfigurationInput - Configuration for visualization type 'viz.table'
type DashboardUpdateError ¶ added in v0.53.0
type DashboardUpdateError struct { // Error description Description string `json:"description,omitempty"` // Error type Type DashboardUpdateErrorType `json:"type"` }
DashboardUpdateError - Error information to add as first citizen in update operations
type DashboardUpdateErrorType ¶ added in v0.53.0
type DashboardUpdateErrorType string
DashboardUpdateErrorType - List of expected error types that can be thrown by a dashboard update operation
type DashboardUpdateResponse ¶ added in v0.53.0
type DashboardUpdateResponse struct {
DashboardUpdateResult DashboardUpdateResult `json:"DashboardUpdate"`
}
type DashboardUpdateResult ¶ added in v0.53.0
type DashboardUpdateResult struct { // Dashboard update result EntityResult DashboardEntityResult `json:"entityResult,omitempty"` // Expected errors while processing request Errors []DashboardUpdateError `json:"errors,omitempty"` }
DashboardUpdateResult - Update mutation results
type DashboardWidget ¶
type DashboardWidget struct { Visualization VisualizationType `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 DashboardWidgetConfigurationInput ¶ added in v0.53.0
type DashboardWidgetConfigurationInput struct { // Configuration for visualization type 'viz.area' Area *DashboardAreaWidgetConfigurationInput `json:"area,omitempty"` // Configuration for visualization type 'viz.bar' Bar *DashboardBarWidgetConfigurationInput `json:"bar,omitempty"` // Configuration for visualization type 'viz.billboard' Billboard *DashboardBillboardWidgetConfigurationInput `json:"billboard,omitempty"` // Configuration for visualization type 'viz.line' Line *DashboardLineWidgetConfigurationInput `json:"line,omitempty"` // Configuration for visualization type 'viz.markdown' Markdown *DashboardMarkdownWidgetConfigurationInput `json:"markdown,omitempty"` // Configuration for visualization type 'viz.pie' Pie *DashboardPieWidgetConfigurationInput `json:"pie,omitempty"` // Configuration for visualization type 'viz.table' Table *DashboardTableWidgetConfigurationInput `json:"table,omitempty"` }
DashboardWidgetConfigurationInput - Typed configuration for known visualizations. At most one may be populated.
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 DashboardWidgetInput ¶ added in v0.53.0
type DashboardWidgetInput struct { // Typed configuration for the widget Configuration DashboardWidgetConfigurationInput `json:"configuration,omitempty"` // id. ID string `json:"id,omitempty"` // layout Layout DashboardWidgetLayoutInput `json:"layout,omitempty"` // Related entities. Currently only supports Dashboard entities, but may allow other cases in the future. LinkedEntityGUIDs []entities.EntityGUID `json:"linkedEntityGuids"` // Untyped scalar of configuration for the widget RawConfiguration entities.DashboardWidgetRawConfiguration `json:"rawConfiguration,omitempty"` // title Title string `json:"title,omitempty"` // Specifies how this widget will be visualized. If null, the WidgetConfigurationInput will be used to determine the visualization. Visualization DashboardWidgetVisualizationInput `json:"visualization,omitempty"` }
DashboardWidgetInput - Widget Input
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 DashboardWidgetLayoutInput ¶ added in v0.53.0
type DashboardWidgetLayoutInput struct { // column. Column int `json:"column,omitempty"` // height. Height int `json:"height,omitempty"` // row. Row int `json:"row,omitempty"` // width. Width int `json:"width,omitempty"` }
DashboardWidgetLayoutInput - Widget layout input
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 DashboardWidgetQueryInput ¶ added in v0.53.0
type DashboardWidgetQueryInput struct { // accountId AccountID int `json:"accountId"` // NRQL formatted query NRQL nrdb.NRQL `json:"nrql"` }
DashboardWidgetQueryInput -
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 DashboardWidgetVisualizationInput ¶ added in v0.53.0
type DashboardWidgetVisualizationInput struct { // Nerdpack artifact ID ID string `json:"id,omitempty"` }
DashboardWidgetVisualizationInput - visualization configuration
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 (d *Dashboards) CreateDashboard(dashboard Dashboard) (*Dashboard, error)
CreateDashboard is used to create a New Relic dashboard.
func (*Dashboards) DashboardCreate ¶ added in v0.53.0
func (a *Dashboards) DashboardCreate( accountID int, dashboard DashboardInput, ) (*DashboardCreateResult, error)
Create a `DashboardEntity`
func (*Dashboards) DashboardDelete ¶ added in v0.53.0
func (a *Dashboards) DashboardDelete( gUID entities.EntityGUID, ) (*DashboardDeleteResult, error)
Delete an existing `DashboardEntity`
func (*Dashboards) DashboardUpdate ¶ added in v0.53.0
func (a *Dashboards) DashboardUpdate( dashboard DashboardInput, gUID entities.EntityGUID, ) (*DashboardUpdateResult, error)
) Update an existing `DashboardEntity`
func (*Dashboards) DeleteDashboard ¶
func (d *Dashboards) DeleteDashboard(dashboardID int) (*Dashboard, error)
DeleteDashboard is used to delete a New Relic dashboard.
func (*Dashboards) GetDashboard ¶
func (d *Dashboards) GetDashboard(dashboardID int) (*Dashboard, error)
GetDashboard is used to retrieve a single New Relic dashboard.
func (*Dashboards) GetDashboardEntity ¶ added in v0.53.0
func (d *Dashboards) GetDashboardEntity(gUID entities.EntityGUID) (*entities.DashboardEntity, error)
GetDashboardEntity is used to retrieve a single New Relic One Dashboard
This is pre-release, so best to avoid until the feature is GA.
func (*Dashboards) ListDashboards ¶
func (d *Dashboards) ListDashboards(params *ListDashboardsParams) ([]*Dashboard, error)
ListDashboards is used to retrieve New Relic dashboards.
func (*Dashboards) UpdateDashboard ¶
func (d *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 Float ¶ added in v0.53.0
type Float string
Float - The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).
type GridColumnCountType ¶ added in v0.22.0
type GridColumnCountType int
GridColumnCountType represents an option for the dashboard's grid column count. New Relic Insights supports a 3 column grid. New Relic One supports a 12 column grid.
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.
type VisualizationType ¶ added in v0.17.0
type VisualizationType string
VisualizationType represents an option for adashboard widget's type.