케이스에 하나 이상의 인사이트를 추가합니다. 인사이트는 조사 컨텍스트를 제공하는 관련 Datadog 리소스(모니터, 보안 시그널, 인시던트 또는 오류 추적 이슈 등)에 대한 참조입니다. 요청당 인사이트를 최대 100개까지 추가할 수 있습니다. 각 인사이트에는 유형(허용되는 값은 CaseInsightType 참조), 참조(리소스에 대한 URL 경로) 및 resource_id가 필요합니다.
OAuth apps require the cases_write authorization scope to access this endpoint.
Data object containing the insights to add or remove.
attributes [required]
object
Attributes for adding or removing insights from a work item.
insights [required]
[object]
Array of insights to add to or remove from a work item.
ref [required]
string
The URL path or deep link to the insight resource within Datadog (for example, /monitors/12345?q=total).
resource_id [required]
string
The unique identifier of the referenced Datadog resource (for example, a monitor ID, incident ID, or signal ID).
type [required]
enum
The type of Datadog resource linked to the work item as contextual evidence. Each type corresponds to a different Datadog product signal (for example, a security finding, a monitor alert, or an incident).
Allowed enum values: SECURITY_SIGNAL,MONITOR,EVENT_CORRELATION,ERROR_TRACKING,CLOUD_COST_RECOMMENDATION,INCIDENT,SENSITIVE_DATA_SCANNER_ISSUE,EVENT,WATCHDOG_STORY,WIDGETShow 6 more,SECURITY_FINDING,INSIGHT_SCORECARD_CAMPAIGN,RESOURCE_POLICY,APM_RECOMMENDATION,SCM_URL,PROFILING_DOWNSIZING_EXPERIMENT
type [required]
enum
JSON:API resource type for work items.
Allowed enum values: case
Key-value pairs of work item attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.
<any-key>
[string]
closed_at
date-time
Timestamp of when the work item was closed
created_at
date-time
Timestamp of when the work item was created
custom_attributes
object
Work item custom attributes
<any-key>
object
A typed value for a custom attribute on a specific work item.
is_multi [required]
boolean
If true, value must be an array
type [required]
enum
The data type of the custom attribute, which determines the allowed values and UI input control.
Allowed enum values: URL,TEXT,NUMBER,SELECT
value [required]
<oneOf>
The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.
Object 1
string
A string value for a TEXT, URL, or SELECT-type custom attribute.
Object 2
[string]
An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.
Object 3
double
A numeric value for a NUMBER-type custom attribute.
Object 4
[number]
An array of numeric values for a multi-value NUMBER-type custom attribute.
description
string
Description
jira_issue
object
Jira issue attached to work item
result
object
Jira issue information
issue_id
string
Jira issue ID
issue_key
string
Jira issue key
issue_url
string
Jira issue URL
project_key
string
Jira project key
status
enum
Work item status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
key
string
Key
modified_at
date-time
Timestamp of when the work item was last modified
priority
enum
Work item priority
Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5
default: NOT_DEFINED
service_now_ticket
object
ServiceNow ticket attached to work item
result
object
ServiceNow ticket information
sys_target_link
string
Link to the Incident created on ServiceNow
status
enum
Work item status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
status
enum
DEPRECATED: Deprecated way of representing the work item status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use status_name instead.
Allowed enum values: OPEN,IN_PROGRESS,CLOSED
status_group
enum
Status group of the work item.
Allowed enum values: SG_OPEN,SG_IN_PROGRESS,SG_CLOSED
status_name
string
Status of the work item. Must be one of the existing statuses for the work item's type.
title
string
Title
type
enum
DEPRECATED: Work item type
Allowed enum values: STANDARD
JSON:API resource type for work items.
Allowed enum values: case
default: case
{"data":{"attributes":{"archived_at":"2019-09-19T10:00:00.000Z","attributes":{"<any-key>":[]},"closed_at":"2019-09-19T10:00:00.000Z","created_at":"2019-09-19T10:00:00.000Z","custom_attributes":{"<any-key>":{"is_multi":false,"type":"NUMBER","value":{"description":"","type":""}}},"description":"string","jira_issue":{"result":{"issue_id":"string","issue_key":"string","issue_url":"string","project_key":"string"},"status":"COMPLETED"},"key":"CASEM-4523","modified_at":"2019-09-19T10:00:00.000Z","priority":"NOT_DEFINED","service_now_ticket":{"result":{"sys_target_link":"string"},"status":"COMPLETED"},"status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"Memory leak investigation on API","type":"STANDARD","type_id":"3b010bde-09ce-4449-b745-71dd5f861963"},"id":"aeadc05e-98a8-11ec-ac2c-da7ad0900001","relationships":{"assignee":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"user"}},"created_by":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"user"}},"modified_by":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"user"}},"project":{"data":{"id":"e555e290-ed65-49bd-ae18-8acbfcf18db7","type":"project"}}},"type":"case"}}
## default
#
# Path parameters exportcase_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504" # Use a Personal Access Token or Service Access Token exportDD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
"""
Add insights to a case returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApifromdatadog_api_client.v2.model.case_insightimportCaseInsightfromdatadog_api_client.v2.model.case_insight_typeimportCaseInsightTypefromdatadog_api_client.v2.model.case_insights_attributesimportCaseInsightsAttributesfromdatadog_api_client.v2.model.case_insights_dataimportCaseInsightsDatafromdatadog_api_client.v2.model.case_insights_requestimportCaseInsightsRequestfromdatadog_api_client.v2.model.case_resource_typeimportCaseResourceTypebody=CaseInsightsRequest(data=CaseInsightsData(attributes=CaseInsightsAttributes(insights=[CaseInsight(ref="/monitors/12345?q=total",resource_id="12345",type=CaseInsightType.SECURITY_SIGNAL,),],),type=CaseResourceType.CASE,),)configuration=Configuration()configuration.access_token=environ["DD_BEARER_TOKEN"]withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)response=api_instance.add_case_insights(case_id="case_id",body=body)print(response)
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"python3"example.py"
# Add insights to a case returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.access_token=ENV["DD_BEARER_TOKEN"]endapi_instance=DatadogAPIClient::V2::CaseManagementAPI.newbody=DatadogAPIClient::V2::CaseInsightsRequest.new({data:DatadogAPIClient::V2::CaseInsightsData.new({attributes:DatadogAPIClient::V2::CaseInsightsAttributes.new({insights:[DatadogAPIClient::V2::CaseInsight.new({ref:"/monitors/12345?q=total",resource_id:"12345",type:DatadogAPIClient::V2::CaseInsightType::SECURITY_SIGNAL,}),],}),type:DatadogAPIClient::V2::CaseResourceType::CASE,}),})papi_instance.add_case_insights("case_id",body)
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"rb"example.rb"
// Add insights to a case 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.CaseInsightsRequest{Data:datadogV2.CaseInsightsData{Attributes:datadogV2.CaseInsightsAttributes{Insights:[]datadogV2.CaseInsight{{Ref:"/monitors/12345?q=total",ResourceId:"12345",Type:datadogV2.CASEINSIGHTTYPE_SECURITY_SIGNAL,},},},Type:datadogV2.CASERESOURCETYPE_CASE,},}ctx:=datadog.NewDefaultContext(context.Background())ctx=context.WithValue(ctx,datadog.ContextAccessToken,os.Getenv("DD_BEARER_TOKEN"))configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCaseManagementApi(apiClient)resp,r,err:=api.AddCaseInsights(ctx,"case_id",body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CaseManagementApi.AddCaseInsights`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CaseManagementApi.AddCaseInsights`:\n%s\n",responseContent)}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"go run"main.go"
// Add insights to a case returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.CaseManagementApi;importcom.datadog.api.client.v2.model.CaseInsight;importcom.datadog.api.client.v2.model.CaseInsightType;importcom.datadog.api.client.v2.model.CaseInsightsAttributes;importcom.datadog.api.client.v2.model.CaseInsightsData;importcom.datadog.api.client.v2.model.CaseInsightsRequest;importcom.datadog.api.client.v2.model.CaseResourceType;importcom.datadog.api.client.v2.model.CaseResponse;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));CaseManagementApiapiInstance=newCaseManagementApi(defaultClient);CaseInsightsRequestbody=newCaseInsightsRequest().data(newCaseInsightsData().attributes(newCaseInsightsAttributes().insights(Collections.singletonList(newCaseInsight().ref("/monitors/12345?q=total").resourceId("12345").type(CaseInsightType.SECURITY_SIGNAL)))).type(CaseResourceType.CASE));try{CaseResponseresult=apiInstance.addCaseInsights("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504",body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CaseManagementApi#addCaseInsights");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"java"Example.java"
// Add insights to a case returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;usedatadog_api_client::datadogV2::model::CaseInsight;usedatadog_api_client::datadogV2::model::CaseInsightType;usedatadog_api_client::datadogV2::model::CaseInsightsAttributes;usedatadog_api_client::datadogV2::model::CaseInsightsData;usedatadog_api_client::datadogV2::model::CaseInsightsRequest;usedatadog_api_client::datadogV2::model::CaseResourceType;#[tokio::main]asyncfnmain(){letbody=CaseInsightsRequest::new(CaseInsightsData::new(CaseInsightsAttributes::new(vec![CaseInsight::new("/monitors/12345?q=total".to_string(),"12345".to_string(),CaseInsightType::SECURITY_SIGNAL,)]),CaseResourceType::CASE,));letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.add_case_insights("case_id".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.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Add insights to a case returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration({authMethods:{AuthZ:{accessToken: process.env.DD_BEARER_TOKENasstring,},},});constapiInstance=newv2.CaseManagementApi(configuration);constparams: v2.CaseManagementApiAddCaseInsightsRequest={body:{data:{attributes:{insights:[{ref:"/monitors/12345?q=total",resourceId:"12345",type:"SECURITY_SIGNAL",},],},type:"case",},},caseId:"case_id",};apiInstance.addCaseInsights(params).then((data: v2.CaseResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"tsc"example.ts"
맞춤형 데모 요청
Datadog 시작하기
Ask AI
AI-generated responses may be inaccurate. Verify important info.