Update a widget by its UUID for a given experience type. This performs a full replacement of the widget definition.
This endpoint requires
any
of the following permissions:
cloud_cost_management_write
generate_log_reports
manage_log_reports
product_analytics_saved_widgets_write
引数
パスパラメーター
名前
種類
説明
experience_type [required]
string
The experience type for the widget.
uuid [required]
string
The UUID of the widget.
リクエスト
Body Data (required)
Widget request body. The definition object’s required fields vary
by widget.definition.type; see CreateWidget above for a complete
worked payload. Update is a full replacement of the widget definition.
The definition of a widget, including its type and configuration.
title [required]
string
The display title of the widget.
type [required]
enum
Widget types that are allowed to be stored as individual records.
This is not a complete list of dashboard and notebook widget types.
Allowed enum values: bar_chart,change,cloud_cost_summary,cohort,funnel,geomap,list_stream,query_table,query_value,retention_curveShow 5 more,sankey,sunburst,timeseries,toplist,treemap
ISO 8601 timestamp of when the widget was created.
definition [required]
object
The definition of a widget, including its type and configuration.
title [required]
string
The display title of the widget.
type [required]
enum
Widget types that are allowed to be stored as individual records.
This is not a complete list of dashboard and notebook widget types.
Allowed enum values: bar_chart,change,cloud_cost_summary,cohort,funnel,geomap,list_stream,query_table,query_value,retention_curveShow 5 more,sankey,sunburst,timeseries,toplist,treemap
is_favorited [required]
boolean
Whether the current user has favorited this widget. Populated on get,
batch_get, update, and search responses; create responses always return
false because a widget can only be favorited after it exists.
Favoriting itself is performed through the shared favorites API, not
this service.
modified_at [required]
string
ISO 8601 timestamp of when the widget was last modified.
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update a widget returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.WidgetsApi(configuration);constparams: v2.WidgetsApiUpdateWidgetRequest={body:{data:{attributes:{definition:{title:"My Widget",type:"bar_chart",},tags:[],},type:"widgets",},},experienceType:"ccm_reports",uuid:"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",};apiInstance.updateWidget(params).then((data: v2.WidgetResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));