Partially update a secure embed configuration. All fields are optional (PATCH semantics).
This endpoint requires the dashboards_embed_share permission.
OAuth apps require the dashboards_embed_share authorization scope to access this endpoint.
"""
Update a secure embed for a dashboard returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.dashboard_secure_embed_apiimportDashboardSecureEmbedApifromdatadog_api_client.v2.model.secure_embed_global_timeimportSecureEmbedGlobalTimefromdatadog_api_client.v2.model.secure_embed_global_time_live_spanimportSecureEmbedGlobalTimeLiveSpanfromdatadog_api_client.v2.model.secure_embed_selectable_template_variableimportSecureEmbedSelectableTemplateVariablefromdatadog_api_client.v2.model.secure_embed_statusimportSecureEmbedStatusfromdatadog_api_client.v2.model.secure_embed_update_requestimportSecureEmbedUpdateRequestfromdatadog_api_client.v2.model.secure_embed_update_request_attributesimportSecureEmbedUpdateRequestAttributesfromdatadog_api_client.v2.model.secure_embed_update_request_dataimportSecureEmbedUpdateRequestDatafromdatadog_api_client.v2.model.secure_embed_update_request_typeimportSecureEmbedUpdateRequestTypefromdatadog_api_client.v2.model.secure_embed_viewing_preferencesimportSecureEmbedViewingPreferencesfromdatadog_api_client.v2.model.secure_embed_viewing_preferences_themeimportSecureEmbedViewingPreferencesThemebody=SecureEmbedUpdateRequest(data=SecureEmbedUpdateRequestData(attributes=SecureEmbedUpdateRequestAttributes(global_time=SecureEmbedGlobalTime(live_span=SecureEmbedGlobalTimeLiveSpan.PAST_ONE_HOUR,),global_time_selectable=True,selectable_template_vars=[SecureEmbedSelectableTemplateVariable(default_values=["1",],name="org_id",prefix="org_id",visible_tags=["1",],),],status=SecureEmbedStatus.ACTIVE,title="Q1 Metrics Dashboard (Updated)",viewing_preferences=SecureEmbedViewingPreferences(high_density=False,theme=SecureEmbedViewingPreferencesTheme.SYSTEM,),),type=SecureEmbedUpdateRequestType.SECURE_EMBED_UPDATE_REQUEST,),)configuration=Configuration()configuration.unstable_operations["update_dashboard_secure_embed"]=TruewithApiClient(configuration)asapi_client:api_instance=DashboardSecureEmbedApi(api_client)response=api_instance.update_dashboard_secure_embed(dashboard_id="dashboard_id",token="token",body=body)print(response)
# Update a secure embed for a dashboard returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.update_dashboard_secure_embed".to_sym]=trueendapi_instance=DatadogAPIClient::V2::DashboardSecureEmbedAPI.newbody=DatadogAPIClient::V2::SecureEmbedUpdateRequest.new({data:DatadogAPIClient::V2::SecureEmbedUpdateRequestData.new({attributes:DatadogAPIClient::V2::SecureEmbedUpdateRequestAttributes.new({global_time:DatadogAPIClient::V2::SecureEmbedGlobalTime.new({live_span:DatadogAPIClient::V2::SecureEmbedGlobalTimeLiveSpan::PAST_ONE_HOUR,}),global_time_selectable:true,selectable_template_vars:[DatadogAPIClient::V2::SecureEmbedSelectableTemplateVariable.new({default_values:["1",],name:"org_id",prefix:"org_id",visible_tags:["1",],}),],status:DatadogAPIClient::V2::SecureEmbedStatus::ACTIVE,title:"Q1 Metrics Dashboard (Updated)",viewing_preferences:DatadogAPIClient::V2::SecureEmbedViewingPreferences.new({high_density:false,theme:DatadogAPIClient::V2::SecureEmbedViewingPreferencesTheme::SYSTEM,}),}),type:DatadogAPIClient::V2::SecureEmbedUpdateRequestType::SECURE_EMBED_UPDATE_REQUEST,}),})papi_instance.update_dashboard_secure_embed("dashboard_id","token",body)
// Update a secure embed for a dashboard 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")funcmain(){body:=datadogV2.SecureEmbedUpdateRequest{Data:datadogV2.SecureEmbedUpdateRequestData{Attributes:datadogV2.SecureEmbedUpdateRequestAttributes{GlobalTime:&datadogV2.SecureEmbedGlobalTime{LiveSpan:datadogV2.SECUREEMBEDGLOBALTIMELIVESPAN_PAST_ONE_HOUR.Ptr(),},GlobalTimeSelectable:datadog.PtrBool(true),SelectableTemplateVars:[]datadogV2.SecureEmbedSelectableTemplateVariable{{DefaultValues:[]string{"1",},Name:datadog.PtrString("org_id"),Prefix:datadog.PtrString("org_id"),VisibleTags:[]string{"1",},},},Status:datadogV2.SECUREEMBEDSTATUS_ACTIVE.Ptr(),Title:datadog.PtrString("Q1 Metrics Dashboard (Updated)"),ViewingPreferences:&datadogV2.SecureEmbedViewingPreferences{HighDensity:datadog.PtrBool(false),Theme:datadogV2.SECUREEMBEDVIEWINGPREFERENCESTHEME_SYSTEM.Ptr(),},},Type:datadogV2.SECUREEMBEDUPDATEREQUESTTYPE_SECURE_EMBED_UPDATE_REQUEST,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.UpdateDashboardSecureEmbed",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewDashboardSecureEmbedApi(apiClient)resp,r,err:=api.UpdateDashboardSecureEmbed(ctx,"dashboard_id","token",body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DashboardSecureEmbedApi.UpdateDashboardSecureEmbed`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DashboardSecureEmbedApi.UpdateDashboardSecureEmbed`:\n%s\n",responseContent)}
// Update a secure embed for a dashboard returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_dashboard_secure_embed::DashboardSecureEmbedAPI;usedatadog_api_client::datadogV2::model::SecureEmbedGlobalTime;usedatadog_api_client::datadogV2::model::SecureEmbedGlobalTimeLiveSpan;usedatadog_api_client::datadogV2::model::SecureEmbedSelectableTemplateVariable;usedatadog_api_client::datadogV2::model::SecureEmbedStatus;usedatadog_api_client::datadogV2::model::SecureEmbedUpdateRequest;usedatadog_api_client::datadogV2::model::SecureEmbedUpdateRequestAttributes;usedatadog_api_client::datadogV2::model::SecureEmbedUpdateRequestData;usedatadog_api_client::datadogV2::model::SecureEmbedUpdateRequestType;usedatadog_api_client::datadogV2::model::SecureEmbedViewingPreferences;usedatadog_api_client::datadogV2::model::SecureEmbedViewingPreferencesTheme;#[tokio::main]asyncfnmain(){letbody=SecureEmbedUpdateRequest::new(SecureEmbedUpdateRequestData::new(SecureEmbedUpdateRequestAttributes::new().global_time(SecureEmbedGlobalTime::new().live_span(SecureEmbedGlobalTimeLiveSpan::PAST_ONE_HOUR),).global_time_selectable(true).selectable_template_vars(vec![SecureEmbedSelectableTemplateVariable::new().default_values(vec!["1".to_string()]).name("org_id".to_string()).prefix("org_id".to_string()).visible_tags(vec!["1".to_string()])]).status(SecureEmbedStatus::ACTIVE).title("Q1 Metrics Dashboard (Updated)".to_string()).viewing_preferences(SecureEmbedViewingPreferences::new().high_density(false).theme(SecureEmbedViewingPreferencesTheme::SYSTEM),),SecureEmbedUpdateRequestType::SECURE_EMBED_UPDATE_REQUEST,));letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.UpdateDashboardSecureEmbed",true);letapi=DashboardSecureEmbedAPI::with_config(configuration);letresp=api.update_dashboard_secure_embed("dashboard_id".to_string(),"token".to_string(),body).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
/**
* Update a secure embed for a dashboard returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.updateDashboardSecureEmbed"]=true;constapiInstance=newv2.DashboardSecureEmbedApi(configuration);constparams: v2.DashboardSecureEmbedApiUpdateDashboardSecureEmbedRequest={body:{data:{attributes:{globalTime:{liveSpan:"1h",},globalTimeSelectable: true,selectableTemplateVars:[{defaultValues:["1"],name:"org_id",prefix:"org_id",visibleTags:["1"],},],status:"active",title:"Q1 Metrics Dashboard (Updated)",viewingPreferences:{highDensity: false,theme:"system",},},type:"secure_embed_update_request",},},dashboardId:"dashboard_id",token:"token",};apiInstance.updateDashboardSecureEmbed(params).then((data: v2.SecureEmbedUpdateResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));