dashboards

package
v0.91.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 11 Imported by: 4

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

DashboardBillboardWidgetThresholdInput - Billboard widget threshold input.

Code generated by tutone: DO NOT EDIT

Index

Constants

View Source
const DashboardCreateMutation = `` /* 6778-byte string literal not displayed */
View Source
const DashboardDeleteMutation = `mutation(
	$guid: EntityGuid!,
) { dashboardDelete(
	guid: $guid,
) {
	errors {
		description
		type
	}
	status
} }`
View Source
const DashboardUpdateMutation = `` /* 6770-byte string literal not displayed */

Variables

View Source
var DashboardCreateErrorTypeTypes = struct {
	// Invalid input error
	INVALID_INPUT DashboardCreateErrorType
}{

	INVALID_INPUT: "INVALID_INPUT",
}
View Source
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",
}
View Source
var DashboardDeleteResultStatusTypes = struct {
	// FAILURE.
	FAILURE DashboardDeleteResultStatus
	// SUCCESS.
	SUCCESS DashboardDeleteResultStatus
}{

	FAILURE: "FAILURE",

	SUCCESS: "SUCCESS",
}
View Source
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",
	}
)
View Source
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",
}
View Source
var DashboardUpdatePageErrorTypeTypes = struct {
	// User is not allowed to execute the operation
	FORBIDDEN_OPERATION DashboardUpdatePageErrorType
	// Invalid input error
	INVALID_INPUT DashboardUpdatePageErrorType
	// Page not found in the system
	PAGE_NOT_FOUND DashboardUpdatePageErrorType
}{

	FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION",

	INVALID_INPUT: "INVALID_INPUT",

	PAGE_NOT_FOUND: "PAGE_NOT_FOUND",
}
View Source
var DashboardUpdateWidgetsInPageErrorTypeTypes = struct {
	// User is not allowed to execute the operation
	FORBIDDEN_OPERATION DashboardUpdateWidgetsInPageErrorType
	// Invalid input error
	INVALID_INPUT DashboardUpdateWidgetsInPageErrorType
	// Page not found in the system
	PAGE_NOT_FOUND DashboardUpdateWidgetsInPageErrorType
	// Widget not found in the system
	WIDGET_NOT_FOUND DashboardUpdateWidgetsInPageErrorType
}{

	FORBIDDEN_OPERATION: "FORBIDDEN_OPERATION",

	INVALID_INPUT: "INVALID_INPUT",

	PAGE_NOT_FOUND: "PAGE_NOT_FOUND",

	WIDGET_NOT_FOUND: "WIDGET_NOT_FOUND",
}
View Source
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",
	}
)
View Source
var (
	GridColumnCountTypes = struct {
		Insights GridColumnCountType
		One      GridColumnCountType
	}{
		Insights: 3,
		One:      12,
	}
)
View Source
var (
	// VisibilityTypes specifies the possible options for a dashboard's visibility.
	VisibilityTypes = struct {
		Owner VisibilityType
		All   VisibilityType
	}{
		Owner: "owner",
		All:   "all",
	}
)
View Source
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 {
	// nrql queries
	NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"`
}

DashboardAreaWidgetConfigurationInput - Configuration for visualization type 'viz.area'

type DashboardBarWidgetConfigurationInput added in v0.53.0

type DashboardBarWidgetConfigurationInput struct {
	// nrql queries
	NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"`
}

DashboardBarWidgetConfigurationInput - Configuration for visualization type 'viz.bar'

type DashboardBillboardWidgetConfigurationInput added in v0.53.0

type DashboardBillboardWidgetConfigurationInput struct {
	// nrql queries
	NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,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"`
}

type DashboardCreateError added in v0.53.0

type DashboardCreateError struct {
	// Error description
	Description string `json:"description,omitempty"`
	// Error type
	Type DashboardCreateErrorType `json:"type"`
}

DashboardCreateError - Expected errors that can be returned by create operation

type DashboardCreateErrorType added in v0.53.0

type DashboardCreateErrorType string

DashboardCreateErrorType - Expected error types that can be returned by create operation

type DashboardCreateQueryResponse added in v0.57.1

type DashboardCreateQueryResponse 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 - Result of create operation.

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 types that can be returned by delete operation

type DashboardDeleteErrorType added in v0.53.0

