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.
"""
Get a widget returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.widgets_apiimportWidgetsApifromdatadog_api_client.v2.model.widget_experience_typeimportWidgetExperienceTypefromuuidimportUUIDconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=WidgetsApi(api_client)response=api_instance.get_widget(experience_type=WidgetExperienceType.CCM_REPORTS,uuid=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),)print(response)
# Get a widget returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::WidgetsAPI.newpapi_instance.get_widget(WidgetExperienceType::CCM_REPORTS,"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
// Get a widget returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewWidgetsApi(apiClient)resp,r,err:=api.GetWidget(ctx,datadogV2.WIDGETEXPERIENCETYPE_CCM_REPORTS,uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"))iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `WidgetsApi.GetWidget`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `WidgetsApi.GetWidget`:\n%s\n",responseContent)}
// Get a widget returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.WidgetsApi;importcom.datadog.api.client.v2.model.WidgetExperienceType;importcom.datadog.api.client.v2.model.WidgetResponse;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();WidgetsApiapiInstance=newWidgetsApi(defaultClient);try{WidgetResponseresult=apiInstance.getWidget(WidgetExperienceType.CCM_REPORTS,UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"));System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling WidgetsApi#getWidget");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a widget returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_widgets::WidgetsAPI;usedatadog_api_client::datadogV2::model::WidgetExperienceType;useuuid::Uuid;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=WidgetsAPI::with_config(configuration);letresp=api.get_widget(WidgetExperienceType::CCM_REPORTS,Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get a widget returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.WidgetsApi(configuration);constparams: v2.WidgetsApiGetWidgetRequest={experienceType:"ccm_reports",uuid:"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",};apiInstance.getWidget(params).then((data: v2.WidgetResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));