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
- Variables
- type Dashboard
- type DashboardAreaWidgetConfigurationInput
- type DashboardBarWidgetConfigurationInput
- type DashboardBillboardWidgetConfigurationInput
- type DashboardBillboardWidgetThresholdInput
- type DashboardCreateError
- type DashboardCreateErrorType
- type DashboardCreateQueryResponse
- type DashboardCreateResult
- type DashboardDeleteError
- type DashboardDeleteErrorType
- type DashboardDeleteQueryResponse
- type DashboardDeleteResult
- type DashboardDeleteResultStatus
- type DashboardEntityResult
- type DashboardFilter
- type DashboardIconType
- type DashboardInput
- type DashboardLineTableWidgetsAlertSeverity
- type DashboardLineWidgetConfigurationInput
- type DashboardLineWidgetThresholdInput
- type DashboardLineWidgetThresholdThresholdInput
- type DashboardLiveURL
- type DashboardLiveURLType
- type DashboardMarkdownWidgetConfigurationInput
- type DashboardMetadata
- type DashboardPageInput
- type DashboardPieWidgetConfigurationInput
- type DashboardSnapshotURLInput
- type DashboardSnapshotURLTimeWindowInput
- type DashboardTableWidgetConfigurationInput
- type DashboardTableWidgetThresholdInput
- type DashboardUpdateError
- type DashboardUpdateErrorType
- type DashboardUpdatePageError
- type DashboardUpdatePageErrorType
- type DashboardUpdatePageInput
- type DashboardUpdatePageResult
- type DashboardUpdateQueryResponse
- type DashboardUpdateResult
- type DashboardUpdateWidgetInput
- type DashboardUpdateWidgetsInPageError
- type DashboardUpdateWidgetsInPageErrorType
- type DashboardUpdateWidgetsInPageResult
- type DashboardVariable
- type DashboardVariableDefaultItem
- type DashboardVariableDefaultItemInput
- type DashboardVariableDefaultValue
- type DashboardVariableDefaultValueInput
- type DashboardVariableEnumItem
- type DashboardVariableEnumItemInput
- type DashboardVariableInput
- type DashboardVariableNRQLQuery
- type DashboardVariableNRQLQueryInput
- type DashboardVariableOptions
- type DashboardVariableOptionsInput
- type DashboardVariableReplacementStrategy
- type DashboardVariableType
- type DashboardWidget
- type DashboardWidgetColorOverrides
- type DashboardWidgetColors
- type DashboardWidgetConfigurationInput
- type DashboardWidgetData
- type DashboardWidgetDataCompareWith
- type DashboardWidgetDataCompareWithPresentation
- type DashboardWidgetDataFormat
- type DashboardWidgetDataMetric
- type DashboardWidgetFacet
- type DashboardWidgetInitialSorting
- type DashboardWidgetInput
- type DashboardWidgetLayout
- type DashboardWidgetLayoutInput
- type DashboardWidgetLegend
- type DashboardWidgetNRQLQueryInput
- type DashboardWidgetNullValueOverrides
- type DashboardWidgetNullValues
- type DashboardWidgetPresentation
- type DashboardWidgetRefreshRate
- type DashboardWidgetThreshold
- type DashboardWidgetUnitOverrides
- type DashboardWidgetUnits
- type DashboardWidgetVisualizationInput
- type DashboardWidgetYAxisLeft
- type DashboardWidgetYAxisRight
- type DashboardWidgetYAxisRightSeries
- type DashboardWidgetYAxisRightSeriesName
- type Dashboards
- func (a *Dashboards) DashboardCreate(accountID int, dashboard DashboardInput) (*DashboardCreateResult, error)
- func (a *Dashboards) DashboardCreateWithContext(ctx context.Context, accountID int, dashboard DashboardInput) (*DashboardCreateResult, error)
- func (a *Dashboards) DashboardDelete(gUID common.EntityGUID) (*DashboardDeleteResult, error)
- func (a *Dashboards) DashboardDeleteWithContext(ctx context.Context, gUID common.EntityGUID) (*DashboardDeleteResult, error)
- func (a *Dashboards) DashboardUpdate(dashboard DashboardInput, gUID common.EntityGUID) (*DashboardUpdateResult, error)
- func (a *Dashboards) DashboardUpdateWithContext(ctx context.Context, dashboard DashboardInput, gUID common.EntityGUID) (*DashboardUpdateResult, error)
- func (d *Dashboards) GetDashboardEntity(gUID common.EntityGUID) (*entities.DashboardEntity, error)
- func (d *Dashboards) GetDashboardEntityWithContext(ctx context.Context, gUID common.EntityGUID) (*entities.DashboardEntity, error)
- type EditableType
- type GridColumnCountType
- type RawConfiguration
- type RawConfigurationPlatformOptions
- type VisibilityType
- type VisualizationType
Constants ¶
const DashboardCreateMutation = `` /* 33324-byte string literal not displayed */
const DashboardDeleteMutation = `mutation(
$guid: EntityGuid!,
) { dashboardDelete(
guid: $guid,
) {
errors {
description
type
}
status
} }`
const DashboardUpdateMutation = `` /* 33316-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 DashboardLineTableWidgetsAlertSeverityTypes = struct { SUCCESS DashboardLineTableWidgetsAlertSeverity WARNING DashboardLineTableWidgetsAlertSeverity UNAVAILABLE DashboardLineTableWidgetsAlertSeverity SEVERE DashboardLineTableWidgetsAlertSeverity CRITICAL DashboardLineTableWidgetsAlertSeverity }{ SUCCESS: "success", WARNING: "warning", UNAVAILABLE: "unavailable", SEVERE: "severe", CRITICAL: "critical", }
var DashboardLiveURLTypeTypes = struct { // Dashboard. DASHBOARD DashboardLiveURLType // Widget. WIDGET DashboardLiveURLType }{ DASHBOARD: "DASHBOARD", WIDGET: "WIDGET", }
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 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", }
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", }
var DashboardVariableReplacementStrategyTypes = struct { // Replace the variable based on its automatically-inferred type. DEFAULT DashboardVariableReplacementStrategy // Replace the variable value as an identifier. IDENTIFIER DashboardVariableReplacementStrategy // Replace the variable value as a number. NUMBER DashboardVariableReplacementStrategy // Replace the variable value as a string. STRING DashboardVariableReplacementStrategy }{ DEFAULT: "DEFAULT", IDENTIFIER: "IDENTIFIER", NUMBER: "NUMBER", STRING: "STRING", }
var DashboardVariableTypeTypes = struct { // Value comes from an enumerated list of possible values. ENUM DashboardVariableType // Value comes from the results of a NRQL query. NRQL DashboardVariableType // Dashboard user can supply an arbitrary string value to variable. STRING DashboardVariableType }{ ENUM: "ENUM", NRQL: "NRQL", STRING: "STRING", }
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 ¶
type DashboardAreaWidgetConfigurationInput struct { // NRQL queries. NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` }
DashboardAreaWidgetConfigurationInput - Configuration for visualization type 'viz.area'
type DashboardBarWidgetConfigurationInput ¶
type DashboardBarWidgetConfigurationInput struct { // NRQL queries. NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` }
DashboardBarWidgetConfigurationInput - Configuration for visualization type 'viz.bar'. Learn more about [bar](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#bar) widget.
type DashboardBillboardWidgetConfigurationInput ¶
type DashboardBillboardWidgetConfigurationInput struct { // NRQL queries. NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` // Array of thresholds to categorize the results of the query in different groups. Thresholds []DashboardBillboardWidgetThresholdInput `json:"thresholds,omitempty"` }
DashboardBillboardWidgetConfigurationInput - Configuration for visualization type 'viz.billboard'. Learn more about [billboard](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#billboard) widget.
type DashboardBillboardWidgetThresholdInput ¶
type DashboardBillboardWidgetThresholdInput struct { // alert severity. AlertSeverity entities.DashboardAlertSeverity `json:"alertSeverity,omitempty"` // value. Value *float64 `json:"value,omitempty"` }
type DashboardCreateError ¶
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 ¶
type DashboardCreateErrorType string
DashboardCreateErrorType - Expected error types that can be returned by create operation.
type DashboardCreateQueryResponse ¶
type DashboardCreateQueryResponse struct {
DashboardCreateResult DashboardCreateResult `json:"DashboardCreate"`
}
type DashboardCreateResult ¶
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 ¶
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 ¶
type DashboardDeleteErrorType string
DashboardDeleteErrorType - Expected error types that can be returned by delete operation.
type DashboardDeleteQueryResponse ¶
type DashboardDeleteQueryResponse struct {
DashboardDeleteResult DashboardDeleteResult `json:"DashboardDelete"`
}
type DashboardDeleteResult ¶
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 ¶
type DashboardDeleteResultStatus string
DashboardDeleteResultStatus - Result status of delete operation.
type DashboardEntityResult ¶
type DashboardEntityResult struct { // The New Relic account where the dashboard is created. AccountID int `json:"accountId,omitempty"` // Dashboard creation timestamp. CreatedAt nrtime.DateTime `json:"createdAt,omitempty"` // Brief text describing the dashboard. Description string `json:"description,omitempty"` // Unique entity identifier. GUID common.EntityGUID `json:"guid,omitempty"` // The name of the dashboard. Name string `json:"name,omitempty"` // Information of the user that owns the dashboard. Owner entities.DashboardOwnerInfo `json:"owner,omitempty"` // A nested block of all pages belonging to the dashboard. Pages []entities.DashboardPage `json:"pages,omitempty"` // Dashboard permissions configuration. Permissions entities.DashboardPermissions `json:"permissions,omitempty"` // Dashboard update timestamp. UpdatedAt nrtime.DateTime `json:"updatedAt,omitempty"` // Dashboard-local variable definitions. Variables []entities.DashboardVariable `json:"variables,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 ¶
type DashboardIconType string
DashboardIconType represents an option for the dashboard's icon field.
type DashboardInput ¶
type DashboardInput struct { // Brief text describing the dashboard. Description string `json:"description,omitempty"` // The name of the dashboard. Name string `json:"name"` // A nested block of all pages belonging to the dashboard. Pages []DashboardPageInput `json:"pages,omitempty"` // Permissions to set level of visibility & editing. Permissions entities.DashboardPermissions `json:"permissions"` // Dashboard-local variable definitions. Variables []DashboardVariableInput `json:"variables,omitempty"` }
DashboardInput - Dashboard input.
type DashboardLineTableWidgetsAlertSeverity ¶ added in v2.36.0
type DashboardLineTableWidgetsAlertSeverity string
type DashboardLineWidgetConfigurationInput ¶
type DashboardLineWidgetConfigurationInput struct { // NRQL queries. NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` }
DashboardLineWidgetConfigurationInput - Configuration for visualization type 'viz.line'. Learn more about [line](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#line) widget.
type DashboardLineWidgetThresholdInput ¶ added in v2.36.0
type DashboardLineWidgetThresholdInput struct { IsLabelVisible *bool `json:"isLabelVisible,omitempty"` Thresholds []DashboardLineWidgetThresholdThresholdInput `json:"thresholds,omitempty"` }
type DashboardLineWidgetThresholdThresholdInput ¶ added in v2.36.0
type DashboardLineWidgetThresholdThresholdInput struct { From string `json:"from,omitempty"` To string `json:"to,omitempty"` Name string `json:"name,omitempty"` Severity DashboardLineTableWidgetsAlertSeverity `json:"severity,omitempty"` }
type DashboardLiveURL ¶ added in v2.27.0
type DashboardLiveURL struct { // Creation date. CreatedAt nrtime.EpochMilliseconds `json:"createdAt,omitempty"` // Title that describes the source entity that is accessible through the public live URL. Title string `json:"title,omitempty"` // Live URL type. Type DashboardLiveURLType `json:"type,omitempty"` // Public URL. URL string `json:"url"` // The unique identifier of the public live URL. Uuid string `json:"uuid"` }
DashboardLiveURL - Live URL.
type DashboardLiveURLType ¶ added in v2.27.0
type DashboardLiveURLType string
DashboardLiveURLType - Live URL type.
type DashboardMarkdownWidgetConfigurationInput ¶
type DashboardMarkdownWidgetConfigurationInput struct { // Markdown content of the widget. Text string `json:"text"` }
DashboardMarkdownWidgetConfigurationInput - Configuration for visualization type 'viz.markdown'. Learn more about [markdown](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#markdown) widget.
type DashboardMetadata ¶
type DashboardMetadata struct {
Version int `json:"version"`
}
DashboardMetadata represents metadata about the dashboard (like version)
type DashboardPageInput ¶
type DashboardPageInput struct { // Brief text describing the page. 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"` // The name of the page. Name string `json:"name"` // A nested block of all widgets belonging to the page. Widgets []DashboardWidgetInput `json:"widgets"` }
DashboardPageInput - Page input.
type DashboardPieWidgetConfigurationInput ¶
type DashboardPieWidgetConfigurationInput struct { // NRQL queries. NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` }
DashboardPieWidgetConfigurationInput - Configuration for visualization type 'viz.pie'. Learn more about [pie](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#pie) widget.
type DashboardSnapshotURLInput ¶
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 ¶
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 ¶
type DashboardTableWidgetConfigurationInput struct { // NRQL queries. NRQLQueries []DashboardWidgetNRQLQueryInput `json:"nrqlQueries,omitempty"` }
DashboardTableWidgetConfigurationInput - Configuration for visualization type 'viz.table'. Learn more about [table](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#table) widget.
type DashboardTableWidgetThresholdInput ¶ added in v2.36.0
type DashboardTableWidgetThresholdInput struct { From string `json:"from,omitempty"` To string `json:"to,omitempty"` ColumnName string `json:"columnName,omitempty"` Severity DashboardLineTableWidgetsAlertSeverity `json:"severity,omitempty"` }
type DashboardUpdateError ¶
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 ¶
type DashboardUpdateErrorType string
DashboardUpdateErrorType - Expected error types that can be returned by update operation.
type DashboardUpdatePageError ¶
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 ¶
type DashboardUpdatePageErrorType string
DashboardUpdatePageErrorType - Expected error types that can be returned by updatePage operation.
type DashboardUpdatePageInput ¶
type DashboardUpdatePageInput struct { // Page description. Description string `json:"description,omitempty"` // Page name. Name string `json:"name"` // Page widgets. Widgets []DashboardWidgetInput `json:"widgets"` }
DashboardUpdatePageInput - Page input used when updating an individual page.
type DashboardUpdatePageResult ¶
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 ¶
type DashboardUpdateQueryResponse struct {
DashboardUpdateResult DashboardUpdateResult `json:"DashboardUpdate"`
}
type DashboardUpdateResult ¶
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 ¶
type DashboardUpdateWidgetInput struct { // Typed widgets are area, bar, billboard, line, markdown, pie, and table. Check our [docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#widget-typed) for more info. Configuration DashboardWidgetConfigurationInput `json:"configuration,omitempty"` // ID of the widget to be updated. ID string `json:"id"` // The widget's position and size in the dashboard. Layout DashboardWidgetLayoutInput `json:"layout,omitempty"` // Entities related to the widget. Currently only supports one Dashboard entity guid, but may allow other cases in the future. LinkedEntityGUIDs []common.EntityGUID `json:"linkedEntityGuids"` // Untyped widgets are all other widgets, such as bullet, histogram, inventory, etc. Check our [docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#widget-untyped) for more info. RawConfiguration entities.DashboardWidgetRawConfiguration `json:"rawConfiguration,omitempty"` // A title for the widget. 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 ¶
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 ¶
type DashboardUpdateWidgetsInPageErrorType string
DashboardUpdateWidgetsInPageErrorType - Expected error types that can be returned by updateWidgetsInPage operation.
type DashboardUpdateWidgetsInPageResult ¶
type DashboardUpdateWidgetsInPageResult struct { // Expected errors while processing request. No errors means successful request. Errors []DashboardUpdateWidgetsInPageError `json:"errors,omitempty"` }
DashboardUpdateWidgetsInPageResult - Result of updateWidgetsInPage operation.
type DashboardVariable ¶ added in v2.5.0
type DashboardVariable struct { // [DEPRECATED] Default value for this variable. The actual value to be used will depend on the type. DefaultValue DashboardVariableDefaultValue `json:"defaultValue,omitempty"` // Default values for this variable. The actual value to be used will depend on the type. DefaultValues []DashboardVariableDefaultItem `json:"defaultValues,omitempty"` // Indicates whether this variable supports multiple selection or not. Only applies to variables of type NRQL or ENUM. IsMultiSelection bool `json:"isMultiSelection,omitempty"` // List of possible values for variables of type ENUM. Items []DashboardVariableEnumItem `json:"items,omitempty"` // Configuration for variables of type NRQL. NRQLQuery DashboardVariableNRQLQuery `json:"nrqlQuery,omitempty"` // Variable identifier. Name string `json:"name,omitempty"` // Options applied to the variable. Options DashboardVariableOptions `json:"options,omitempty"` // Indicates the strategy to apply when replacing a variable in a NRQL query. ReplacementStrategy DashboardVariableReplacementStrategy `json:"replacementStrategy,omitempty"` // Human-friendly display string for this variable. Title string `json:"title,omitempty"` // Specifies the data type of the variable and where its possible values may come from. Type DashboardVariableType `json:"type,omitempty"` }
DashboardVariable - Definition of a variable that is local to this dashboard. Variables are placeholders for dynamic values in widget NRQLs.
type DashboardVariableDefaultItem ¶ added in v2.5.0
type DashboardVariableDefaultItem struct { // The value of this default item. Value DashboardVariableDefaultValue `json:"value,omitempty"` }
DashboardVariableDefaultItem - Represents a possible default value item.
type DashboardVariableDefaultItemInput ¶ added in v2.5.0
type DashboardVariableDefaultItemInput struct { // The value of this default item. Value DashboardVariableDefaultValueInput `json:"value,omitempty"` }
DashboardVariableDefaultItemInput - Represents a possible default value item.
type DashboardVariableDefaultValue ¶ added in v2.5.0
type DashboardVariableDefaultValue struct { // Default string value. String string `json:"string,omitempty"` }
DashboardVariableDefaultValue - Specifies a default value for variables.
type DashboardVariableDefaultValueInput ¶ added in v2.5.0
type DashboardVariableDefaultValueInput struct { // Default string value. String string `json:"string,omitempty"` }
DashboardVariableDefaultValueInput - Specifies a default value for variables.
type DashboardVariableEnumItem ¶ added in v2.5.0
type DashboardVariableEnumItem struct { // A human-friendly display string for this value. Title string `json:"title,omitempty"` // A possible variable value. Value string `json:"value,omitempty"` }
DashboardVariableEnumItem - Represents a possible value for a variable of type ENUM.
type DashboardVariableEnumItemInput ¶ added in v2.5.0
type DashboardVariableEnumItemInput struct { // A human-friendly display string for this value. Title string `json:"title,omitempty"` // A possible variable value Value string `json:"value"` }
DashboardVariableEnumItemInput - Input type that represents a possible value for a variable of type ENUM.
type DashboardVariableInput ¶ added in v2.5.0
type DashboardVariableInput struct { // [DEPRECATED] Default value for this variable. The actual value to be used will depend on the type. DefaultValue *DashboardVariableDefaultValueInput `json:"defaultValue,omitempty"` // Default values for this variable. The actual value to be used will depend on the type. DefaultValues *[]DashboardVariableDefaultItemInput `json:"defaultValues,omitempty"` // Indicates whether this variable supports multiple selection or not. Only applies to variables of type NRQL or ENUM. IsMultiSelection bool `json:"isMultiSelection,omitempty"` // List of possible values for variables of type ENUM Items []DashboardVariableEnumItemInput `json:"items,omitempty"` // Configuration for variables of type NRQL. NRQLQuery *DashboardVariableNRQLQueryInput `json:"nrqlQuery,omitempty"` // Variable identifier. Name string `json:"name"` // Options applied to the variable Options *DashboardVariableOptionsInput `json:"options,omitempty"` // Indicates the strategy to apply when replacing a variable in a NRQL query. ReplacementStrategy DashboardVariableReplacementStrategy `json:"replacementStrategy,omitempty"` // Human-friendly display string for this variable. Title string `json:"title,omitempty"` // Specifies the data type of the variable and where its possible values may come from. Type DashboardVariableType `json:"type"` }
DashboardVariableInput - Definition of a variable that is local to this dashboard. Variables are placeholders for dynamic values in widget NRQLs.
type DashboardVariableNRQLQuery ¶ added in v2.5.0
type DashboardVariableNRQLQuery struct { // New Relic account ID(s) to issue the query against. AccountIDs []int `json:"accountIds,omitempty"` // NRQL formatted query. Query nrdb.NRQL `json:"query"` }
DashboardVariableNRQLQuery - Configuration for variables of type NRQL.
type DashboardVariableNRQLQueryInput ¶ added in v2.5.0
type DashboardVariableNRQLQueryInput struct { // New Relic account ID(s) to issue the query against. AccountIDs []int `json:"accountIds"` // NRQL formatted query. Query nrdb.NRQL `json:"query"` }
DashboardVariableNRQLQueryInput - Configuration for variables of type NRQL.
type DashboardVariableOptions ¶ added in v2.27.0
type DashboardVariableOptions struct { // Only applies to variables of type NRQL. With this turned on, the time range for the NRQL query will override the time picker on dashboards and other pages. Turn this off to use the time picker as normal. IgnoreTimeRange bool `json:"ignoreTimeRange,omitempty"` }
DashboardVariableOptions - Options applied to the variable.
type DashboardVariableOptionsInput ¶ added in v2.27.0
type DashboardVariableOptionsInput struct { // Only applies to variables of type NRQL. With this turned on, the time range for the NRQL query will override the time picker on dashboards and other pages. Turn this off to use the time picker as normal. IgnoreTimeRange bool `json:"ignoreTimeRange"` }
DashboardVariableOptionsInput - Options applied to the variable
type DashboardVariableReplacementStrategy ¶ added in v2.5.0
type DashboardVariableReplacementStrategy string
DashboardVariableReplacementStrategy - Possible strategies when replacing variables in a NRQL query.
type DashboardVariableType ¶ added in v2.5.0
type DashboardVariableType string
DashboardVariableType - Indicates where a variable's possible values may come from.
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 DashboardWidgetColorOverrides ¶ added in v2.15.1
type DashboardWidgetColors ¶ added in v2.15.1
type DashboardWidgetColors struct { Color string `json:"color,omitempty"` SeriesOverrides []DashboardWidgetColorOverrides `json:"seriesOverrides,omitempty"` }
type DashboardWidgetConfigurationInput ¶
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 DashboardWidgetDataFormat ¶ added in v2.46.0
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 DashboardWidgetFacet ¶ added in v2.15.1
type DashboardWidgetFacet struct {
ShowOtherSeries bool `json:"showOtherSeries,omitempty"`
}
type DashboardWidgetInitialSorting ¶ added in v2.44.0
type DashboardWidgetInput ¶
type DashboardWidgetInput struct { // Typed widgets are area, bar, billboard, line, markdown, pie, and table. Check our [docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#widget-typed) for more info. 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"` // The widget's position and size in the dashboard. Layout DashboardWidgetLayoutInput `json:"layout,omitempty"` // Entities related to the widget. Currently only supports one Dashboard entity guid, but may allow other cases in the future. LinkedEntityGUIDs []common.EntityGUID `json:"linkedEntityGuids"` // Untyped widgets are all other widgets, such as bullet, histogram, inventory, etc. Check our [docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#widget-untyped) for more info. RawConfiguration entities.DashboardWidgetRawConfiguration `json:"rawConfiguration,omitempty"` // A title for the widget. 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 ¶
type DashboardWidgetLayoutInput struct { // Column position of widget from top left, starting at 1. Column int `json:"column,omitempty"` // Height of the widget. Valid values are 1 to 12 inclusive. Defaults to 3. Height int `json:"height,omitempty"` // Row position of widget from top left, starting at 1. Row int `json:"row,omitempty"` // Width of the widget. Valid values are 1 to 12 inclusive. Defaults to 4. Width int `json:"width,omitempty"` }
DashboardWidgetLayoutInput - Widget layout input.
type DashboardWidgetLegend ¶ added in v2.15.1
type DashboardWidgetLegend struct {
Enabled *bool `json:"enabled,omitempty"`
}
type DashboardWidgetNRQLQueryInput ¶
type DashboardWidgetNRQLQueryInput struct { // New Relic account ID to issue the query against. AccountID int `json:"accountId"` // NRQL formatted query. Query nrdb.NRQL `json:"query"` }
DashboardWidgetNRQLQueryInput - NRQL query used by a widget.
type DashboardWidgetNullValueOverrides ¶ added in v2.15.1
type DashboardWidgetNullValues ¶ added in v2.15.1
type DashboardWidgetNullValues struct { NullValue string `json:"nullValue,omitempty"` SeriesOverrides []DashboardWidgetNullValueOverrides `json:"seriesOverrides,omitempty"` }
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 DashboardWidgetRefreshRate ¶ added in v2.44.0
type DashboardWidgetRefreshRate struct {
Frequency interface{} `json:"frequency,omitempty"`
}
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 DashboardWidgetUnitOverrides ¶ added in v2.15.1
type DashboardWidgetUnits ¶ added in v2.15.1
type DashboardWidgetUnits struct { Unit string `json:"unit,omitempty"` SeriesOverrides []DashboardWidgetUnitOverrides `json:"seriesOverrides,omitempty"` }
type DashboardWidgetVisualizationInput ¶
type DashboardWidgetVisualizationInput struct { // This field can either have a known type like `viz.area` or `<nerdpack-id>.<visualization-id>` in the case of [custom visualizations](https://developer.newrelic.com/explore-docs/custom-viz/build-visualization/). Check out [docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/create-widgets-dashboards-api/#widget-schema) for more info. ID string `json:"id,omitempty"` }
DashboardWidgetVisualizationInput - Visualization configuration.
type DashboardWidgetYAxisLeft ¶ added in v2.15.1
type DashboardWidgetYAxisRight ¶ added in v2.36.0
type DashboardWidgetYAxisRight struct { Max float64 `json:"max,omitempty"` Min *float64 `json:"min,omitempty"` Zero *bool `json:"zero,omitempty"` Series []DashboardWidgetYAxisRightSeries `json:"series,omitempty"` }
type DashboardWidgetYAxisRightSeries ¶ added in v2.36.0
type DashboardWidgetYAxisRightSeries struct {
Name DashboardWidgetYAxisRightSeriesName `json:"name,omitempty"`
}
type DashboardWidgetYAxisRightSeriesName ¶ added in v2.36.0
type DashboardWidgetYAxisRightSeriesName string
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 ¶
func (a *Dashboards) DashboardCreate( accountID int, dashboard DashboardInput, ) (*DashboardCreateResult, error)
Create a `DashboardEntity`
func (*Dashboards) DashboardCreateWithContext ¶
func (a *Dashboards) DashboardCreateWithContext( ctx context.Context, accountID int, dashboard DashboardInput, ) (*DashboardCreateResult, error)
Create a `DashboardEntity`
func (*Dashboards) DashboardDelete ¶
func (a *Dashboards) DashboardDelete( gUID common.EntityGUID, ) (*DashboardDeleteResult, error)
Delete an existing `DashboardEntity`
func (*Dashboards) DashboardDeleteWithContext ¶
func (a *Dashboards) DashboardDeleteWithContext( ctx context.Context, gUID common.EntityGUID, ) (*DashboardDeleteResult, error)
Delete an existing `DashboardEntity`
func (*Dashboards) DashboardUpdate ¶
func (a *Dashboards) DashboardUpdate( dashboard DashboardInput, gUID common.EntityGUID, ) (*DashboardUpdateResult, error)
Update an existing `DashboardEntity`
func (*Dashboards) DashboardUpdateWithContext ¶
func (a *Dashboards) DashboardUpdateWithContext( ctx context.Context, dashboard DashboardInput, gUID common.EntityGUID, ) (*DashboardUpdateResult, error)
Update an existing `DashboardEntity`
func (*Dashboards) GetDashboardEntity ¶
func (d *Dashboards) GetDashboardEntity(gUID common.EntityGUID) (*entities.DashboardEntity, error)
GetDashboardEntity is used to retrieve a single New Relic One Dashboard
func (*Dashboards) GetDashboardEntityWithContext ¶
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 ¶
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 ¶
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"` Thresholds interface{} `json:"thresholds,omitempty"` Legend *DashboardWidgetLegend `json:"legend,omitempty"` YAxisLeft *DashboardWidgetYAxisLeft `json:"yAxisLeft,omitempty"` YAxisRight *DashboardWidgetYAxisRight `json:"yAxisRight,omitempty"` NullValues *DashboardWidgetNullValues `json:"nullValues,omitempty"` Units *DashboardWidgetUnits `json:"units,omitempty"` Colors *DashboardWidgetColors `json:"colors,omitempty"` Facet *DashboardWidgetFacet `json:"facet,omitempty"` RefreshRate *DashboardWidgetRefreshRate `json:"refreshRate,omitempty"` InitialSorting *DashboardWidgetInitialSorting `json:"initialSorting,omitempty"` DataFormat []*DashboardWidgetDataFormat `json:"dataFormatters,omitempty"` }
RawConfiguration represents the configuration for widgets, it's a replacement for configuration field
type RawConfigurationPlatformOptions ¶
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 ¶
type VisualizationType string
VisualizationType represents an option for adashboard widget's type.