Update a project
https://api.datadoghq.com/api/v2/cases/projects/{project_id}https://api.us3.datadoghq.com/api/v2/cases/projects/{project_id}https://api.us5.datadoghq.com/api/v2/cases/projects/{project_id}https://api.datadoghq.eu/api/v2/cases/projects/{project_id}https://api.ap1.datadoghq.com/api/v2/cases/projects/{project_id}https://api.ap2.datadoghq.com/api/v2/cases/projects/{project_id}https://api.uk1.datadoghq.com/api/v2/cases/projects/{project_id}https://api.ddog-gov.com/api/v2/cases/projects/{project_id}https://api.us2.ddog-gov.com/api/v2/cases/projects/{project_id}Overview
Update a project.
OAuth apps require the cases_write authorization scope to access this endpoint.
Arguments
Path Parameters
project_id [required]Project UUID.
Request
Body Data (required)
Project payload.
data [required]Project update.
attributesProject update attributes.
columns_configProject columns configuration.
columnsList of column configurations for the project board view.
sortSort configuration for a project board column.
ascendingWhether to sort in ascending order.
priorityThe sort priority order for this column.
sort_fieldThe field used to sort items in this column.
typeThe type of column.
enabled_custom_case_typesList of enabled custom work item type IDs.
nameProject name.
settingsProject settings.
auto_close_inactive_casesAuto-close inactive work items settings.
enabledWhether auto-close is enabled.
max_inactive_time_in_secsMaximum inactive time in seconds before auto-closing.
auto_transition_assigned_casesAuto-transition assigned work items settings.
auto_transition_assigned_cases_on_self_assignedWhether to auto-transition work items when self-assigned.
integration_incidentIncident integration settings.
auto_escalation_queryQuery for auto-escalation.
default_incident_commanderDefault incident commander.
enabledWhether incident integration is enabled.
field_mappingsList of mappings between incident fields and work item fields.
case_fieldThe work item field to map the incident field value to.
incident_user_defined_field_idThe identifier of the incident user-defined field to map from.
incident_typeIncident type.
severity_configSeverity configuration for mapping incident priorities to work item priorities.
priority_mappingMapping of incident severity values to work item priority values.
<any-key>integration_jiraJira integration settings.
auto_creationAuto-creation settings for Jira issues from work items.
enabledWhether automatic Jira issue creation is enabled.
enabledWhether Jira integration is enabled.
metadataMetadata for connecting a Work Management project to a Jira project.
account_idThe Jira account identifier.
issue_type_idThe Jira issue type identifier to use when creating issues.
project_idThe Jira project identifier to associate with this Work Management project.
syncSynchronization configuration for Jira integration.
enabledWhether Jira field synchronization is enabled.
propertiesField synchronization properties for Jira integration.
assigneeSync property configuration.
sync_typeThe direction and type of synchronization for this property.
commentsSync property configuration.
sync_typeThe direction and type of synchronization for this property.
custom_fieldsMap of custom field identifiers to their sync configurations.
<any-key>Synchronization configuration for a Jira custom field.
sync_typeThe type of synchronization to apply for this custom field.
valueRepresents any valid JSON value.
Object 1A scalar value represented as a string.
Object 2A scalar numeric value.
Object 3An arbitrary object value with additional properties.
Object 4An array of arbitrary values.
Object 1A scalar value represented as a string.
Object 2A scalar numeric value.
Object 3An arbitrary object value with additional properties.
Object 4A scalar boolean value.
Object 5A scalar boolean value.
descriptionSync property configuration.
sync_typeThe direction and type of synchronization for this property.
due_dateDue date synchronization configuration for Jira integration.
jira_field_idThe Jira field identifier used to store the due date.
sync_typeThe type of synchronization to apply for the due date field.
prioritySync property with mapping configuration.
mappingMap of source values to destination values for synchronization.
<any-key>name_mappingMap of source names to display names used during synchronization.
<any-key>sync_typeThe direction and type of synchronization for this property.
statusSync property with mapping configuration.
mappingMap of source values to destination values for synchronization.
<any-key>name_mappingMap of source names to display names used during synchronization.
<any-key>sync_typeThe direction and type of synchronization for this property.
titleSync property configuration.
sync_typeThe direction and type of synchronization for this property.
integration_monitorMonitor integration settings.
auto_resolve_enabledWhether auto-resolve is enabled.
case_type_idWork item type ID for monitor integration.
enabledWhether monitor integration is enabled.
handleMonitor handle.
integration_on_callOn-Call integration settings.
auto_assign_on_callWhether to auto-assign on-call.
enabledWhether On-Call integration is enabled.
escalation_queriesList of escalation queries for routing work items to on-call responders.
enabledWhether this escalation query is enabled.
idUnique identifier of the escalation query.
queryThe query used to match work items for escalation.
targetThe target recipient for an On-Call escalation query.
dynamic_team_pagingWhether to use dynamic team paging for escalation.
team_idThe identifier of the team to escalate to.
user_idThe identifier of the user to escalate to.
integration_service_nowServiceNow integration settings.
assignment_groupAssignment group.
auto_creationAuto-creation settings for ServiceNow incidents from work items.
enabledWhether automatic ServiceNow incident creation is enabled.
enabledWhether ServiceNow integration is enabled.
instance_nameServiceNow instance name.
sync_configSynchronization configuration for ServiceNow integration.
enabledWhether ServiceNow synchronization is enabled.
propertiesField-level synchronization properties for ServiceNow integration.
commentsSync property configuration.
sync_typeThe direction and type of synchronization for this property.
priorityPriority synchronization configuration for ServiceNow integration.
impact_mappingMapping of work item priority values to ServiceNow impact values.
<any-key>sync_typeThe type of synchronization to apply for priority.
urgency_mappingMapping of work item priority values to ServiceNow urgency values.
<any-key>statusSync property with mapping configuration.
mappingMap of source values to destination values for synchronization.
<any-key>name_mappingMap of source names to display names used during synchronization.
<any-key>sync_typeThe direction and type of synchronization for this property.
notificationProject notification settings.
destinationsNotification destinations (1=email, 2=slack, 3=in-app).
enabledWhether notifications are enabled.
notify_on_case_assignmentWhether to send a notification when a work item is assigned.
notify_on_case_closedWhether to send a notification when a work item is closed.
notify_on_case_commentWhether to send a notification when a comment is added to a work item.
notify_on_case_comment_mentionWhether to send a notification when a user is mentioned in a work item comment.
notify_on_case_priority_changeWhether to send a notification when a work item's priority changes.
notify_on_case_status_changeWhether to send a notification when a work item's status changes.
notify_on_case_unassignmentWhether to send a notification when a work item is unassigned.
team_uuidTeam UUID to associate with the project.
type [required]Project resource type.
projectproject{
"data": {
"type": "project",
"attributes": {
"name": "Updated Project Name Example-Case-Management"
}
}
}Response
OK
Project response.
dataA Project.
attributes [required]Project attributes.
columns_configProject columns configuration.
columnsList of column configurations for the project board view.
sortSort configuration for a project board column.
ascendingWhether to sort in ascending order.
priorityThe sort priority order for this column.
sort_fieldThe field used to sort items in this column.
typeThe type of column.
enabled_custom_case_typesList of enabled custom work item type IDs.
keyThe project's key.
nameProject's name.
restrictedWhether the project is restricted.
settingsProject settings.
auto_close_inactive_casesAuto-close inactive work items settings.
enabledWhether auto-close is enabled.
max_inactive_time_in_secsMaximum inactive time in seconds before auto-closing.
auto_transition_assigned_casesAuto-transition assigned work items settings.
auto_transition_assigned_cases_on_self_assignedWhether to auto-transition work items when self-assigned.
integration_incidentIncident integration settings.
auto_escalation_queryQuery for auto-escalation.
default_incident_commanderDefault incident commander.
enabledWhether incident integration is enabled.
field_mappingsList of mappings between incident fields and work item fields.
case_fieldThe work item field to map the incident field value to.
incident_user_defined_field_idThe identifier of the incident user-defined field to map from.
incident_typeIncident type.
severity_configSeverity configuration for mapping incident priorities to work item priorities.
priority_mappingMapping of incident severity values to work item priority values.
<any-key>integration_jiraJira integration settings.
auto_creationAuto-creation settings for Jira issues from work items.
enabledWhether automatic Jira issue creation is enabled.
enabledWhether Jira integration is enabled.
metadataMetadata for connecting a Work Management project to a Jira project.
account_idThe Jira account identifier.
issue_type_idThe Jira issue type identifier to use when creating issues.
project_idThe Jira project identifier to associate with this Work Management project.
syncSynchronization configuration for Jira integration.
enabledWhether Jira field synchronization is enabled.
propertiesField synchronization properties for Jira integration.
assigneeSync property configuration.
sync_typeThe direction and type of synchronization for this property.
commentsSync property configuration.
sync_typeThe direction and type of synchronization for this property.
custom_fieldsMap of custom field identifiers to their sync configurations.
<any-key>Synchronization configuration for a Jira custom field.
sync_typeThe type of synchronization to apply for this custom field.
valueRepresents any valid JSON value.
Object 1A scalar value represented as a string.
Object 2A scalar numeric value.
Object 3An arbitrary object value with additional properties.
Object 4An array of arbitrary values.
Object 1A scalar value represented as a string.
Object 2A scalar numeric value.
Object 3An arbitrary object value with additional properties.
Object 4A scalar boolean value.
Object 5A scalar boolean value.
descriptionSync property configuration.
sync_typeThe direction and type of synchronization for this property.
due_dateDue date synchronization configuration for Jira integration.
jira_field_idThe Jira field identifier used to store the due date.
sync_typeThe type of synchronization to apply for the due date field.
prioritySync property with mapping configuration.
mappingMap of source values to destination values for synchronization.
<any-key>name_mappingMap of source names to display names used during synchronization.
<any-key>sync_typeThe direction and type of synchronization for this property.
statusSync property with mapping configuration.
mappingMap of source values to destination values for synchronization.
<any-key>name_mappingMap of source names to display names used during synchronization.
<any-key>sync_typeThe direction and type of synchronization for this property.
titleSync property configuration.
sync_typeThe direction and type of synchronization for this property.
integration_monitorMonitor integration settings.
auto_resolve_enabledWhether auto-resolve is enabled.
case_type_idWork item type ID for monitor integration.
enabledWhether monitor integration is enabled.
handleMonitor handle.
integration_on_callOn-Call integration settings.
auto_assign_on_callWhether to auto-assign on-call.
enabledWhether On-Call integration is enabled.
escalation_queriesList of escalation queries for routing work items to on-call responders.
enabledWhether this escalation query is enabled.
idUnique identifier of the escalation query.
queryThe query used to match work items for escalation.
targetThe target recipient for an On-Call escalation query.
dynamic_team_pagingWhether to use dynamic team paging for escalation.
team_idThe identifier of the team to escalate to.
user_idThe identifier of the user to escalate to.
integration_service_nowServiceNow integration settings.
assignment_groupAssignment group.
auto_creationAuto-creation settings for ServiceNow incidents from work items.
enabledWhether automatic ServiceNow incident creation is enabled.
enabledWhether ServiceNow integration is enabled.
instance_nameServiceNow instance name.
sync_configSynchronization configuration for ServiceNow integration.
enabledWhether ServiceNow synchronization is enabled.
propertiesField-level synchronization properties for ServiceNow integration.
commentsSync property configuration.
sync_typeThe direction and type of synchronization for this property.
priorityPriority synchronization configuration for ServiceNow integration.
impact_mappingMapping of work item priority values to ServiceNow impact values.
<any-key>sync_typeThe type of synchronization to apply for priority.
urgency_mappingMapping of work item priority values to ServiceNow urgency values.
<any-key>statusSync property with mapping configuration.
mappingMap of source values to destination values for synchronization.
<any-key>name_mappingMap of source names to display names used during synchronization.
<any-key>sync_typeThe direction and type of synchronization for this property.
notificationProject notification settings.
destinationsNotification destinations (1=email, 2=slack, 3=in-app).
enabledWhether notifications are enabled.
notify_on_case_assignmentWhether to send a notification when a work item is assigned.
notify_on_case_closedWhether to send a notification when a work item is closed.
notify_on_case_commentWhether to send a notification when a comment is added to a work item.
notify_on_case_comment_mentionWhether to send a notification when a user is mentioned in a work item comment.
notify_on_case_priority_changeWhether to send a notification when a work item's priority changes.
notify_on_case_status_changeWhether to send a notification when a work item's status changes.
notify_on_case_unassignmentWhether to send a notification when a work item is unassigned.
id [required]The Project's identifier.
relationshipsProject relationships.
member_teamRelationship between a team and a team link
dataRelated team links
id [required]The team link's identifier
type [required]Team link type
team_linksteam_linkslinksLinks attributes.
relatedRelated link.
member_userRelationship to users.
data [required]Relationships to user objects.
id [required]A unique identifier that represents the user.
type [required]User resource type.
userusertype [required]Project resource type.
projectproject{
"data": {
"attributes": {
"columns_config": {
"columns": [
{
"sort": {
"ascending": false,
"priority": "integer"
},
"sort_field": "string",
"type": "string"
}
]
},
"enabled_custom_case_types": [],
"key": "CASEM",
"name": "Security Investigation",
"restricted": false,
"settings": {
"auto_close_inactive_cases": {
"enabled": false,
"max_inactive_time_in_secs": "integer"
},
"auto_transition_assigned_cases": {
"auto_transition_assigned_cases_on_self_assigned": false
},
"integration_incident": {
"auto_escalation_query": "string",
"default_incident_commander": "string",
"enabled": false,
"field_mappings": [
{
"case_field": "string",
"incident_user_defined_field_id": "string"
}
],
"incident_type": "string",
"severity_config": {
"priority_mapping": {
"<any-key>": "string"
}
}
},
"integration_jira": {
"auto_creation": {
"enabled": false
},
"enabled": false,
"metadata": {
"account_id": "string",
"issue_type_id": "string",
"project_id": "string"
},
"sync": {
"enabled": false,
"properties": {
"assignee": {
"sync_type": "string"
},
"comments": {
"sync_type": "string"
},
"custom_fields": {
"<any-key>": {
"sync_type": "string",
"value": {
"description": "undefined",
"type": "undefined"
}
}
},
"description": {
"sync_type": "string"
},
"due_date": {
"jira_field_id": "string",
"sync_type": "string"
},
"priority": {
"mapping": {
"<any-key>": "string"
},
"name_mapping": {
"<any-key>": "string"
},
"sync_type": "string"
},
"status": {
"mapping": {
"<any-key>": "string"
},
"name_mapping": {
"<any-key>": "string"
},
"sync_type": "string"
},
"title": {
"sync_type": "string"
}
}
}
},
"integration_monitor": {
"auto_resolve_enabled": false,
"case_type_id": "string",
"enabled": false,
"handle": "string"
},
"integration_on_call": {
"auto_assign_on_call": false,
"enabled": false,
"escalation_queries": [
{
"enabled": false,
"id": "string",
"query": "string",
"target": {
"dynamic_team_paging": false,
"team_id": "string",
"user_id": "string"
}
}
]
},
"integration_service_now": {
"assignment_group": "string",
"auto_creation": {
"enabled": false
},
"enabled": false,
"instance_name": "string",
"sync_config": {
"enabled": false,
"properties": {
"comments": {
"sync_type": "string"
},
"priority": {
"impact_mapping": {
"<any-key>": "string"
},
"sync_type": "string",
"urgency_mapping": {
"<any-key>": "string"
}
},
"status": {
"mapping": {
"<any-key>": "string"
},
"name_mapping": {
"<any-key>": "string"
},
"sync_type": "string"
}
}
}
},
"notification": {
"destinations": [],
"enabled": false,
"notify_on_case_assignment": false,
"notify_on_case_closed": false,
"notify_on_case_comment": false,
"notify_on_case_comment_mention": false,
"notify_on_case_priority_change": false,
"notify_on_case_status_change": false,
"notify_on_case_unassignment": false
}
}
},
"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
"relationships": {
"member_team": {
"data": [
{
"id": "f9bb8444-af7f-11ec-ac2c-da7ad0900001",
"type": "team_links"
}
],
"links": {
"related": "/api/v2/team/c75a4a8e-20c7-11ee-a3a5-da7ad0900002/links"
}
},
"member_user": {
"data": [
{
"id": "00000000-0000-0000-0000-000000000000",
"type": "user"
}
]
}
},
"type": "project"
}
}Bad Request
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Unauthorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Not Found
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Code Example
# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/cases/projects/${project_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "project",
"attributes": {
"name": "Updated Project Name Example-Case-Management"
}
}
}
EOF# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/cases/projects/${project_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "project",
"attributes": {
"name": "Updated Project Name Example-Case-Management"
}
}
}
EOF# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/cases/projects/${project_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "project",
"attributes": {
"name": "Updated Project Name Example-Case-Management"
}
}
}
EOF# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/cases/projects/${project_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "project",
"attributes": {
"name": "Updated Project Name Example-Case-Management"
}
}
}
EOF# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/cases/projects/${project_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "project",
"attributes": {
"name": "Updated Project Name Example-Case-Management"
}
}
}
EOF# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/cases/projects/${project_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "project",
"attributes": {
"name": "Updated Project Name Example-Case-Management"
}
}
}
EOF# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/cases/projects/${project_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "project",
"attributes": {
"name": "Updated Project Name Example-Case-Management"
}
}
}
EOF# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/cases/projects/${project_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "project",
"attributes": {
"name": "Updated Project Name Example-Case-Management"
}
}
}
EOF# Path parameters
export project_id="e555e290-ed65-49bd-ae18-8acbfcf18db7"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/cases/projects/${project_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"type": "project",
"attributes": {
"name": "Updated Project Name Example-Case-Management"
}
}
}
EOF// Update a project returns "OK" response
package main
import (
"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"
)
func main() {
body := datadogV2.ProjectUpdateRequest{
Data: datadogV2.ProjectUpdate{
Type: datadogV2.PROJECTRESOURCETYPE_PROJECT,
Attributes: &datadogV2.ProjectUpdateAttributes{
Name: datadog.PtrString("Updated Project Name Example-Case-Management"),
},
},
}
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.UpdateProject(ctx, "d4bbe1af-f36e-42f1-87c1-493ca35c320e", body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UpdateProject`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateProject`:\n%s\n", responseContent)
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// Update a project returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.ProjectResourceType;
import com.datadog.api.client.v2.model.ProjectResponse;
import com.datadog.api.client.v2.model.ProjectUpdate;
import com.datadog.api.client.v2.model.ProjectUpdateAttributes;
import com.datadog.api.client.v2.model.ProjectUpdateRequest;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);
ProjectUpdateRequest body =
new ProjectUpdateRequest()
.data(
new ProjectUpdate()
.type(ProjectResourceType.PROJECT)
.attributes(
new ProjectUpdateAttributes()
.name("Updated Project Name Example-Case-Management")));
try {
ProjectResponse result =
apiInstance.updateProject("d4bbe1af-f36e-42f1-87c1-493ca35c320e", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#updateProject");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
Update a project returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.project_resource_type import ProjectResourceType
from datadog_api_client.v2.model.project_update import ProjectUpdate
from datadog_api_client.v2.model.project_update_attributes import ProjectUpdateAttributes
from datadog_api_client.v2.model.project_update_request import ProjectUpdateRequest
body = ProjectUpdateRequest(
data=ProjectUpdate(
type=ProjectResourceType.PROJECT,
attributes=ProjectUpdateAttributes(
name="Updated Project Name Example-Case-Management",
),
),
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = CaseManagementApi(api_client)
response = api_instance.update_project(project_id="d4bbe1af-f36e-42f1-87c1-493ca35c320e", body=body)
print(response)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# Update a project returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
body = DatadogAPIClient::V2::ProjectUpdateRequest.new({
data: DatadogAPIClient::V2::ProjectUpdate.new({
type: DatadogAPIClient::V2::ProjectResourceType::PROJECT,
attributes: DatadogAPIClient::V2::ProjectUpdateAttributes.new({
name: "Updated Project Name Example-Case-Management",
}),
}),
})
p api_instance.update_project("d4bbe1af-f36e-42f1-87c1-493ca35c320e", body)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// Update a project returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::ProjectResourceType;
use datadog_api_client::datadogV2::model::ProjectUpdate;
use datadog_api_client::datadogV2::model::ProjectUpdateAttributes;
use datadog_api_client::datadogV2::model::ProjectUpdateRequest;
#[tokio::main]
async fn main() {
let body = ProjectUpdateRequest::new(
ProjectUpdate::new(ProjectResourceType::PROJECT).attributes(
ProjectUpdateAttributes::new()
.name("Updated Project Name Example-Case-Management".to_string()),
),
);
let configuration = datadog::Configuration::new();
let api = CaseManagementAPI::with_config(configuration);
let resp = api
.update_project("d4bbe1af-f36e-42f1-87c1-493ca35c320e".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run/**
* Update a project returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.CaseManagementApi(configuration);
const params: v2.CaseManagementApiUpdateProjectRequest = {
body: {
data: {
type: "project",
attributes: {
name: "Updated Project Name Example-Case-Management",
},
},
},
projectId: "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
};
apiInstance
.updateProject(params)
.then((data: v2.ProjectResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"