DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create a project returns "CREATED" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);constparams: v2.CaseManagementApiCreateProjectRequest={body:{data:{attributes:{key:"SEC",name:"Security Investigation",},type:"project",},},};apiInstance.createProject(params).then((data: v2.ProjectResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
key
string
Key
modified_at
date-time
Timestamp of when the case was last modified
priority
enum
Case priority
Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5
default: NOT_DEFINED
service_now_ticket
object
ServiceNow ticket attached to case
result
object
ServiceNow ticket information
sys_target_link
string
Link to the Incident created on ServiceNow
status
enum
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
status
enum
Case status
Allowed enum values: OPEN,IN_PROGRESS,CLOSED
title
string
Title
type
enum
Case type
Allowed enum values: STANDARD
id [required]
string
Case's identifier
relationships
object
Resources related to a case
assignee
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
project
object
Relationship to project
data [required]
object
Relationship to project object
id [required]
string
A unique identifier that represents the project
type [required]
enum
Project resource type
Allowed enum values: project
default: project
type [required]
enum
Case resource type
Allowed enum values: case
default: case
meta
object
Cases response metadata
page
object
Pagination metadata
current
int64
Current page number
size
int64
Number of cases in current page
total
int64
Total number of pages
{"data":[{"attributes":{"archived_at":"2019-09-19T10:00:00.000Z","closed_at":"2019-09-19T10:00:00.000Z","created_at":"2019-09-19T10:00:00.000Z","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","title":"Memory leak investigation on API","type":"STANDARD"},"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"}],"meta":{"page":{"current":"integer","size":"integer","total":"integer"}}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Search cases returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);apiInstance.searchCases().then((data: v2.CasesResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Case priority
Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5
default: NOT_DEFINED
title [required]
string
Title
type [required]
enum
Case type
Allowed enum values: STANDARD
relationships
object
Relationships formed with the case on creation
assignee
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
project [required]
object
Relationship to project
data [required]
object
Relationship to project object
id [required]
string
A unique identifier that represents the project
type [required]
enum
Project resource type
Allowed enum values: project
default: project
type [required]
enum
Case resource type
Allowed enum values: case
default: case
{"data":{"attributes":{"priority":"NOT_DEFINED","title":"Security breach investigation in 0cfbc5cbc676ee71","type":"STANDARD"},"relationships":{"assignee":{"data":{"id":"string","type":"user"}},"project":{"data":{"id":"d4bbe1af-f36e-42f1-87c1-493ca35c320e","type":"project"}}},"type":"case"}}
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
key
string
Key
modified_at
date-time
Timestamp of when the case was last modified
priority
enum
Case priority
Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5
default: NOT_DEFINED
service_now_ticket
object
ServiceNow ticket attached to case
result
object
ServiceNow ticket information
sys_target_link
string
Link to the Incident created on ServiceNow
status
enum
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
status
enum
Case status
Allowed enum values: OPEN,IN_PROGRESS,CLOSED
title
string
Title
type
enum
Case type
Allowed enum values: STANDARD
id [required]
string
Case's identifier
relationships
object
Resources related to a case
assignee
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
project
object
Relationship to project
data [required]
object
Relationship to project object
id [required]
string
A unique identifier that represents the project
type [required]
enum
Project resource type
Allowed enum values: project
default: project
type [required]
enum
Case resource type
Allowed enum values: case
default: case
{"data":{"attributes":{"archived_at":"2019-09-19T10:00:00.000Z","closed_at":"2019-09-19T10:00:00.000Z","created_at":"2019-09-19T10:00:00.000Z","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","title":"Memory leak investigation on API","type":"STANDARD"},"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"}}
// Create a case returns "CREATED" response
packagemainimport("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(){// there is a valid "user" in the system
UserDataID:=os.Getenv("USER_DATA_ID")body:=datadogV2.CaseCreateRequest{Data:datadogV2.CaseCreate{Attributes:datadogV2.CaseCreateAttributes{Priority:datadogV2.CASEPRIORITY_NOT_DEFINED.Ptr(),Title:"Security breach investigation in 0cfbc5cbc676ee71",Type:datadogV2.CASETYPE_STANDARD,},Relationships:&datadogV2.CaseCreateRelationships{Assignee:*datadogV2.NewNullableNullableUserRelationship(&datadogV2.NullableUserRelationship{Data:*datadogV2.NewNullableNullableUserRelationshipData(&datadogV2.NullableUserRelationshipData{Id:UserDataID,Type:datadogV2.USERRESOURCETYPE_USER,}),}),Project:datadogV2.ProjectRelationship{Data:datadogV2.ProjectRelationshipData{Id:"d4bbe1af-f36e-42f1-87c1-493ca35c320e",Type:datadogV2.PROJECTRESOURCETYPE_PROJECT,},},},Type:datadogV2.CASERESOURCETYPE_CASE,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCaseManagementApi(apiClient)resp,r,err:=api.CreateCase(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CaseManagementApi.CreateCase`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CaseManagementApi.CreateCase`:\n%s\n",responseContent)}
// Create a case returns "CREATED" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.CaseManagementApi;importcom.datadog.api.client.v2.model.CaseCreate;importcom.datadog.api.client.v2.model.CaseCreateAttributes;importcom.datadog.api.client.v2.model.CaseCreateRelationships;importcom.datadog.api.client.v2.model.CaseCreateRequest;importcom.datadog.api.client.v2.model.CasePriority;importcom.datadog.api.client.v2.model.CaseResourceType;importcom.datadog.api.client.v2.model.CaseResponse;importcom.datadog.api.client.v2.model.CaseType;importcom.datadog.api.client.v2.model.NullableUserRelationship;importcom.datadog.api.client.v2.model.NullableUserRelationshipData;importcom.datadog.api.client.v2.model.ProjectRelationship;importcom.datadog.api.client.v2.model.ProjectRelationshipData;importcom.datadog.api.client.v2.model.ProjectResourceType;importcom.datadog.api.client.v2.model.UserResourceType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();CaseManagementApiapiInstance=newCaseManagementApi(defaultClient);// there is a valid "user" in the systemStringUSER_DATA_ID=System.getenv("USER_DATA_ID");CaseCreateRequestbody=newCaseCreateRequest().data(newCaseCreate().attributes(newCaseCreateAttributes().priority(CasePriority.NOT_DEFINED).title("Security breach investigation in 0cfbc5cbc676ee71").type(CaseType.STANDARD)).relationships(newCaseCreateRelationships().assignee(newNullableUserRelationship().data(newNullableUserRelationshipData().id(USER_DATA_ID).type(UserResourceType.USER))).project(newProjectRelationship().data(newProjectRelationshipData().id("d4bbe1af-f36e-42f1-87c1-493ca35c320e").type(ProjectResourceType.PROJECT)))).type(CaseResourceType.CASE));try{CaseResponseresult=apiInstance.createCase(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CaseManagementApi#createCase");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create a case returns "CREATED" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApifromdatadog_api_client.v2.model.case_createimportCaseCreatefromdatadog_api_client.v2.model.case_create_attributesimportCaseCreateAttributesfromdatadog_api_client.v2.model.case_create_relationshipsimportCaseCreateRelationshipsfromdatadog_api_client.v2.model.case_create_requestimportCaseCreateRequestfromdatadog_api_client.v2.model.case_priorityimportCasePriorityfromdatadog_api_client.v2.model.case_resource_typeimportCaseResourceTypefromdatadog_api_client.v2.model.case_typeimportCaseTypefromdatadog_api_client.v2.model.nullable_user_relationshipimportNullableUserRelationshipfromdatadog_api_client.v2.model.nullable_user_relationship_dataimportNullableUserRelationshipDatafromdatadog_api_client.v2.model.project_relationshipimportProjectRelationshipfromdatadog_api_client.v2.model.project_relationship_dataimportProjectRelationshipDatafromdatadog_api_client.v2.model.project_resource_typeimportProjectResourceTypefromdatadog_api_client.v2.model.user_resource_typeimportUserResourceType# there is a valid "user" in the systemUSER_DATA_ID=environ["USER_DATA_ID"]body=CaseCreateRequest(data=CaseCreate(attributes=CaseCreateAttributes(priority=CasePriority.NOT_DEFINED,title="Security breach investigation in 0cfbc5cbc676ee71",type=CaseType.STANDARD,),relationships=CaseCreateRelationships(assignee=NullableUserRelationship(data=NullableUserRelationshipData(id=USER_DATA_ID,type=UserResourceType.USER,),),project=ProjectRelationship(data=ProjectRelationshipData(id="d4bbe1af-f36e-42f1-87c1-493ca35c320e",type=ProjectResourceType.PROJECT,),),),type=CaseResourceType.CASE,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)response=api_instance.create_case(body=body)print(response)
# Create a case returns "CREATED" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CaseManagementAPI.new# there is a valid "user" in the systemUSER_DATA_ID=ENV["USER_DATA_ID"]body=DatadogAPIClient::V2::CaseCreateRequest.new({data:DatadogAPIClient::V2::CaseCreate.new({attributes:DatadogAPIClient::V2::CaseCreateAttributes.new({priority:DatadogAPIClient::V2::CasePriority::NOT_DEFINED,title:"Security breach investigation in 0cfbc5cbc676ee71",type:DatadogAPIClient::V2::CaseType::STANDARD,}),relationships:DatadogAPIClient::V2::CaseCreateRelationships.new({assignee:DatadogAPIClient::V2::NullableUserRelationship.new({data:DatadogAPIClient::V2::NullableUserRelationshipData.new({id:USER_DATA_ID,type:DatadogAPIClient::V2::UserResourceType::USER,}),}),project:DatadogAPIClient::V2::ProjectRelationship.new({data:DatadogAPIClient::V2::ProjectRelationshipData.new({id:"d4bbe1af-f36e-42f1-87c1-493ca35c320e",type:DatadogAPIClient::V2::ProjectResourceType::PROJECT,}),}),}),type:DatadogAPIClient::V2::CaseResourceType::CASE,}),})papi_instance.create_case(body)
// Create a case returns "CREATED" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;usedatadog_api_client::datadogV2::model::CaseCreate;usedatadog_api_client::datadogV2::model::CaseCreateAttributes;usedatadog_api_client::datadogV2::model::CaseCreateRelationships;usedatadog_api_client::datadogV2::model::CaseCreateRequest;usedatadog_api_client::datadogV2::model::CasePriority;usedatadog_api_client::datadogV2::model::CaseResourceType;usedatadog_api_client::datadogV2::model::CaseType;usedatadog_api_client::datadogV2::model::NullableUserRelationship;usedatadog_api_client::datadogV2::model::NullableUserRelationshipData;usedatadog_api_client::datadogV2::model::ProjectRelationship;usedatadog_api_client::datadogV2::model::ProjectRelationshipData;usedatadog_api_client::datadogV2::model::ProjectResourceType;usedatadog_api_client::datadogV2::model::UserResourceType;#[tokio::main]asyncfnmain(){// there is a valid "user" in the system
letuser_data_id=std::env::var("USER_DATA_ID").unwrap();letbody=CaseCreateRequest::new(CaseCreate::new(CaseCreateAttributes::new("Security breach investigation in 0cfbc5cbc676ee71".to_string(),CaseType::STANDARD,).priority(CasePriority::NOT_DEFINED),CaseResourceType::CASE,).relationships(CaseCreateRelationships::new(ProjectRelationship::new(ProjectRelationshipData::new("d4bbe1af-f36e-42f1-87c1-493ca35c320e".to_string(),ProjectResourceType::PROJECT,))).assignee(Some(NullableUserRelationship::new(Some(NullableUserRelationshipData::new(user_data_id.clone(),UserResourceType::USER),)))),),);letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.create_case(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create a case returns "CREATED" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);// there is a valid "user" in the system
constUSER_DATA_ID=process.env.USER_DATA_IDasstring;constparams: v2.CaseManagementApiCreateCaseRequest={body:{data:{attributes:{priority:"NOT_DEFINED",title:"Security breach investigation in 0cfbc5cbc676ee71",type:"STANDARD",},relationships:{assignee:{data:{id: USER_DATA_ID,type:"user",},},project:{data:{id:"d4bbe1af-f36e-42f1-87c1-493ca35c320e",type:"project",},},},type:"case",},},};apiInstance.createCase(params).then((data: v2.CaseResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get all projects returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)response=api_instance.get_projects()print(response)
# Get all projects returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CaseManagementAPI.newpapi_instance.get_projects()
// Get all projects returns "OK" response
packagemainimport("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(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCaseManagementApi(apiClient)resp,r,err:=api.GetProjects(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CaseManagementApi.GetProjects`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CaseManagementApi.GetProjects`:\n%s\n",responseContent)}
// Get all projects 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.ProjectsResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();CaseManagementApiapiInstance=newCaseManagementApi(defaultClient);try{ProjectsResponseresult=apiInstance.getProjects();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CaseManagementApi#getProjects");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get all projects returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.get_projects().await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get all projects returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);apiInstance.getProjects().then((data: v2.ProjectsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
key
string
Key
modified_at
date-time
Timestamp of when the case was last modified
priority
enum
Case priority
Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5
default: NOT_DEFINED
service_now_ticket
object
ServiceNow ticket attached to case
result
object
ServiceNow ticket information
sys_target_link
string
Link to the Incident created on ServiceNow
status
enum
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
status
enum
Case status
Allowed enum values: OPEN,IN_PROGRESS,CLOSED
title
string
Title
type
enum
Case type
Allowed enum values: STANDARD
id [required]
string
Case's identifier
relationships
object
Resources related to a case
assignee
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
project
object
Relationship to project
data [required]
object
Relationship to project object
id [required]
string
A unique identifier that represents the project
type [required]
enum
Project resource type
Allowed enum values: project
default: project
type [required]
enum
Case resource type
Allowed enum values: case
default: case
{"data":{"attributes":{"archived_at":"2019-09-19T10:00:00.000Z","closed_at":"2019-09-19T10:00:00.000Z","created_at":"2019-09-19T10:00:00.000Z","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","title":"Memory leak investigation on API","type":"STANDARD"},"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"}}
"""
Get the details of a case returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApi# there is a valid "case" in the systemCASE_ID=environ["CASE_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)response=api_instance.get_case(case_id=CASE_ID,)print(response)
# Get the details of a case returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CaseManagementAPI.new# there is a valid "case" in the systemCASE_ID=ENV["CASE_ID"]papi_instance.get_case(CASE_ID)
// Get the details of a case returns "OK" response
packagemainimport("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(){// there is a valid "case" in the system
CaseID:=os.Getenv("CASE_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCaseManagementApi(apiClient)resp,r,err:=api.GetCase(ctx,CaseID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CaseManagementApi.GetCase`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CaseManagementApi.GetCase`:\n%s\n",responseContent)}
// Get the details of 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.CaseResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();CaseManagementApiapiInstance=newCaseManagementApi(defaultClient);// there is a valid "case" in the systemStringCASE_ID=System.getenv("CASE_ID");try{CaseResponseresult=apiInstance.getCase(CASE_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CaseManagementApi#getCase");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get the details of a case returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;#[tokio::main]asyncfnmain(){// there is a valid "case" in the system
letcase_id=std::env::var("CASE_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.get_case(case_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get the details of a case returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);// there is a valid "case" in the system
constCASE_ID=process.env.CASE_IDasstring;constparams: v2.CaseManagementApiGetCaseRequest={caseId: CASE_ID,};apiInstance.getCase(params).then((data: v2.CaseResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get the details of a project returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)response=api_instance.get_project(project_id="project_id",)print(response)
# Get the details of a project returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CaseManagementAPI.newpapi_instance.get_project("project_id")
// Get the details of a project returns "OK" response
packagemainimport("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(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCaseManagementApi(apiClient)resp,r,err:=api.GetProject(ctx,"project_id")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CaseManagementApi.GetProject`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CaseManagementApi.GetProject`:\n%s\n",responseContent)}
// Get the details of a project 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.ProjectResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();CaseManagementApiapiInstance=newCaseManagementApi(defaultClient);try{ProjectResponseresult=apiInstance.getProject("project_id");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CaseManagementApi#getProject");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get the details of a project returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.get_project("project_id".to_string()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get the details of a project returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);constparams: v2.CaseManagementApiGetProjectRequest={projectId:"project_id",};apiInstance.getProject(params).then((data: v2.ProjectResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Remove a project returns "No Content" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)api_instance.delete_project(project_id="project_id",)
# Remove a project returns "No Content" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CaseManagementAPI.newapi_instance.delete_project("project_id")
// Remove a project returns "No Content" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.delete_project("project_id".to_string()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Remove a project returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);constparams: v2.CaseManagementApiDeleteProjectRequest={projectId:"project_id",};apiInstance.deleteProject(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
key
string
Key
modified_at
date-time
Timestamp of when the case was last modified
priority
enum
Case priority
Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5
default: NOT_DEFINED
service_now_ticket
object
ServiceNow ticket attached to case
result
object
ServiceNow ticket information
sys_target_link
string
Link to the Incident created on ServiceNow
status
enum
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
status
enum
Case status
Allowed enum values: OPEN,IN_PROGRESS,CLOSED
title
string
Title
type
enum
Case type
Allowed enum values: STANDARD
id [required]
string
Case's identifier
relationships
object
Resources related to a case
assignee
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
project
object
Relationship to project
data [required]
object
Relationship to project object
id [required]
string
A unique identifier that represents the project
type [required]
enum
Project resource type
Allowed enum values: project
default: project
type [required]
enum
Case resource type
Allowed enum values: case
default: case
{"data":{"attributes":{"archived_at":"2019-09-19T10:00:00.000Z","closed_at":"2019-09-19T10:00:00.000Z","created_at":"2019-09-19T10:00:00.000Z","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","title":"Memory leak investigation on API","type":"STANDARD"},"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"}}
// Update case status returns "OK" response
packagemainimport("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(){// there is a valid "case" in the system
CaseID:=os.Getenv("CASE_ID")body:=datadogV2.CaseUpdateStatusRequest{Data:datadogV2.CaseUpdateStatus{Attributes:datadogV2.CaseUpdateStatusAttributes{Status:datadogV2.CASESTATUS_IN_PROGRESS,},Type:datadogV2.CASERESOURCETYPE_CASE,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCaseManagementApi(apiClient)resp,r,err:=api.UpdateStatus(ctx,CaseID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CaseManagementApi.UpdateStatus`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CaseManagementApi.UpdateStatus`:\n%s\n",responseContent)}
// Update case status 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.CaseResourceType;importcom.datadog.api.client.v2.model.CaseResponse;importcom.datadog.api.client.v2.model.CaseStatus;importcom.datadog.api.client.v2.model.CaseUpdateStatus;importcom.datadog.api.client.v2.model.CaseUpdateStatusAttributes;importcom.datadog.api.client.v2.model.CaseUpdateStatusRequest;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();CaseManagementApiapiInstance=newCaseManagementApi(defaultClient);// there is a valid "case" in the systemStringCASE_ID=System.getenv("CASE_ID");CaseUpdateStatusRequestbody=newCaseUpdateStatusRequest().data(newCaseUpdateStatus().attributes(newCaseUpdateStatusAttributes().status(CaseStatus.IN_PROGRESS)).type(CaseResourceType.CASE));try{CaseResponseresult=apiInstance.updateStatus(CASE_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CaseManagementApi#updateStatus");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update case status returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApifromdatadog_api_client.v2.model.case_resource_typeimportCaseResourceTypefromdatadog_api_client.v2.model.case_statusimportCaseStatusfromdatadog_api_client.v2.model.case_update_statusimportCaseUpdateStatusfromdatadog_api_client.v2.model.case_update_status_attributesimportCaseUpdateStatusAttributesfromdatadog_api_client.v2.model.case_update_status_requestimportCaseUpdateStatusRequest# there is a valid "case" in the systemCASE_ID=environ["CASE_ID"]body=CaseUpdateStatusRequest(data=CaseUpdateStatus(attributes=CaseUpdateStatusAttributes(status=CaseStatus.IN_PROGRESS,),type=CaseResourceType.CASE,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)response=api_instance.update_status(case_id=CASE_ID,body=body)print(response)
# Update case status returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CaseManagementAPI.new# there is a valid "case" in the systemCASE_ID=ENV["CASE_ID"]body=DatadogAPIClient::V2::CaseUpdateStatusRequest.new({data:DatadogAPIClient::V2::CaseUpdateStatus.new({attributes:DatadogAPIClient::V2::CaseUpdateStatusAttributes.new({status:DatadogAPIClient::V2::CaseStatus::IN_PROGRESS,}),type:DatadogAPIClient::V2::CaseResourceType::CASE,}),})papi_instance.update_status(CASE_ID,body)
// Update case status returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;usedatadog_api_client::datadogV2::model::CaseResourceType;usedatadog_api_client::datadogV2::model::CaseStatus;usedatadog_api_client::datadogV2::model::CaseUpdateStatus;usedatadog_api_client::datadogV2::model::CaseUpdateStatusAttributes;usedatadog_api_client::datadogV2::model::CaseUpdateStatusRequest;#[tokio::main]asyncfnmain(){// there is a valid "case" in the system
letcase_id=std::env::var("CASE_ID").unwrap();letbody=CaseUpdateStatusRequest::new(CaseUpdateStatus::new(CaseUpdateStatusAttributes::new(CaseStatus::IN_PROGRESS),CaseResourceType::CASE,));letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.update_status(case_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update case status returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);// there is a valid "case" in the system
constCASE_ID=process.env.CASE_IDasstring;constparams: v2.CaseManagementApiUpdateStatusRequest={body:{data:{attributes:{status:"IN_PROGRESS",},type:"case",},},caseId: CASE_ID,};apiInstance.updateStatus(params).then((data: v2.CaseResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
key
string
Key
modified_at
date-time
Timestamp of when the case was last modified
priority
enum
Case priority
Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5
default: NOT_DEFINED
service_now_ticket
object
ServiceNow ticket attached to case
result
object
ServiceNow ticket information
sys_target_link
string
Link to the Incident created on ServiceNow
status
enum
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
status
enum
Case status
Allowed enum values: OPEN,IN_PROGRESS,CLOSED
title
string
Title
type
enum
Case type
Allowed enum values: STANDARD
id [required]
string
Case's identifier
relationships
object
Resources related to a case
assignee
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
project
object
Relationship to project
data [required]
object
Relationship to project object
id [required]
string
A unique identifier that represents the project
type [required]
enum
Project resource type
Allowed enum values: project
default: project
type [required]
enum
Case resource type
Allowed enum values: case
default: case
{"data":{"attributes":{"archived_at":"2019-09-19T10:00:00.000Z","closed_at":"2019-09-19T10:00:00.000Z","created_at":"2019-09-19T10:00:00.000Z","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","title":"Memory leak investigation on API","type":"STANDARD"},"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"}}
// Update case priority returns "OK" response
packagemainimport("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(){// there is a valid "case" in the system
CaseID:=os.Getenv("CASE_ID")body:=datadogV2.CaseUpdatePriorityRequest{Data:datadogV2.CaseUpdatePriority{Attributes:datadogV2.CaseUpdatePriorityAttributes{Priority:datadogV2.CASEPRIORITY_P3,},Type:datadogV2.CASERESOURCETYPE_CASE,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCaseManagementApi(apiClient)resp,r,err:=api.UpdatePriority(ctx,CaseID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CaseManagementApi.UpdatePriority`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CaseManagementApi.UpdatePriority`:\n%s\n",responseContent)}
// Update case priority 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.CasePriority;importcom.datadog.api.client.v2.model.CaseResourceType;importcom.datadog.api.client.v2.model.CaseResponse;importcom.datadog.api.client.v2.model.CaseUpdatePriority;importcom.datadog.api.client.v2.model.CaseUpdatePriorityAttributes;importcom.datadog.api.client.v2.model.CaseUpdatePriorityRequest;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();CaseManagementApiapiInstance=newCaseManagementApi(defaultClient);// there is a valid "case" in the systemStringCASE_ID=System.getenv("CASE_ID");CaseUpdatePriorityRequestbody=newCaseUpdatePriorityRequest().data(newCaseUpdatePriority().attributes(newCaseUpdatePriorityAttributes().priority(CasePriority.P3)).type(CaseResourceType.CASE));try{CaseResponseresult=apiInstance.updatePriority(CASE_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CaseManagementApi#updatePriority");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update case priority returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApifromdatadog_api_client.v2.model.case_priorityimportCasePriorityfromdatadog_api_client.v2.model.case_resource_typeimportCaseResourceTypefromdatadog_api_client.v2.model.case_update_priorityimportCaseUpdatePriorityfromdatadog_api_client.v2.model.case_update_priority_attributesimportCaseUpdatePriorityAttributesfromdatadog_api_client.v2.model.case_update_priority_requestimportCaseUpdatePriorityRequest# there is a valid "case" in the systemCASE_ID=environ["CASE_ID"]body=CaseUpdatePriorityRequest(data=CaseUpdatePriority(attributes=CaseUpdatePriorityAttributes(priority=CasePriority.P3,),type=CaseResourceType.CASE,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)response=api_instance.update_priority(case_id=CASE_ID,body=body)print(response)
# Update case priority returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CaseManagementAPI.new# there is a valid "case" in the systemCASE_ID=ENV["CASE_ID"]body=DatadogAPIClient::V2::CaseUpdatePriorityRequest.new({data:DatadogAPIClient::V2::CaseUpdatePriority.new({attributes:DatadogAPIClient::V2::CaseUpdatePriorityAttributes.new({priority:DatadogAPIClient::V2::CasePriority::P3,}),type:DatadogAPIClient::V2::CaseResourceType::CASE,}),})papi_instance.update_priority(CASE_ID,body)
// Update case priority returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;usedatadog_api_client::datadogV2::model::CasePriority;usedatadog_api_client::datadogV2::model::CaseResourceType;usedatadog_api_client::datadogV2::model::CaseUpdatePriority;usedatadog_api_client::datadogV2::model::CaseUpdatePriorityAttributes;usedatadog_api_client::datadogV2::model::CaseUpdatePriorityRequest;#[tokio::main]asyncfnmain(){// there is a valid "case" in the system
letcase_id=std::env::var("CASE_ID").unwrap();letbody=CaseUpdatePriorityRequest::new(CaseUpdatePriority::new(CaseUpdatePriorityAttributes::new(CasePriority::P3),CaseResourceType::CASE,));letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.update_priority(case_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Update case priority returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);// there is a valid "case" in the system
constCASE_ID=process.env.CASE_IDasstring;constparams: v2.CaseManagementApiUpdatePriorityRequest={body:{data:{attributes:{priority:"P3",},type:"case",},},caseId: CASE_ID,};apiInstance.updatePriority(params).then((data: v2.CaseResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
key
string
Key
modified_at
date-time
Timestamp of when the case was last modified
priority
enum
Case priority
Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5
default: NOT_DEFINED
service_now_ticket
object
ServiceNow ticket attached to case
result
object
ServiceNow ticket information
sys_target_link
string
Link to the Incident created on ServiceNow
status
enum
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
status
enum
Case status
Allowed enum values: OPEN,IN_PROGRESS,CLOSED
title
string
Title
type
enum
Case type
Allowed enum values: STANDARD
id [required]
string
Case's identifier
relationships
object
Resources related to a case
assignee
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
project
object
Relationship to project
data [required]
object
Relationship to project object
id [required]
string
A unique identifier that represents the project
type [required]
enum
Project resource type
Allowed enum values: project
default: project
type [required]
enum
Case resource type
Allowed enum values: case
default: case
{"data":{"attributes":{"archived_at":"2019-09-19T10:00:00.000Z","closed_at":"2019-09-19T10:00:00.000Z","created_at":"2019-09-19T10:00:00.000Z","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","title":"Memory leak investigation on API","type":"STANDARD"},"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"}}
// Assign case returns "OK" response
packagemainimport("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(){// there is a valid "case" in the system
CaseID:=os.Getenv("CASE_ID")// there is a valid "user" in the system
UserDataID:=os.Getenv("USER_DATA_ID")body:=datadogV2.CaseAssignRequest{Data:datadogV2.CaseAssign{Attributes:datadogV2.CaseAssignAttributes{AssigneeId:UserDataID,},Type:datadogV2.CASERESOURCETYPE_CASE,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCaseManagementApi(apiClient)resp,r,err:=api.AssignCase(ctx,CaseID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CaseManagementApi.AssignCase`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CaseManagementApi.AssignCase`:\n%s\n",responseContent)}
// Assign 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.CaseAssign;importcom.datadog.api.client.v2.model.CaseAssignAttributes;importcom.datadog.api.client.v2.model.CaseAssignRequest;importcom.datadog.api.client.v2.model.CaseResourceType;importcom.datadog.api.client.v2.model.CaseResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();CaseManagementApiapiInstance=newCaseManagementApi(defaultClient);// there is a valid "case" in the systemStringCASE_ID=System.getenv("CASE_ID");// there is a valid "user" in the systemStringUSER_DATA_ID=System.getenv("USER_DATA_ID");CaseAssignRequestbody=newCaseAssignRequest().data(newCaseAssign().attributes(newCaseAssignAttributes().assigneeId(USER_DATA_ID)).type(CaseResourceType.CASE));try{CaseResponseresult=apiInstance.assignCase(CASE_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CaseManagementApi#assignCase");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Assign case returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApifromdatadog_api_client.v2.model.case_assignimportCaseAssignfromdatadog_api_client.v2.model.case_assign_attributesimportCaseAssignAttributesfromdatadog_api_client.v2.model.case_assign_requestimportCaseAssignRequestfromdatadog_api_client.v2.model.case_resource_typeimportCaseResourceType# there is a valid "case" in the systemCASE_ID=environ["CASE_ID"]# there is a valid "user" in the systemUSER_DATA_ID=environ["USER_DATA_ID"]body=CaseAssignRequest(data=CaseAssign(attributes=CaseAssignAttributes(assignee_id=USER_DATA_ID,),type=CaseResourceType.CASE,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)response=api_instance.assign_case(case_id=CASE_ID,body=body)print(response)
# Assign case returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CaseManagementAPI.new# there is a valid "case" in the systemCASE_ID=ENV["CASE_ID"]# there is a valid "user" in the systemUSER_DATA_ID=ENV["USER_DATA_ID"]body=DatadogAPIClient::V2::CaseAssignRequest.new({data:DatadogAPIClient::V2::CaseAssign.new({attributes:DatadogAPIClient::V2::CaseAssignAttributes.new({assignee_id:USER_DATA_ID,}),type:DatadogAPIClient::V2::CaseResourceType::CASE,}),})papi_instance.assign_case(CASE_ID,body)
// Assign case returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;usedatadog_api_client::datadogV2::model::CaseAssign;usedatadog_api_client::datadogV2::model::CaseAssignAttributes;usedatadog_api_client::datadogV2::model::CaseAssignRequest;usedatadog_api_client::datadogV2::model::CaseResourceType;#[tokio::main]asyncfnmain(){// there is a valid "case" in the system
letcase_id=std::env::var("CASE_ID").unwrap();// there is a valid "user" in the system
letuser_data_id=std::env::var("USER_DATA_ID").unwrap();letbody=CaseAssignRequest::new(CaseAssign::new(CaseAssignAttributes::new(user_data_id.clone()),CaseResourceType::CASE,));letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.assign_case(case_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Assign case returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);// there is a valid "case" in the system
constCASE_ID=process.env.CASE_IDasstring;// there is a valid "user" in the system
constUSER_DATA_ID=process.env.USER_DATA_IDasstring;constparams: v2.CaseManagementApiAssignCaseRequest={body:{data:{attributes:{assigneeId: USER_DATA_ID,},type:"case",},},caseId: CASE_ID,};apiInstance.assignCase(params).then((data: v2.CaseResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
key
string
Key
modified_at
date-time
Timestamp of when the case was last modified
priority
enum
Case priority
Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5
default: NOT_DEFINED
service_now_ticket
object
ServiceNow ticket attached to case
result
object
ServiceNow ticket information
sys_target_link
string
Link to the Incident created on ServiceNow
status
enum
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
status
enum
Case status
Allowed enum values: OPEN,IN_PROGRESS,CLOSED
title
string
Title
type
enum
Case type
Allowed enum values: STANDARD
id [required]
string
Case's identifier
relationships
object
Resources related to a case
assignee
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
project
object
Relationship to project
data [required]
object
Relationship to project object
id [required]
string
A unique identifier that represents the project
type [required]
enum
Project resource type
Allowed enum values: project
default: project
type [required]
enum
Case resource type
Allowed enum values: case
default: case
{"data":{"attributes":{"archived_at":"2019-09-19T10:00:00.000Z","closed_at":"2019-09-19T10:00:00.000Z","created_at":"2019-09-19T10:00:00.000Z","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","title":"Memory leak investigation on API","type":"STANDARD"},"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"}}
// Unassign case returns "OK" response
packagemainimport("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(){// there is a valid "case" in the system
CaseID:=os.Getenv("CASE_ID")body:=datadogV2.CaseEmptyRequest{Data:datadogV2.CaseEmpty{Type:datadogV2.CASERESOURCETYPE_CASE,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCaseManagementApi(apiClient)resp,r,err:=api.UnassignCase(ctx,CaseID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CaseManagementApi.UnassignCase`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CaseManagementApi.UnassignCase`:\n%s\n",responseContent)}
// Unassign 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.CaseEmpty;importcom.datadog.api.client.v2.model.CaseEmptyRequest;importcom.datadog.api.client.v2.model.CaseResourceType;importcom.datadog.api.client.v2.model.CaseResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();CaseManagementApiapiInstance=newCaseManagementApi(defaultClient);// there is a valid "case" in the systemStringCASE_ID=System.getenv("CASE_ID");CaseEmptyRequestbody=newCaseEmptyRequest().data(newCaseEmpty().type(CaseResourceType.CASE));try{CaseResponseresult=apiInstance.unassignCase(CASE_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CaseManagementApi#unassignCase");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Unassign case returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApifromdatadog_api_client.v2.model.case_emptyimportCaseEmptyfromdatadog_api_client.v2.model.case_empty_requestimportCaseEmptyRequestfromdatadog_api_client.v2.model.case_resource_typeimportCaseResourceType# there is a valid "case" in the systemCASE_ID=environ["CASE_ID"]body=CaseEmptyRequest(data=CaseEmpty(type=CaseResourceType.CASE,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)response=api_instance.unassign_case(case_id=CASE_ID,body=body)print(response)
# Unassign case returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CaseManagementAPI.new# there is a valid "case" in the systemCASE_ID=ENV["CASE_ID"]body=DatadogAPIClient::V2::CaseEmptyRequest.new({data:DatadogAPIClient::V2::CaseEmpty.new({type:DatadogAPIClient::V2::CaseResourceType::CASE,}),})papi_instance.unassign_case(CASE_ID,body)
// Unassign case returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;usedatadog_api_client::datadogV2::model::CaseEmpty;usedatadog_api_client::datadogV2::model::CaseEmptyRequest;usedatadog_api_client::datadogV2::model::CaseResourceType;#[tokio::main]asyncfnmain(){// there is a valid "case" in the system
letcase_id=std::env::var("CASE_ID").unwrap();letbody=CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.unassign_case(case_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Unassign case returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);// there is a valid "case" in the system
constCASE_ID=process.env.CASE_IDasstring;constparams: v2.CaseManagementApiUnassignCaseRequest={body:{data:{type:"case",},},caseId: CASE_ID,};apiInstance.unassignCase(params).then((data: v2.CaseResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
key
string
Key
modified_at
date-time
Timestamp of when the case was last modified
priority
enum
Case priority
Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5
default: NOT_DEFINED
service_now_ticket
object
ServiceNow ticket attached to case
result
object
ServiceNow ticket information
sys_target_link
string
Link to the Incident created on ServiceNow
status
enum
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
status
enum
Case status
Allowed enum values: OPEN,IN_PROGRESS,CLOSED
title
string
Title
type
enum
Case type
Allowed enum values: STANDARD
id [required]
string
Case's identifier
relationships
object
Resources related to a case
assignee
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
project
object
Relationship to project
data [required]
object
Relationship to project object
id [required]
string
A unique identifier that represents the project
type [required]
enum
Project resource type
Allowed enum values: project
default: project
type [required]
enum
Case resource type
Allowed enum values: case
default: case
{"data":{"attributes":{"archived_at":"2019-09-19T10:00:00.000Z","closed_at":"2019-09-19T10:00:00.000Z","created_at":"2019-09-19T10:00:00.000Z","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","title":"Memory leak investigation on API","type":"STANDARD"},"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"}}
// Archive case returns "OK" response
packagemainimport("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(){// there is a valid "case" in the system
CaseID:=os.Getenv("CASE_ID")body:=datadogV2.CaseEmptyRequest{Data:datadogV2.CaseEmpty{Type:datadogV2.CASERESOURCETYPE_CASE,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCaseManagementApi(apiClient)resp,r,err:=api.ArchiveCase(ctx,CaseID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CaseManagementApi.ArchiveCase`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CaseManagementApi.ArchiveCase`:\n%s\n",responseContent)}
// Archive 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.CaseEmpty;importcom.datadog.api.client.v2.model.CaseEmptyRequest;importcom.datadog.api.client.v2.model.CaseResourceType;importcom.datadog.api.client.v2.model.CaseResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();CaseManagementApiapiInstance=newCaseManagementApi(defaultClient);// there is a valid "case" in the systemStringCASE_ID=System.getenv("CASE_ID");CaseEmptyRequestbody=newCaseEmptyRequest().data(newCaseEmpty().type(CaseResourceType.CASE));try{CaseResponseresult=apiInstance.archiveCase(CASE_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CaseManagementApi#archiveCase");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Archive case returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApifromdatadog_api_client.v2.model.case_emptyimportCaseEmptyfromdatadog_api_client.v2.model.case_empty_requestimportCaseEmptyRequestfromdatadog_api_client.v2.model.case_resource_typeimportCaseResourceType# there is a valid "case" in the systemCASE_ID=environ["CASE_ID"]body=CaseEmptyRequest(data=CaseEmpty(type=CaseResourceType.CASE,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)response=api_instance.archive_case(case_id=CASE_ID,body=body)print(response)
# Archive case returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CaseManagementAPI.new# there is a valid "case" in the systemCASE_ID=ENV["CASE_ID"]body=DatadogAPIClient::V2::CaseEmptyRequest.new({data:DatadogAPIClient::V2::CaseEmpty.new({type:DatadogAPIClient::V2::CaseResourceType::CASE,}),})papi_instance.archive_case(CASE_ID,body)
// Archive case returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;usedatadog_api_client::datadogV2::model::CaseEmpty;usedatadog_api_client::datadogV2::model::CaseEmptyRequest;usedatadog_api_client::datadogV2::model::CaseResourceType;#[tokio::main]asyncfnmain(){// there is a valid "case" in the system
letcase_id=std::env::var("CASE_ID").unwrap();letbody=CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.archive_case(case_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Archive case returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);// there is a valid "case" in the system
constCASE_ID=process.env.CASE_IDasstring;constparams: v2.CaseManagementApiArchiveCaseRequest={body:{data:{type:"case",},},caseId: CASE_ID,};apiInstance.archiveCase(params).then((data: v2.CaseResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
key
string
Key
modified_at
date-time
Timestamp of when the case was last modified
priority
enum
Case priority
Allowed enum values: NOT_DEFINED,P1,P2,P3,P4,P5
default: NOT_DEFINED
service_now_ticket
object
ServiceNow ticket attached to case
result
object
ServiceNow ticket information
sys_target_link
string
Link to the Incident created on ServiceNow
status
enum
Case status
Allowed enum values: IN_PROGRESS,COMPLETED,FAILED
default: IN_PROGRESS
status
enum
Case status
Allowed enum values: OPEN,IN_PROGRESS,CLOSED
title
string
Title
type
enum
Case type
Allowed enum values: STANDARD
id [required]
string
Case's identifier
relationships
object
Resources related to a case
assignee
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
created_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
modified_by
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
User resource type.
Allowed enum values: user
default: user
project
object
Relationship to project
data [required]
object
Relationship to project object
id [required]
string
A unique identifier that represents the project
type [required]
enum
Project resource type
Allowed enum values: project
default: project
type [required]
enum
Case resource type
Allowed enum values: case
default: case
{"data":{"attributes":{"archived_at":"2019-09-19T10:00:00.000Z","closed_at":"2019-09-19T10:00:00.000Z","created_at":"2019-09-19T10:00:00.000Z","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","title":"Memory leak investigation on API","type":"STANDARD"},"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"}}
// Unarchive case returns "OK" response
packagemainimport("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(){// there is a valid "case" in the system
CaseID:=os.Getenv("CASE_ID")body:=datadogV2.CaseEmptyRequest{Data:datadogV2.CaseEmpty{Type:datadogV2.CASERESOURCETYPE_CASE,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCaseManagementApi(apiClient)resp,r,err:=api.UnarchiveCase(ctx,CaseID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CaseManagementApi.UnarchiveCase`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CaseManagementApi.UnarchiveCase`:\n%s\n",responseContent)}
// Unarchive 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.CaseEmpty;importcom.datadog.api.client.v2.model.CaseEmptyRequest;importcom.datadog.api.client.v2.model.CaseResourceType;importcom.datadog.api.client.v2.model.CaseResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();CaseManagementApiapiInstance=newCaseManagementApi(defaultClient);// there is a valid "case" in the systemStringCASE_ID=System.getenv("CASE_ID");CaseEmptyRequestbody=newCaseEmptyRequest().data(newCaseEmpty().type(CaseResourceType.CASE));try{CaseResponseresult=apiInstance.unarchiveCase(CASE_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CaseManagementApi#unarchiveCase");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Unarchive case returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.case_management_apiimportCaseManagementApifromdatadog_api_client.v2.model.case_emptyimportCaseEmptyfromdatadog_api_client.v2.model.case_empty_requestimportCaseEmptyRequestfromdatadog_api_client.v2.model.case_resource_typeimportCaseResourceType# there is a valid "case" in the systemCASE_ID=environ["CASE_ID"]body=CaseEmptyRequest(data=CaseEmpty(type=CaseResourceType.CASE,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=CaseManagementApi(api_client)response=api_instance.unarchive_case(case_id=CASE_ID,body=body)print(response)
# Unarchive case returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CaseManagementAPI.new# there is a valid "case" in the systemCASE_ID=ENV["CASE_ID"]body=DatadogAPIClient::V2::CaseEmptyRequest.new({data:DatadogAPIClient::V2::CaseEmpty.new({type:DatadogAPIClient::V2::CaseResourceType::CASE,}),})papi_instance.unarchive_case(CASE_ID,body)
// Unarchive case returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_case_management::CaseManagementAPI;usedatadog_api_client::datadogV2::model::CaseEmpty;usedatadog_api_client::datadogV2::model::CaseEmptyRequest;usedatadog_api_client::datadogV2::model::CaseResourceType;#[tokio::main]asyncfnmain(){// there is a valid "case" in the system
letcase_id=std::env::var("CASE_ID").unwrap();letbody=CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));letconfiguration=datadog::Configuration::new();letapi=CaseManagementAPI::with_config(configuration);letresp=api.unarchive_case(case_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Unarchive case returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CaseManagementApi(configuration);// there is a valid "case" in the system
constCASE_ID=process.env.CASE_IDasstring;constparams: v2.CaseManagementApiUnarchiveCaseRequest={body:{data:{type:"case",},},caseId: CASE_ID,};apiInstance.unarchiveCase(params).then((data: v2.CaseResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));