Create or update rows in a Reference Table by their primary key values. If a row with the specified primary key exists, it is updated; otherwise, a new row is created.
引数
パスパラメーター
名前
種類
説明
id [required]
string
Unique identifier of the reference table to upsert rows into
# Upsert rows returns "Rows created or updated successfully" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::ReferenceTablesAPI.newbody=DatadogAPIClient::V2::BatchUpsertRowsRequestArray.new({data:[DatadogAPIClient::V2::BatchUpsertRowsRequestData.new({attributes:DatadogAPIClient::V2::BatchUpsertRowsRequestDataAttributes.new({values:{},}),id:"primary_key_value",type:DatadogAPIClient::V2::TableRowResourceDataType::ROW,}),],})papi_instance.upsert_rows("id",body)
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
/**
* Upsert rows returns "Rows created or updated successfully" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.ReferenceTablesApi(configuration);constparams: v2.ReferenceTablesApiUpsertRowsRequest={body:{data:[{attributes:{values:{},},id:"primary_key_value",type:"row",},],},id:"id",};apiInstance.upsertRows(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));