Help us shape the future of Go! Take the 2026 Go Developer Survey

dashboards

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (string, error)

Create creates a new dashboard or copies an existing one.

func Update

func Update(client *golangsdk.ServiceClient, dashboardId string, opts UpdateOpts) error

Update modifies a dashboard.

Types

type BatchDeleteOpts

type BatchDeleteOpts struct {
	// Specifies the list of dashboard IDs to delete.
	// A maximum of 30 dashboard IDs are supported.
	DashboardIds []string `json:"dashboard_ids,omitempty"`
}

BatchDeleteOpts contains the options for batch deleting dashboards.

type BatchDeleteResult

type BatchDeleteResult struct {
	// Specifies the dashboard ID.
	DashboardId string `json:"dashboard_id"`
	// Specifies the deletion result.
	// Possible values: successful, error
	RetStatus string `json:"ret_status"`
	// Specifies the error message if deletion failed.
	ErrorMsg string `json:"error_msg,omitempty"`
}

BatchDeleteResult represents the result of deleting a single dashboard.

func BatchDelete

func BatchDelete(client *golangsdk.ServiceClient, opts BatchDeleteOpts) ([]BatchDeleteResult, error)

BatchDelete batch deletes dashboards.

type CreateOpts

type CreateOpts struct {
	// Specifies the dashboard name.
	// It can contain 1 to 128 characters.
	// Only letters, digits, underscores (_), hyphens (-), and Chinese characters are allowed.
	DashboardName string `json:"dashboard_name" required:"true"`
	// Specifies the enterprise project ID.
	// The value can be a UUID or "0".
	EnterpriseId string `json:"enterprise_id,omitempty"`
	// Specifies the dashboard ID to copy from.
	// If this parameter is specified, the dashboard is copied.
	// The value starts with "db" and is followed by 22 characters.
	DashboardId string `json:"dashboard_id,omitempty"`
	// Specifies how many graphs will be displayed in each row.
	// Possible values: 0, 1, 2, 3. Default: 0
	// 0 indicates auto layout.
	RowWidgetNum *int `json:"row_widget_num,omitempty"`
}

CreateOpts contains the options for creating or copying a dashboard.

type Dashboard

type Dashboard struct {
	// Specifies the dashboard ID.
	DashboardId string `json:"dashboard_id"`
	// Specifies the dashboard name.
	DashboardName string `json:"dashboard_name"`
	// Specifies the enterprise project ID.
	EnterpriseId string `json:"enterprise_id"`
	// Specifies the name of the user who created the dashboard.
	CreatorName string `json:"creator_name"`
	// Specifies the time when the dashboard was created.
	// The value is a UNIX timestamp in milliseconds.
	CreateTime int64 `json:"create_time"`
	// Specifies how many graphs will be displayed in each row.
	// Possible values: 0, 1, 2, 3. Default: 3
	RowWidgetNum int `json:"row_widget_num"`
	// Specifies whether the dashboard is a favorite.
	IsFavorite bool `json:"is_favorite"`
}

Dashboard represents a dashboard in the list response.

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]Dashboard, error)

List queries dashboards.

type ListOpts

type ListOpts struct {
	// Specifies whether to filter by favorite status.
	// This parameter requires enterprise_id to be specified.
	IsFavorite *bool `q:"is_favorite,omitempty"`
	// Specifies the dashboard name for filtering.
	// It can contain 1 to 128 characters.
	DashboardName string `q:"dashboard_name,omitempty"`
	// Specifies the dashboard ID for filtering.
	// The value starts with "db" and is followed by 22 characters.
	DashboardId string `q:"dashboard_id,omitempty"`
	// Specifies the enterprise project ID.
	EnterpriseId string `q:"enterprise_id,omitempty"`
}

ListOpts contains the options for querying dashboards.

type UpdateOpts

type UpdateOpts struct {
	// Specifies the dashboard name.
	// It can contain 1 to 128 characters.
	// Only letters, digits, underscores (_), hyphens (-), and Chinese characters are allowed.
	DashboardName string `json:"dashboard_name,omitempty"`
	// Specifies whether the dashboard is a favorite.
	IsFavorite *bool `json:"is_favorite,omitempty"`
	// Specifies how many graphs will be displayed in each row.
	// Possible values: 0, 1, 2, 3. Default: 3
	// 0 indicates auto layout.
	RowWidgetNum *int `json:"row_widget_num,omitempty"`
}

UpdateOpts contains the options for modifying a dashboard.

Jump to

Keyboard shortcuts

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