type DashboardDeleteErrorType string

DashboardDeleteErrorType - Expected error types that can be returned by delete operation

type DashboardDeleteQueryResponse added in v0.57.1

type DashboardDeleteQueryResponse 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 of delete operation.

type DashboardDeleteResultStatus added in v0.53.0

type DashboardDeleteResultStatus string

DashboardDeleteResultStatus - Result status of 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 common.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 {
	// nrql queries
	NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,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 common.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 {
	// nrql queries
	NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"`
}

DashboardPieWidgetConfigurationInput - Configuration for visualization type 'viz.pie'

type DashboardSnapshotURLInput added in v0.60.1

type DashboardSnapshotURLInput struct {
	// Period of time from which the data to be displayed on the dashboard will be obtained.
	TimeWindow DashboardSnapshotURLTimeWindowInput `json:"timeWindow,omitempty"`
}

DashboardSnapshotURLInput - Parameters that affect the data and the rendering of the dashboards returned by the snapshot url mutation.

type DashboardSnapshotURLTimeWindowInput added in v0.60.1

type DashboardSnapshotURLTimeWindowInput struct {
	// The starting time of the time window. If specified, an endTime or a duration must also be specified.
	BeginTime nrtime.EpochMilliseconds `json:"beginTime,omitempty"`
	// The duration of the time window.
	Duration nrtime.Milliseconds `json:"duration,omitempty"`
	// The end time of the time window. If specified, a beginTime or a duration must also be specified.
	EndTime nrtime.EpochMilliseconds `json:"endTime,omitempty"`
}

DashboardSnapshotURLTimeWindowInput - Period of time from which the data to be displayed on the dashboard will be obtained.

type DashboardTableWidgetConfigurationInput added in v0.53.0

type DashboardTableWidgetConfigurationInput struct {
	// nrql queries
	NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,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 - Expected errors that can be returned by update operation

type DashboardUpdateErrorType added in v0.53.0

type DashboardUpdateErrorType string

DashboardUpdateErrorType - Expected error types that can be returned by update operation

type DashboardUpdatePageError added in v0.60.1

type DashboardUpdatePageError struct {
	// Error description
	Description string `json:"description,omitempty"`
	// Error type
	Type DashboardUpdatePageErrorType `json:"type"`
}

DashboardUpdatePageError - Expected errors that can be returned by updatePage operation

type DashboardUpdatePageErrorType added in v0.60.1

type DashboardUpdatePageErrorType string

DashboardUpdatePageErrorType - Expected error types that can be returned by updatePage operation

type DashboardUpdatePageInput added in v0.60.1

type DashboardUpdatePageInput struct {
	// Page description.
	Description string `json:"description,omitempty"`
	// Page name.
	Name string `json:"name"`
	// Page widgets.
	Widgets []DashboardWidgetInput `json:"widgets,omitempty"`
}

DashboardUpdatePageInput - Page input used when updating an individual page

type DashboardUpdatePageResult added in v0.60.1

type DashboardUpdatePageResult struct {
	// Expected errors while processing request. No errors means successful request.
	Errors []DashboardUpdatePageError `json:"errors,omitempty"`
}

DashboardUpdatePageResult - Result of updatePage operation.

type DashboardUpdateQueryResponse added in v0.57.1

type DashboardUpdateQueryResponse 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 - Result of update operation.

type DashboardUpdateWidgetInput added in v0.60.1

type DashboardUpdateWidgetInput struct {
	// Typed configuration for the widget
	Configuration DashboardWidgetConfigurationInput `json:"configuration,omitempty"`
	// Id of the widget to be updated.
	ID string `json:"id"`
	// layout
	Layout DashboardWidgetLayoutInput `json:"layout,omitempty"`
	// Related entities. Currently only supports Dashboard entities, but may allow other cases in the future.
	LinkedEntityGUIDs []common.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"`
}

DashboardUpdateWidgetInput - Input type used when updating widgets

type DashboardUpdateWidgetsInPageError added in v0.60.1

type DashboardUpdateWidgetsInPageError struct {
	// Error description
	Description string `json:"description,omitempty"`
	// Error type
	Type DashboardUpdateWidgetsInPageErrorType `json:"type"`
}

DashboardUpdateWidgetsInPageError - Expected errors that can be returned by updateWidgetsInPage operation

type DashboardUpdateWidgetsInPageErrorType added in v0.60.1

type DashboardUpdateWidgetsInPageErrorType string

DashboardUpdateWidgetsInPageErrorType - Expected error types that can be returned by updateWidgetsInPage operation

type DashboardUpdateWidgetsInPageResult added in v0.60.1

type DashboardUpdateWidgetsInPageResult struct {
	// Expected errors while processing request. No errors means successful request.
	Errors []DashboardUpdateWidgetsInPageError `json:"errors,omitempty"`
}

DashboardUpdateWidgetsInPageResult - Result of updateWidgetsInPage operation.

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 of the widget. If null, a new widget will be created and added to a dashboard.
	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 []common.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 DashboardWidgetNRQLQueryInput added in v0.55.6

type DashboardWidgetNRQLQueryInput struct {
	// accountId
	AccountID int `json:"accountId"`
	// NRQL formatted query
	Query nrdb.NRQL `json:"query"`
}

DashboardWidgetNRQLQueryInput - NRQL query used by a widget

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 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) DashboardCreate added in v0.53.0

func (a *Dashboards) DashboardCreate(
	accountID int,
	dashboard DashboardInput,
) (*DashboardCreateResult, error)

Create a `DashboardEntity`

func (*Dashboards) DashboardCreateWithContext added in v0.60.0

func (a *Dashboards) DashboardCreateWithContext(
	ctx context.Context,
	accountID int,
	dashboard DashboardInput,
) (*DashboardCreateResult, error)

Create a `DashboardEntity`

func (*Dashboards) DashboardDelete added in v0.53.0

func (a *Dashboards) DashboardDelete(
	gUID common.EntityGUID,
) (*DashboardDeleteResult, error)

Delete an existing `DashboardEntity`

func (*Dashboards) DashboardDeleteWithContext added in v0.60.0

func (a *Dashboards) DashboardDeleteWithContext(
	ctx context.Context,
	gUID common.EntityGUID,
) (*DashboardDeleteResult, error)

Delete an existing `DashboardEntity`

func (*Dashboards) DashboardUpdate added in v0.53.0

func (a *Dashboards) DashboardUpdate(
	dashboard DashboardInput,
	gUID common.EntityGUID,
) (*DashboardUpdateResult, error)

Update an existing `DashboardEntity`

func (*Dashboards) DashboardUpdateWithContext added in v0.60.0

func (a *Dashboards) DashboardUpdateWithContext(
	ctx context.Context,
	dashboard DashboardInput,
	gUID common.EntityGUID,
) (*DashboardUpdateResult, error)

Update an existing `DashboardEntity`

func (*Dashboards) GetDashboardEntity added in v0.53.0

func (d *Dashboards) GetDashboardEntity(gUID common.EntityGUID) (*entities.DashboardEntity, error)

GetDashboardEntity is used to retrieve a single New Relic One Dashboard

func (*Dashboards) GetDashboardEntityWithContext added in v0.60.0

func (d *Dashboards) GetDashboardEntityWithContext(ctx context.Context, gUID common.EntityGUID) (*entities.DashboardEntity, error)

GetDashboardEntityWithContext is used to retrieve a single New Relic One Dashboard

type EditableType

type EditableType string

EditableType represents an option for the dashboard's editable field.

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 RawConfiguration added in v0.91.0

type RawConfiguration struct {
	// Used by all widgets
	NRQLQueries     []DashboardWidgetNRQLQueryInput  `json:"nrqlQueries,omitempty"`
	PlatformOptions *RawConfigurationPlatformOptions `json:"platformOptions,omitempty"`

	// Used by viz.bullet
	Limit float64 `json:"limit,omitempty"`

	// Used by viz.markdown
	Text string `json:"text,omitempty"`

	// Used by viz.billboard
	Thresholds []DashboardBillboardWidgetThresholdInput `json:"thresholds,omitempty"`
}

RawConfiguration represents the configuration for widgets, it's a replacement for configuration field

type RawConfigurationPlatformOptions added in v0.91.0

type RawConfigurationPlatformOptions struct {
	IgnoreTimeRange bool `json:"ignoreTimeRange,omitempty"`
}

RawConfigurationPlatformOptions represents the platform widget options

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.

Jump to

Keyboard shortcuts

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