Incidents

Manage incident response, as well as associated attachments, metadata, and todos. See the Incident Management page for more information.

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

POST https://api.ap1.datadoghq.com/api/v2/incidentshttps://api.datadoghq.eu/api/v2/incidentshttps://api.ddog-gov.com/api/v2/incidentshttps://api.datadoghq.com/api/v2/incidentshttps://api.us3.datadoghq.com/api/v2/incidentshttps://api.us5.datadoghq.com/api/v2/incidents

개요

Create an incident. This endpoint requires the incident_write permission.

OAuth apps require the incident_write authorization scope to access this endpoint.

요청

Body Data (required)

Incident payload.

Expand All

항목

유형

설명

data [required]

object

Incident data for a create request.

attributes [required]

object

The incident's attributes for a create request.

customer_impact_scope

string

Required if customer_impacted:"true". A summary of the impact customers experienced during the incident.

customer_impacted [required]

boolean

A flag indicating whether the incident caused customer impact.

fields

object

A condensed view of the user-defined fields for which to create initial selections.

<any-key>

 <oneOf>

Dynamic fields for which selections can be made, with field names as keys.

Option 1

object

A field with a single value selected.

type

enum

Type of the single value field definitions. Allowed enum values: dropdown,textbox

default: dropdown

value

string

The single value selected for this field.

Option 2

object

A field with potentially multiple values selected.

type

enum

Type of the multiple value field definitions. Allowed enum values: multiselect,textarray,metrictag,autocomplete

default: multiselect

value

[string]

The multiple values selected for this field.

incident_type_uuid

string

A unique identifier that represents an incident type. The default incident type will be used if this property is not provided.

initial_cells

[ <oneOf>]

An array of initial timeline cells to be placed at the beginning of the incident timeline.

Option 1

object

Timeline cell data for Markdown timeline cells for a create request.

cell_type [required]

enum

Type of the Markdown timeline cell. Allowed enum values: markdown

default: markdown

content [required]

object

The Markdown timeline cell contents.

content

string

The Markdown content of the cell.

important

boolean

A flag indicating whether the timeline cell is important and should be highlighted.

notification_handles

[object]

Notification handles that will be notified of the incident at creation.

display_name

string

The name of the notified handle.

handle

string

The handle used for the notification. This includes an email address, Slack channel, or workflow.

title [required]

string

The title of the incident, which summarizes what happened.

relationships

object

The relationships the incident will have with other resources once created.

commander_user [required]

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

Incident resource type. Allowed enum values: incidents

default: incidents

{
  "data": {
    "type": "incidents",
    "attributes": {
      "title": "Example-Incident",
      "customer_impacted": false,
      "fields": {
        "state": {
          "type": "dropdown",
          "value": "resolved"
        }
      }
    },
    "relationships": {
      "commander_user": {
        "data": {
          "type": "users",
          "id": "string"
        }
      }
    }
  }
}

응답

CREATED

Response with an incident.

Expand All

항목

유형

설명

data [required]

object

Incident data from a response.

attributes

object

The incident's attributes from a response.

archived

date-time

Timestamp of when the incident was archived.

case_id

int64

The incident case id.

created

date-time

Timestamp when the incident was created.

customer_impact_duration

int64

Length of the incident's customer impact in seconds. Equals the difference between customer_impact_start and customer_impact_end.

customer_impact_end

date-time

Timestamp when customers were no longer impacted by the incident.

customer_impact_scope

string

A summary of the impact customers experienced during the incident.

customer_impact_start

date-time

Timestamp when customers began being impacted by the incident.

customer_impacted

boolean

A flag indicating whether the incident caused customer impact.

detected

date-time

Timestamp when the incident was detected.

fields

object

A condensed view of the user-defined fields attached to incidents.

<any-key>

 <oneOf>

Dynamic fields for which selections can be made, with field names as keys.

Option 1

object

A field with a single value selected.

type

enum

Type of the single value field definitions. Allowed enum values: dropdown,textbox

default: dropdown

value

string

The single value selected for this field.

Option 2

object

A field with potentially multiple values selected.

type

enum

Type of the multiple value field definitions. Allowed enum values: multiselect,textarray,metrictag,autocomplete

default: multiselect

value

[string]

The multiple values selected for this field.

incident_type_uuid

string

A unique identifier that represents an incident type.

modified

date-time

Timestamp when the incident was last modified.

non_datadog_creator

object

Incident's non Datadog creator.

image_48_px

string

Non Datadog creator 48px image.

name

string

Non Datadog creator name.

notification_handles

[object]

Notification handles that will be notified of the incident during update.

display_name

string

The name of the notified handle.

handle

string

The handle used for the notification. This includes an email address, Slack channel, or workflow.

public_id

int64

The monotonically increasing integer ID for the incident.

resolved

date-time

Timestamp when the incident's state was last changed from active or stable to resolved or completed.

severity

enum

The incident severity. Allowed enum values: UNKNOWN,SEV-1,SEV-2,SEV-3,SEV-4,SEV-5

state

string

The state incident.

time_to_detect

int64

The amount of time in seconds to detect the incident. Equals the difference between customer_impact_start and detected.

time_to_internal_response

int64

The amount of time in seconds to call incident after detection. Equals the difference of detected and created.

time_to_repair

int64

The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between customer_impact_end and detected.

time_to_resolve

int64

The amount of time in seconds to resolve the incident after it was created. Equals the difference between created and resolved.

title [required]

string

The title of the incident, which summarizes what happened.

visibility

string

The incident visibility status.

id [required]

string

The incident's ID.

relationships

object

The incident's relationships from a response.

attachments

object

A relationship reference for attachments.

data [required]

[object]

An array of incident attachments.

id [required]

string

A unique identifier that represents the attachment.

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

commander_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

impacts

object

Relationship to impacts.

data [required]

[object]

An array of incident impacts.

id [required]

string

A unique identifier that represents the impact.

type [required]

enum

The incident impacts type. Allowed enum values: incident_impacts

integrations

object

A relationship reference for multiple integration metadata objects.

data [required]

[object]

Integration metadata relationship array

id [required]

string

A unique identifier that represents the integration metadata.

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

responders

object

Relationship to incident responders.

data [required]

[object]

An array of incident responders.

id [required]

string

A unique identifier that represents the responder.

type [required]

enum

The incident responders type. Allowed enum values: incident_responders

user_defined_fields

object

Relationship to incident user defined fields.

data [required]

[object]

An array of user defined fields.

id [required]

string

A unique identifier that represents the responder.

type [required]

enum

The incident user defined fields type. Allowed enum values: user_defined_field

type [required]

enum

Incident resource type. Allowed enum values: incidents

default: incidents

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

name

string

Name of the user.

uuid

string

UUID of the user.

id

string

ID of the user.

type

enum

Users resource type. Allowed enum values: users

default: users

Option 2

object

A single incident attachment.

attributes [required]

 <oneOf>

The attributes object for an attachment.

Option 1

object

The attributes object for a postmortem attachment.

attachment [required]

object

The postmortem attachment.

documentUrl [required]

string

The URL of this notebook attachment.

title [required]

string

The title of this postmortem attachment.

attachment_type [required]

enum

The type of postmortem attachment attributes. Allowed enum values: postmortem

default: postmortem

Option 2

object

The attributes object for a link attachment.

attachment [required]

object

The link attachment.

documentUrl [required]

string

The URL of this link attachment.

title [required]

string

The title of this link attachment.

attachment_type [required]

enum

The type of link attachment attributes. Allowed enum values: link

default: link

modified

date-time

Timestamp when the incident attachment link was last modified.

id [required]

string

A unique identifier that represents the incident attachment.

relationships [required]

object

The incident attachment's relationships.

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

{
  "data": {
    "attributes": {
      "archived": "2019-09-19T10:00:00.000Z",
      "case_id": "integer",
      "created": "2019-09-19T10:00:00.000Z",
      "customer_impact_duration": "integer",
      "customer_impact_end": "2019-09-19T10:00:00.000Z",
      "customer_impact_scope": "An example customer impact scope",
      "customer_impact_start": "2019-09-19T10:00:00.000Z",
      "customer_impacted": false,
      "detected": "2019-09-19T10:00:00.000Z",
      "fields": {
        "<any-key>": "undefined"
      },
      "incident_type_uuid": "00000000-0000-0000-0000-000000000000",
      "modified": "2019-09-19T10:00:00.000Z",
      "non_datadog_creator": {
        "image_48_px": "string",
        "name": "string"
      },
      "notification_handles": [
        {
          "display_name": "Jane Doe",
          "handle": "@test.user@test.com"
        }
      ],
      "public_id": 1,
      "resolved": "2019-09-19T10:00:00.000Z",
      "severity": "UNKNOWN",
      "state": "string",
      "time_to_detect": "integer",
      "time_to_internal_response": "integer",
      "time_to_repair": "integer",
      "time_to_resolve": "integer",
      "title": "A test incident title",
      "visibility": "string"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "attachments": {
        "data": [
          {
            "id": "00000000-0000-abcd-1000-000000000000",
            "type": "incident_attachments"
          }
        ]
      },
      "commander_user": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      },
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "impacts": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_impacts"
          }
        ]
      },
      "integrations": {
        "data": [
          {
            "id": "00000000-abcd-0001-0000-000000000000",
            "type": "incident_integrations"
          }
        ]
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "responders": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_responders"
          }
        ]
      },
      "user_defined_fields": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "user_defined_field"
          }
        ]
      }
    },
    "type": "incidents"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Create an incident returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentCreateAttributes;
use datadog_api_client::datadogV2::model::IncidentCreateData;
use datadog_api_client::datadogV2::model::IncidentCreateRelationships;
use datadog_api_client::datadogV2::model::IncidentCreateRequest;
use datadog_api_client::datadogV2::model::IncidentFieldAttributes;
use datadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValue;
use datadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValueType;
use datadog_api_client::datadogV2::model::IncidentType;
use datadog_api_client::datadogV2::model::NullableRelationshipToUser;
use datadog_api_client::datadogV2::model::NullableRelationshipToUserData;
use datadog_api_client::datadogV2::model::UsersType;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    // there is a valid "user" in the system
    let user_data_id = std::env::var("USER_DATA_ID").unwrap();
    let body = IncidentCreateRequest::new(
        IncidentCreateData::new(
            IncidentCreateAttributes::new(false, "Example-Incident".to_string()).fields(
                BTreeMap::from([(
                    "state".to_string(),
                    IncidentFieldAttributes::IncidentFieldAttributesSingleValue(Box::new(
                        IncidentFieldAttributesSingleValue::new()
                            .type_(IncidentFieldAttributesSingleValueType::DROPDOWN)
                            .value(Some("resolved".to_string())),
                    )),
                )]),
            ),
            IncidentType::INCIDENTS,
        )
        .relationships(IncidentCreateRelationships::new(Some(
            NullableRelationshipToUser::new(Some(NullableRelationshipToUserData::new(
                user_data_id.clone(),
                UsersType::USERS,
            ))),
        ))),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.create_incident(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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}https://api.datadoghq.eu/api/v2/incidents/{incident_id}https://api.ddog-gov.com/api/v2/incidents/{incident_id}https://api.datadoghq.com/api/v2/incidents/{incident_id}https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}

개요

Get the details of an incident by incident_id. This endpoint requires the incident_read permission.

OAuth apps require the incident_read authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

쿼리 문자열

이름

유형

설명

include

array

Specifies which types of related objects should be included in the response.

응답

OK

Response with an incident.

Expand All

항목

유형

설명

data [required]

object

Incident data from a response.

attributes

object

The incident's attributes from a response.

archived

date-time

Timestamp of when the incident was archived.

case_id

int64

The incident case id.

created

date-time

Timestamp when the incident was created.

customer_impact_duration

int64

Length of the incident's customer impact in seconds. Equals the difference between customer_impact_start and customer_impact_end.

customer_impact_end

date-time

Timestamp when customers were no longer impacted by the incident.

customer_impact_scope

string

A summary of the impact customers experienced during the incident.

customer_impact_start

date-time

Timestamp when customers began being impacted by the incident.

customer_impacted

boolean

A flag indicating whether the incident caused customer impact.

detected

date-time

Timestamp when the incident was detected.

fields

object

A condensed view of the user-defined fields attached to incidents.

<any-key>

 <oneOf>

Dynamic fields for which selections can be made, with field names as keys.

Option 1

object

A field with a single value selected.

type

enum

Type of the single value field definitions. Allowed enum values: dropdown,textbox

default: dropdown

value

string

The single value selected for this field.

Option 2

object

A field with potentially multiple values selected.

type

enum

Type of the multiple value field definitions. Allowed enum values: multiselect,textarray,metrictag,autocomplete

default: multiselect

value

[string]

The multiple values selected for this field.

incident_type_uuid

string

A unique identifier that represents an incident type.

modified

date-time

Timestamp when the incident was last modified.

non_datadog_creator

object

Incident's non Datadog creator.

image_48_px

string

Non Datadog creator 48px image.

name

string

Non Datadog creator name.

notification_handles

[object]

Notification handles that will be notified of the incident during update.

display_name

string

The name of the notified handle.

handle

string

The handle used for the notification. This includes an email address, Slack channel, or workflow.

public_id

int64

The monotonically increasing integer ID for the incident.

resolved

date-time

Timestamp when the incident's state was last changed from active or stable to resolved or completed.

severity

enum

The incident severity. Allowed enum values: UNKNOWN,SEV-1,SEV-2,SEV-3,SEV-4,SEV-5

state

string

The state incident.

time_to_detect

int64

The amount of time in seconds to detect the incident. Equals the difference between customer_impact_start and detected.

time_to_internal_response

int64

The amount of time in seconds to call incident after detection. Equals the difference of detected and created.

time_to_repair

int64

The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between customer_impact_end and detected.

time_to_resolve

int64

The amount of time in seconds to resolve the incident after it was created. Equals the difference between created and resolved.

title [required]

string

The title of the incident, which summarizes what happened.

visibility

string

The incident visibility status.

id [required]

string

The incident's ID.

relationships

object

The incident's relationships from a response.

attachments

object

A relationship reference for attachments.

data [required]

[object]

An array of incident attachments.

id [required]

string

A unique identifier that represents the attachment.

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

commander_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

impacts

object

Relationship to impacts.

data [required]

[object]

An array of incident impacts.

id [required]

string

A unique identifier that represents the impact.

type [required]

enum

The incident impacts type. Allowed enum values: incident_impacts

integrations

object

A relationship reference for multiple integration metadata objects.

data [required]

[object]

Integration metadata relationship array

id [required]

string

A unique identifier that represents the integration metadata.

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

responders

object

Relationship to incident responders.

data [required]

[object]

An array of incident responders.

id [required]

string

A unique identifier that represents the responder.

type [required]

enum

The incident responders type. Allowed enum values: incident_responders

user_defined_fields

object

Relationship to incident user defined fields.

data [required]

[object]

An array of user defined fields.

id [required]

string

A unique identifier that represents the responder.

type [required]

enum

The incident user defined fields type. Allowed enum values: user_defined_field

type [required]

enum

Incident resource type. Allowed enum values: incidents

default: incidents

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

name

string

Name of the user.

uuid

string

UUID of the user.

id

string

ID of the user.

type

enum

Users resource type. Allowed enum values: users

default: users

Option 2

object

A single incident attachment.

attributes [required]

 <oneOf>

The attributes object for an attachment.

Option 1

object

The attributes object for a postmortem attachment.

attachment [required]

object

The postmortem attachment.

documentUrl [required]

string

The URL of this notebook attachment.

title [required]

string

The title of this postmortem attachment.

attachment_type [required]

enum

The type of postmortem attachment attributes. Allowed enum values: postmortem

default: postmortem

Option 2

object

The attributes object for a link attachment.

attachment [required]

object

The link attachment.

documentUrl [required]

string

The URL of this link attachment.

title [required]

string

The title of this link attachment.

attachment_type [required]

enum

The type of link attachment attributes. Allowed enum values: link

default: link

modified

date-time

Timestamp when the incident attachment link was last modified.

id [required]

string

A unique identifier that represents the incident attachment.

relationships [required]

object

The incident attachment's relationships.

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

{
  "data": {
    "attributes": {
      "archived": "2019-09-19T10:00:00.000Z",
      "case_id": "integer",
      "created": "2019-09-19T10:00:00.000Z",
      "customer_impact_duration": "integer",
      "customer_impact_end": "2019-09-19T10:00:00.000Z",
      "customer_impact_scope": "An example customer impact scope",
      "customer_impact_start": "2019-09-19T10:00:00.000Z",
      "customer_impacted": false,
      "detected": "2019-09-19T10:00:00.000Z",
      "fields": {
        "<any-key>": "undefined"
      },
      "incident_type_uuid": "00000000-0000-0000-0000-000000000000",
      "modified": "2019-09-19T10:00:00.000Z",
      "non_datadog_creator": {
        "image_48_px": "string",
        "name": "string"
      },
      "notification_handles": [
        {
          "display_name": "Jane Doe",
          "handle": "@test.user@test.com"
        }
      ],
      "public_id": 1,
      "resolved": "2019-09-19T10:00:00.000Z",
      "severity": "UNKNOWN",
      "state": "string",
      "time_to_detect": "integer",
      "time_to_internal_response": "integer",
      "time_to_repair": "integer",
      "time_to_resolve": "integer",
      "title": "A test incident title",
      "visibility": "string"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "attachments": {
        "data": [
          {
            "id": "00000000-0000-abcd-1000-000000000000",
            "type": "incident_attachments"
          }
        ]
      },
      "commander_user": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      },
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "impacts": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_impacts"
          }
        ]
      },
      "integrations": {
        "data": [
          {
            "id": "00000000-abcd-0001-0000-000000000000",
            "type": "incident_integrations"
          }
        ]
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "responders": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_responders"
          }
        ]
      },
      "user_defined_fields": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "user_defined_field"
          }
        ]
      }
    },
    "type": "incidents"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Get the details of an incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::GetIncidentOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .get_incident(
            incident_data_id.clone(),
            GetIncidentOptionalParams::default(),
        )
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

PATCH https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}https://api.datadoghq.eu/api/v2/incidents/{incident_id}https://api.ddog-gov.com/api/v2/incidents/{incident_id}https://api.datadoghq.com/api/v2/incidents/{incident_id}https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}

개요

Updates an incident. Provide only the attributes that should be updated as this request is a partial update. This endpoint requires the incident_write permission.

OAuth apps require the incident_write authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

쿼리 문자열

이름

유형

설명

include

array

Specifies which types of related objects should be included in the response.

요청

Body Data (required)

Incident Payload.

Expand All

항목

유형

설명

data [required]

object

Incident data for an update request.

attributes

object

The incident's attributes for an update request.

customer_impact_end

date-time

Timestamp when customers were no longer impacted by the incident.

customer_impact_scope

string

A summary of the impact customers experienced during the incident.

customer_impact_start

date-time

Timestamp when customers began being impacted by the incident.

customer_impacted

boolean

A flag indicating whether the incident caused customer impact.

detected

date-time

Timestamp when the incident was detected.

fields

object

A condensed view of the user-defined fields for which to update selections.

<any-key>

 <oneOf>

Dynamic fields for which selections can be made, with field names as keys.

Option 1

object

A field with a single value selected.

type

enum

Type of the single value field definitions. Allowed enum values: dropdown,textbox

default: dropdown

value

string

The single value selected for this field.

Option 2

object

A field with potentially multiple values selected.

type

enum

Type of the multiple value field definitions. Allowed enum values: multiselect,textarray,metrictag,autocomplete

default: multiselect

value

[string]

The multiple values selected for this field.

notification_handles

[object]

Notification handles that will be notified of the incident during update.

display_name

string

The name of the notified handle.

handle

string

The handle used for the notification. This includes an email address, Slack channel, or workflow.

title

string

The title of the incident, which summarizes what happened.

id [required]

string

The incident's ID.

relationships

object

The incident's relationships for an update request.

commander_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

integrations

object

A relationship reference for multiple integration metadata objects.

data [required]

[object]

Integration metadata relationship array

id [required]

string

A unique identifier that represents the integration metadata.

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

postmortem

object

A relationship reference for postmortems.

data [required]

object

The postmortem relationship data.

id [required]

string

A unique identifier that represents the postmortem.

type [required]

enum

Incident postmortem resource type. Allowed enum values: incident_postmortems

default: incident_postmortems

type [required]

enum

Incident resource type. Allowed enum values: incidents

default: incidents

{
  "data": {
    "id": "00000000-0000-0000-1234-000000000000",
    "type": "incidents",
    "relationships": {
      "commander_user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    }
  }
}
{
  "data": {
    "id": "00000000-0000-0000-1234-000000000000",
    "type": "incidents",
    "relationships": {
      "commander_user": {
        "data": null
      }
    }
  }
}
{
  "data": {
    "id": "00000000-0000-0000-1234-000000000000",
    "type": "incidents",
    "attributes": {
      "fields": {
        "state": {
          "type": "dropdown",
          "value": "resolved"
        }
      },
      "title": "A test incident title-updated"
    }
  }
}

응답

OK

Response with an incident.

Expand All

항목

유형

설명

data [required]

object

Incident data from a response.

attributes

object

The incident's attributes from a response.

archived

date-time

Timestamp of when the incident was archived.

case_id

int64

The incident case id.

created

date-time

Timestamp when the incident was created.

customer_impact_duration

int64

Length of the incident's customer impact in seconds. Equals the difference between customer_impact_start and customer_impact_end.

customer_impact_end

date-time

Timestamp when customers were no longer impacted by the incident.

customer_impact_scope

string

A summary of the impact customers experienced during the incident.

customer_impact_start

date-time

Timestamp when customers began being impacted by the incident.

customer_impacted

boolean

A flag indicating whether the incident caused customer impact.

detected

date-time

Timestamp when the incident was detected.

fields

object

A condensed view of the user-defined fields attached to incidents.

<any-key>

 <oneOf>

Dynamic fields for which selections can be made, with field names as keys.

Option 1

object

A field with a single value selected.

type

enum

Type of the single value field definitions. Allowed enum values: dropdown,textbox

default: dropdown

value

string

The single value selected for this field.

Option 2

object

A field with potentially multiple values selected.

type

enum

Type of the multiple value field definitions. Allowed enum values: multiselect,textarray,metrictag,autocomplete

default: multiselect

value

[string]

The multiple values selected for this field.

incident_type_uuid

string

A unique identifier that represents an incident type.

modified

date-time

Timestamp when the incident was last modified.

non_datadog_creator

object

Incident's non Datadog creator.

image_48_px

string

Non Datadog creator 48px image.

name

string

Non Datadog creator name.

notification_handles

[object]

Notification handles that will be notified of the incident during update.

display_name

string

The name of the notified handle.

handle

string

The handle used for the notification. This includes an email address, Slack channel, or workflow.

public_id

int64

The monotonically increasing integer ID for the incident.

resolved

date-time

Timestamp when the incident's state was last changed from active or stable to resolved or completed.

severity

enum

The incident severity. Allowed enum values: UNKNOWN,SEV-1,SEV-2,SEV-3,SEV-4,SEV-5

state

string

The state incident.

time_to_detect

int64

The amount of time in seconds to detect the incident. Equals the difference between customer_impact_start and detected.

time_to_internal_response

int64

The amount of time in seconds to call incident after detection. Equals the difference of detected and created.

time_to_repair

int64

The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between customer_impact_end and detected.

time_to_resolve

int64

The amount of time in seconds to resolve the incident after it was created. Equals the difference between created and resolved.

title [required]

string

The title of the incident, which summarizes what happened.

visibility

string

The incident visibility status.

id [required]

string

The incident's ID.

relationships

object

The incident's relationships from a response.

attachments

object

A relationship reference for attachments.

data [required]

[object]

An array of incident attachments.

id [required]

string

A unique identifier that represents the attachment.

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

commander_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

impacts

object

Relationship to impacts.

data [required]

[object]

An array of incident impacts.

id [required]

string

A unique identifier that represents the impact.

type [required]

enum

The incident impacts type. Allowed enum values: incident_impacts

integrations

object

A relationship reference for multiple integration metadata objects.

data [required]

[object]

Integration metadata relationship array

id [required]

string

A unique identifier that represents the integration metadata.

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

responders

object

Relationship to incident responders.

data [required]

[object]

An array of incident responders.

id [required]

string

A unique identifier that represents the responder.

type [required]

enum

The incident responders type. Allowed enum values: incident_responders

user_defined_fields

object

Relationship to incident user defined fields.

data [required]

[object]

An array of user defined fields.

id [required]

string

A unique identifier that represents the responder.

type [required]

enum

The incident user defined fields type. Allowed enum values: user_defined_field

type [required]

enum

Incident resource type. Allowed enum values: incidents

default: incidents

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

name

string

Name of the user.

uuid

string

UUID of the user.

id

string

ID of the user.

type

enum

Users resource type. Allowed enum values: users

default: users

Option 2

object

A single incident attachment.

attributes [required]

 <oneOf>

The attributes object for an attachment.

Option 1

object

The attributes object for a postmortem attachment.

attachment [required]

object

The postmortem attachment.

documentUrl [required]

string

The URL of this notebook attachment.

title [required]

string

The title of this postmortem attachment.

attachment_type [required]

enum

The type of postmortem attachment attributes. Allowed enum values: postmortem

default: postmortem

Option 2

object

The attributes object for a link attachment.

attachment [required]

object

The link attachment.

documentUrl [required]

string

The URL of this link attachment.

title [required]

string

The title of this link attachment.

attachment_type [required]

enum

The type of link attachment attributes. Allowed enum values: link

default: link

modified

date-time

Timestamp when the incident attachment link was last modified.

id [required]

string

A unique identifier that represents the incident attachment.

relationships [required]

object

The incident attachment's relationships.

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

{
  "data": {
    "attributes": {
      "archived": "2019-09-19T10:00:00.000Z",
      "case_id": "integer",
      "created": "2019-09-19T10:00:00.000Z",
      "customer_impact_duration": "integer",
      "customer_impact_end": "2019-09-19T10:00:00.000Z",
      "customer_impact_scope": "An example customer impact scope",
      "customer_impact_start": "2019-09-19T10:00:00.000Z",
      "customer_impacted": false,
      "detected": "2019-09-19T10:00:00.000Z",
      "fields": {
        "<any-key>": "undefined"
      },
      "incident_type_uuid": "00000000-0000-0000-0000-000000000000",
      "modified": "2019-09-19T10:00:00.000Z",
      "non_datadog_creator": {
        "image_48_px": "string",
        "name": "string"
      },
      "notification_handles": [
        {
          "display_name": "Jane Doe",
          "handle": "@test.user@test.com"
        }
      ],
      "public_id": 1,
      "resolved": "2019-09-19T10:00:00.000Z",
      "severity": "UNKNOWN",
      "state": "string",
      "time_to_detect": "integer",
      "time_to_internal_response": "integer",
      "time_to_repair": "integer",
      "time_to_resolve": "integer",
      "title": "A test incident title",
      "visibility": "string"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "attachments": {
        "data": [
          {
            "id": "00000000-0000-abcd-1000-000000000000",
            "type": "incident_attachments"
          }
        ]
      },
      "commander_user": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      },
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "impacts": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_impacts"
          }
        ]
      },
      "integrations": {
        "data": [
          {
            "id": "00000000-abcd-0001-0000-000000000000",
            "type": "incident_integrations"
          }
        ]
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "responders": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_responders"
          }
        ]
      },
      "user_defined_fields": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "user_defined_field"
          }
        ]
      }
    },
    "type": "incidents"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Add commander to an incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams;
use datadog_api_client::datadogV2::model::IncidentType;
use datadog_api_client::datadogV2::model::IncidentUpdateData;
use datadog_api_client::datadogV2::model::IncidentUpdateRelationships;
use datadog_api_client::datadogV2::model::IncidentUpdateRequest;
use datadog_api_client::datadogV2::model::NullableRelationshipToUser;
use datadog_api_client::datadogV2::model::NullableRelationshipToUserData;
use datadog_api_client::datadogV2::model::UsersType;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // there is a valid "user" in the system
    let user_data_id = std::env::var("USER_DATA_ID").unwrap();
    let body = IncidentUpdateRequest::new(
        IncidentUpdateData::new(incident_data_id.clone(), IncidentType::INCIDENTS).relationships(
            IncidentUpdateRelationships::new().commander_user(Some(
                NullableRelationshipToUser::new(Some(NullableRelationshipToUserData::new(
                    user_data_id.clone(),
                    UsersType::USERS,
                ))),
            )),
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident(
            incident_data_id.clone(),
            body,
            UpdateIncidentOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
// Remove commander from an incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams;
use datadog_api_client::datadogV2::model::IncidentType;
use datadog_api_client::datadogV2::model::IncidentUpdateData;
use datadog_api_client::datadogV2::model::IncidentUpdateRelationships;
use datadog_api_client::datadogV2::model::IncidentUpdateRequest;
use datadog_api_client::datadogV2::model::NullableRelationshipToUser;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let body = IncidentUpdateRequest::new(
        IncidentUpdateData::new(incident_data_id.clone(), IncidentType::INCIDENTS).relationships(
            IncidentUpdateRelationships::new()
                .commander_user(Some(NullableRelationshipToUser::new(None))),
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident(
            incident_data_id.clone(),
            body,
            UpdateIncidentOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
// Update an existing incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams;
use datadog_api_client::datadogV2::model::IncidentFieldAttributes;
use datadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValue;
use datadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValueType;
use datadog_api_client::datadogV2::model::IncidentType;
use datadog_api_client::datadogV2::model::IncidentUpdateAttributes;
use datadog_api_client::datadogV2::model::IncidentUpdateData;
use datadog_api_client::datadogV2::model::IncidentUpdateRequest;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let body = IncidentUpdateRequest::new(
        IncidentUpdateData::new(incident_data_id.clone(), IncidentType::INCIDENTS).attributes(
            IncidentUpdateAttributes::new()
                .fields(BTreeMap::from([(
                    "state".to_string(),
                    IncidentFieldAttributes::IncidentFieldAttributesSingleValue(Box::new(
                        IncidentFieldAttributesSingleValue::new()
                            .type_(IncidentFieldAttributesSingleValueType::DROPDOWN)
                            .value(Some("resolved".to_string())),
                    )),
                )]))
                .title("A test incident title-updated".to_string()),
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident(
            incident_data_id.clone(),
            body,
            UpdateIncidentOptionalParams::default(),
        )
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

DELETE https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}https://api.datadoghq.eu/api/v2/incidents/{incident_id}https://api.ddog-gov.com/api/v2/incidents/{incident_id}https://api.datadoghq.com/api/v2/incidents/{incident_id}https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}

개요

Deletes an existing incident from the users organization. This endpoint requires the incident_write permission.

OAuth apps require the incident_write authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

응답

OK

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Delete an existing incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.delete_incident(incident_data_id.clone()).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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/incidentshttps://api.datadoghq.eu/api/v2/incidentshttps://api.ddog-gov.com/api/v2/incidentshttps://api.datadoghq.com/api/v2/incidentshttps://api.us3.datadoghq.com/api/v2/incidentshttps://api.us5.datadoghq.com/api/v2/incidents

개요

Get all incidents for the user’s organization. This endpoint requires the incident_read permission.

OAuth apps require the incident_read authorization scope to access this endpoint.

인수

쿼리 문자열

이름

유형

설명

include

array

Specifies which types of related objects should be included in the response.

page[size]

integer

Size for a given page. The maximum allowed value is 100.

page[offset]

integer

Specific offset to use as the beginning of the returned page.

응답

OK

Response with a list of incidents.

Expand All

항목

유형

설명

data [required]

[object]

An array of incidents.

attributes

object

The incident's attributes from a response.

archived

date-time

Timestamp of when the incident was archived.

case_id

int64

The incident case id.

created

date-time

Timestamp when the incident was created.

customer_impact_duration

int64

Length of the incident's customer impact in seconds. Equals the difference between customer_impact_start and customer_impact_end.

customer_impact_end

date-time

Timestamp when customers were no longer impacted by the incident.

customer_impact_scope

string

A summary of the impact customers experienced during the incident.

customer_impact_start

date-time

Timestamp when customers began being impacted by the incident.

customer_impacted

boolean

A flag indicating whether the incident caused customer impact.

detected

date-time

Timestamp when the incident was detected.

fields

object

A condensed view of the user-defined fields attached to incidents.

<any-key>

 <oneOf>

Dynamic fields for which selections can be made, with field names as keys.

Option 1

object

A field with a single value selected.

type

enum

Type of the single value field definitions. Allowed enum values: dropdown,textbox

default: dropdown

value

string

The single value selected for this field.

Option 2

object

A field with potentially multiple values selected.

type

enum

Type of the multiple value field definitions. Allowed enum values: multiselect,textarray,metrictag,autocomplete

default: multiselect

value

[string]

The multiple values selected for this field.

incident_type_uuid

string

A unique identifier that represents an incident type.

modified

date-time

Timestamp when the incident was last modified.

non_datadog_creator

object

Incident's non Datadog creator.

image_48_px

string

Non Datadog creator 48px image.

name

string

Non Datadog creator name.

notification_handles

[object]

Notification handles that will be notified of the incident during update.

display_name

string

The name of the notified handle.

handle

string

The handle used for the notification. This includes an email address, Slack channel, or workflow.

public_id

int64

The monotonically increasing integer ID for the incident.

resolved

date-time

Timestamp when the incident's state was last changed from active or stable to resolved or completed.

severity

enum

The incident severity. Allowed enum values: UNKNOWN,SEV-1,SEV-2,SEV-3,SEV-4,SEV-5

state

string

The state incident.

time_to_detect

int64

The amount of time in seconds to detect the incident. Equals the difference between customer_impact_start and detected.

time_to_internal_response

int64

The amount of time in seconds to call incident after detection. Equals the difference of detected and created.

time_to_repair

int64

The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between customer_impact_end and detected.

time_to_resolve

int64

The amount of time in seconds to resolve the incident after it was created. Equals the difference between created and resolved.

title [required]

string

The title of the incident, which summarizes what happened.

visibility

string

The incident visibility status.

id [required]

string

The incident's ID.

relationships

object

The incident's relationships from a response.

attachments

object

A relationship reference for attachments.

data [required]

[object]

An array of incident attachments.

id [required]

string

A unique identifier that represents the attachment.

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

commander_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

impacts

object

Relationship to impacts.

data [required]

[object]

An array of incident impacts.

id [required]

string

A unique identifier that represents the impact.

type [required]

enum

The incident impacts type. Allowed enum values: incident_impacts

integrations

object

A relationship reference for multiple integration metadata objects.

data [required]

[object]

Integration metadata relationship array

id [required]

string

A unique identifier that represents the integration metadata.

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

responders

object

Relationship to incident responders.

data [required]

[object]

An array of incident responders.

id [required]

string

A unique identifier that represents the responder.

type [required]

enum

The incident responders type. Allowed enum values: incident_responders

user_defined_fields

object

Relationship to incident user defined fields.

data [required]

[object]

An array of user defined fields.

id [required]

string

A unique identifier that represents the responder.

type [required]

enum

The incident user defined fields type. Allowed enum values: user_defined_field

type [required]

enum

Incident resource type. Allowed enum values: incidents

default: incidents

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

name

string

Name of the user.

uuid

string

UUID of the user.

id

string

ID of the user.

type

enum

Users resource type. Allowed enum values: users

default: users

Option 2

object

A single incident attachment.

attributes [required]

 <oneOf>

The attributes object for an attachment.

Option 1

object

The attributes object for a postmortem attachment.

attachment [required]

object

The postmortem attachment.

documentUrl [required]

string

The URL of this notebook attachment.

title [required]

string

The title of this postmortem attachment.

attachment_type [required]

enum

The type of postmortem attachment attributes. Allowed enum values: postmortem

default: postmortem

Option 2

object

The attributes object for a link attachment.

attachment [required]

object

The link attachment.

documentUrl [required]

string

The URL of this link attachment.

title [required]

string

The title of this link attachment.

attachment_type [required]

enum

The type of link attachment attributes. Allowed enum values: link

default: link

modified

date-time

Timestamp when the incident attachment link was last modified.

id [required]

string

A unique identifier that represents the incident attachment.

relationships [required]

object

The incident attachment's relationships.

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

meta

object

The metadata object containing pagination metadata.

pagination

object

Pagination properties.

next_offset

int64

The index of the first element in the next page of results. Equal to page size added to the current offset.

offset

int64

The index of the first element in the results.

size

int64

Maximum size of pages to return.

{
  "data": [
    {
      "attributes": {
        "archived": "2019-09-19T10:00:00.000Z",
        "case_id": "integer",
        "created": "2019-09-19T10:00:00.000Z",
        "customer_impact_duration": "integer",
        "customer_impact_end": "2019-09-19T10:00:00.000Z",
        "customer_impact_scope": "An example customer impact scope",
        "customer_impact_start": "2019-09-19T10:00:00.000Z",
        "customer_impacted": false,
        "detected": "2019-09-19T10:00:00.000Z",
        "fields": {
          "<any-key>": "undefined"
        },
        "incident_type_uuid": "00000000-0000-0000-0000-000000000000",
        "modified": "2019-09-19T10:00:00.000Z",
        "non_datadog_creator": {
          "image_48_px": "string",
          "name": "string"
        },
        "notification_handles": [
          {
            "display_name": "Jane Doe",
            "handle": "@test.user@test.com"
          }
        ],
        "public_id": 1,
        "resolved": "2019-09-19T10:00:00.000Z",
        "severity": "UNKNOWN",
        "state": "string",
        "time_to_detect": "integer",
        "time_to_internal_response": "integer",
        "time_to_repair": "integer",
        "time_to_resolve": "integer",
        "title": "A test incident title",
        "visibility": "string"
      },
      "id": "00000000-0000-0000-1234-000000000000",
      "relationships": {
        "attachments": {
          "data": [
            {
              "id": "00000000-0000-abcd-1000-000000000000",
              "type": "incident_attachments"
            }
          ]
        },
        "commander_user": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "users"
          }
        },
        "created_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "impacts": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "incident_impacts"
            }
          ]
        },
        "integrations": {
          "data": [
            {
              "id": "00000000-abcd-0001-0000-000000000000",
              "type": "incident_integrations"
            }
          ]
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "responders": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "incident_responders"
            }
          ]
        },
        "user_defined_fields": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "user_defined_field"
            }
          ]
        }
      },
      "type": "incidents"
    }
  ],
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ],
  "meta": {
    "pagination": {
      "next_offset": 1000,
      "offset": 10,
      "size": 1000
    }
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Get a list of incidents returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::ListIncidentsOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidents", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .list_incidents(ListIncidentsOptionalParams::default())
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/incidents/searchhttps://api.datadoghq.eu/api/v2/incidents/searchhttps://api.ddog-gov.com/api/v2/incidents/searchhttps://api.datadoghq.com/api/v2/incidents/searchhttps://api.us3.datadoghq.com/api/v2/incidents/searchhttps://api.us5.datadoghq.com/api/v2/incidents/search

개요

Search for incidents matching a certain query. This endpoint requires the incident_read permission.

OAuth apps require the incident_read authorization scope to access this endpoint.

인수

쿼리 문자열

이름

유형

설명

include

enum

Specifies which types of related objects should be included in the response.
Allowed enum values: users, attachments

query [required]

string

Specifies which incidents should be returned. The query can contain any number of incident facets joined by ANDs, along with multiple values for each of those facets joined by ORs. For example: state:active AND severity:(SEV-2 OR SEV-1).

sort

enum

Specifies the order of returned incidents.
Allowed enum values: created, -created

page[size]

integer

Size for a given page. The maximum allowed value is 100.

page[offset]

integer

Specific offset to use as the beginning of the returned page.

응답

OK

Response with incidents and facets.

Expand All

항목

유형

설명

data [required]

object

Data returned by an incident search.

attributes

object

Attributes returned by an incident search.

facets [required]

object

Facet data for incidents returned by a search query.

commander

[object]

Facet data for incident commander users.

count

int32

Count of the facet value appearing in search results.

email

string

Email of the user.

handle

string

Handle of the user.

name

string

Name of the user.

uuid

string

ID of the user.

created_by

[object]

Facet data for incident creator users.

count

int32

Count of the facet value appearing in search results.

email

string

Email of the user.

handle

string

Handle of the user.

name

string

Name of the user.

uuid

string

ID of the user.

fields

[object]

Facet data for incident property fields.

aggregates

object

Aggregate information for numeric incident data.

max

double

Maximum value of the numeric aggregates.

min

double

Minimum value of the numeric aggregates.

facets [required]

[object]

Facet data for the property field of an incident.

count

int32

Count of the facet value appearing in search results.

name

string

The facet value appearing in search results.

name [required]

string

Name of the incident property field.

impact

[object]

Facet data for incident impact attributes.

count

int32

Count of the facet value appearing in search results.

name

string

The facet value appearing in search results.

last_modified_by

[object]

Facet data for incident last modified by users.

count

int32

Count of the facet value appearing in search results.

email

string

Email of the user.

handle

string

Handle of the user.

name

string

Name of the user.

uuid

string

ID of the user.

postmortem

[object]

Facet data for incident postmortem existence.

count

int32

Count of the facet value appearing in search results.

name

string

The facet value appearing in search results.

responder

[object]

Facet data for incident responder users.

count

int32

Count of the facet value appearing in search results.

email

string

Email of the user.

handle

string

Handle of the user.

name

string

Name of the user.

uuid

string

ID of the user.

severity

[object]

Facet data for incident severity attributes.

count

int32

Count of the facet value appearing in search results.

name

string

The facet value appearing in search results.

state

[object]

Facet data for incident state attributes.

count

int32

Count of the facet value appearing in search results.

name

string

The facet value appearing in search results.

time_to_repair

[object]

Facet data for incident time to repair metrics.

aggregates [required]

object

Aggregate information for numeric incident data.

max

double

Maximum value of the numeric aggregates.

min

double

Minimum value of the numeric aggregates.

name [required]

string

Name of the incident property field.

time_to_resolve

[object]

Facet data for incident time to resolve metrics.

aggregates [required]

object

Aggregate information for numeric incident data.

max

double

Maximum value of the numeric aggregates.

min

double

Minimum value of the numeric aggregates.

name [required]

string

Name of the incident property field.

incidents [required]

[object]

Incidents returned by the search.

data [required]

object

Incident data from a response.

attributes

object

The incident's attributes from a response.

archived

date-time

Timestamp of when the incident was archived.

case_id

int64

The incident case id.

created

date-time

Timestamp when the incident was created.

customer_impact_duration

int64

Length of the incident's customer impact in seconds. Equals the difference between customer_impact_start and customer_impact_end.

customer_impact_end

date-time

Timestamp when customers were no longer impacted by the incident.

customer_impact_scope

string

A summary of the impact customers experienced during the incident.

customer_impact_start

date-time

Timestamp when customers began being impacted by the incident.

customer_impacted

boolean

A flag indicating whether the incident caused customer impact.

detected

date-time

Timestamp when the incident was detected.

fields

object

A condensed view of the user-defined fields attached to incidents.

<any-key>

 <oneOf>

Dynamic fields for which selections can be made, with field names as keys.

Option 1

object

A field with a single value selected.

type

enum

Type of the single value field definitions. Allowed enum values: dropdown,textbox

default: dropdown

value

string

The single value selected for this field.

Option 2

object

A field with potentially multiple values selected.

type

enum

Type of the multiple value field definitions. Allowed enum values: multiselect,textarray,metrictag,autocomplete

default: multiselect

value

[string]

The multiple values selected for this field.

incident_type_uuid

string

A unique identifier that represents an incident type.

modified

date-time

Timestamp when the incident was last modified.

non_datadog_creator

object

Incident's non Datadog creator.

image_48_px

string

Non Datadog creator 48px image.

name

string

Non Datadog creator name.

notification_handles

[object]

Notification handles that will be notified of the incident during update.

display_name

string

The name of the notified handle.

handle

string

The handle used for the notification. This includes an email address, Slack channel, or workflow.

public_id

int64

The monotonically increasing integer ID for the incident.

resolved

date-time

Timestamp when the incident's state was last changed from active or stable to resolved or completed.

severity

enum

The incident severity. Allowed enum values: UNKNOWN,SEV-1,SEV-2,SEV-3,SEV-4,SEV-5

state

string

The state incident.

time_to_detect

int64

The amount of time in seconds to detect the incident. Equals the difference between customer_impact_start and detected.

time_to_internal_response

int64

The amount of time in seconds to call incident after detection. Equals the difference of detected and created.

time_to_repair

int64

The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between customer_impact_end and detected.

time_to_resolve

int64

The amount of time in seconds to resolve the incident after it was created. Equals the difference between created and resolved.

title [required]

string

The title of the incident, which summarizes what happened.

visibility

string

The incident visibility status.

id [required]

string

The incident's ID.

relationships

object

The incident's relationships from a response.

attachments

object

A relationship reference for attachments.

data [required]

[object]

An array of incident attachments.

id [required]

string

A unique identifier that represents the attachment.

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

commander_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

impacts

object

Relationship to impacts.

data [required]

[object]

An array of incident impacts.

id [required]

string

A unique identifier that represents the impact.

type [required]

enum

The incident impacts type. Allowed enum values: incident_impacts

integrations

object

A relationship reference for multiple integration metadata objects.

data [required]

[object]

Integration metadata relationship array

id [required]

string

A unique identifier that represents the integration metadata.

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

responders

object

Relationship to incident responders.

data [required]

[object]

An array of incident responders.

id [required]

string

A unique identifier that represents the responder.

type [required]

enum

The incident responders type. Allowed enum values: incident_responders

user_defined_fields

object

Relationship to incident user defined fields.

data [required]

[object]

An array of user defined fields.

id [required]

string

A unique identifier that represents the responder.

type [required]

enum

The incident user defined fields type. Allowed enum values: user_defined_field

type [required]

enum

Incident resource type. Allowed enum values: incidents

default: incidents

total [required]

int32

Number of incidents returned by the search.

type

enum

Incident search result type. Allowed enum values: incidents_search_results

default: incidents_search_results

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

name

string

Name of the user.

uuid

string

UUID of the user.

id

string

ID of the user.

type

enum

Users resource type. Allowed enum values: users

default: users

Option 2

object

A single incident attachment.

attributes [required]

 <oneOf>

The attributes object for an attachment.

Option 1

object

The attributes object for a postmortem attachment.

attachment [required]

object

The postmortem attachment.

documentUrl [required]

string

The URL of this notebook attachment.

title [required]

string

The title of this postmortem attachment.

attachment_type [required]

enum

The type of postmortem attachment attributes. Allowed enum values: postmortem

default: postmortem

Option 2

object

The attributes object for a link attachment.

attachment [required]

object

The link attachment.

documentUrl [required]

string

The URL of this link attachment.

title [required]

string

The title of this link attachment.

attachment_type [required]

enum

The type of link attachment attributes. Allowed enum values: link

default: link

modified

date-time

Timestamp when the incident attachment link was last modified.

id [required]

string

A unique identifier that represents the incident attachment.

relationships [required]

object

The incident attachment's relationships.

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

meta

object

The metadata object containing pagination metadata.

pagination

object

Pagination properties.

next_offset

int64

The index of the first element in the next page of results. Equal to page size added to the current offset.

offset

int64

The index of the first element in the results.

size

int64

Maximum size of pages to return.

{
  "data": {
    "attributes": {
      "facets": {
        "commander": [
          {
            "count": 5,
            "email": "datadog.user@example.com",
            "handle": "@datadog.user@example.com",
            "name": "Datadog User",
            "uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"
          }
        ],
        "created_by": [
          {
            "count": 5,
            "email": "datadog.user@example.com",
            "handle": "@datadog.user@example.com",
            "name": "Datadog User",
            "uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"
          }
        ],
        "fields": [
          {
            "aggregates": {
              "max": 1234,
              "min": 20
            },
            "facets": [
              {
                "count": 5,
                "name": "SEV-2"
              }
            ],
            "name": "Severity"
          }
        ],
        "impact": [
          {
            "count": 5,
            "name": "SEV-2"
          }
        ],
        "last_modified_by": [
          {
            "count": 5,
            "email": "datadog.user@example.com",
            "handle": "@datadog.user@example.com",
            "name": "Datadog User",
            "uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"
          }
        ],
        "postmortem": [
          {
            "count": 5,
            "name": "SEV-2"
          }
        ],
        "responder": [
          {
            "count": 5,
            "email": "datadog.user@example.com",
            "handle": "@datadog.user@example.com",
            "name": "Datadog User",
            "uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"
          }
        ],
        "severity": [
          {
            "count": 5,
            "name": "SEV-2"
          }
        ],
        "state": [
          {
            "count": 5,
            "name": "SEV-2"
          }
        ],
        "time_to_repair": [
          {
            "aggregates": {
              "max": 1234,
              "min": 20
            },
            "name": "time_to_repair"
          }
        ],
        "time_to_resolve": [
          {
            "aggregates": {
              "max": 1234,
              "min": 20
            },
            "name": "time_to_repair"
          }
        ]
      },
      "incidents": [
        {
          "data": {
            "attributes": {
              "archived": "2019-09-19T10:00:00.000Z",
              "case_id": "integer",
              "created": "2019-09-19T10:00:00.000Z",
              "customer_impact_duration": "integer",
              "customer_impact_end": "2019-09-19T10:00:00.000Z",
              "customer_impact_scope": "An example customer impact scope",
              "customer_impact_start": "2019-09-19T10:00:00.000Z",
              "customer_impacted": false,
              "detected": "2019-09-19T10:00:00.000Z",
              "fields": {
                "<any-key>": "undefined"
              },
              "incident_type_uuid": "00000000-0000-0000-0000-000000000000",
              "modified": "2019-09-19T10:00:00.000Z",
              "non_datadog_creator": {
                "image_48_px": "string",
                "name": "string"
              },
              "notification_handles": [
                {
                  "display_name": "Jane Doe",
                  "handle": "@test.user@test.com"
                }
              ],
              "public_id": 1,
              "resolved": "2019-09-19T10:00:00.000Z",
              "severity": "UNKNOWN",
              "state": "string",
              "time_to_detect": "integer",
              "time_to_internal_response": "integer",
              "time_to_repair": "integer",
              "time_to_resolve": "integer",
              "title": "A test incident title",
              "visibility": "string"
            },
            "id": "00000000-0000-0000-1234-000000000000",
            "relationships": {
              "attachments": {
                "data": [
                  {
                    "id": "00000000-0000-abcd-1000-000000000000",
                    "type": "incident_attachments"
                  }
                ]
              },
              "commander_user": {
                "data": {
                  "id": "00000000-0000-0000-0000-000000000000",
                  "type": "users"
                }
              },
              "created_by_user": {
                "data": {
                  "id": "00000000-0000-0000-2345-000000000000",
                  "type": "users"
                }
              },
              "impacts": {
                "data": [
                  {
                    "id": "00000000-0000-0000-2345-000000000000",
                    "type": "incident_impacts"
                  }
                ]
              },
              "integrations": {
                "data": [
                  {
                    "id": "00000000-abcd-0001-0000-000000000000",
                    "type": "incident_integrations"
                  }
                ]
              },
              "last_modified_by_user": {
                "data": {
                  "id": "00000000-0000-0000-2345-000000000000",
                  "type": "users"
                }
              },
              "responders": {
                "data": [
                  {
                    "id": "00000000-0000-0000-2345-000000000000",
                    "type": "incident_responders"
                  }
                ]
              },
              "user_defined_fields": {
                "data": [
                  {
                    "id": "00000000-0000-0000-2345-000000000000",
                    "type": "user_defined_field"
                  }
                ]
              }
            },
            "type": "incidents"
          }
        }
      ],
      "total": 10
    },
    "type": "incidents_search_results"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ],
  "meta": {
    "pagination": {
      "next_offset": 1000,
      "offset": 10,
      "size": 1000
    }
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Search for incidents returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::SearchIncidentsOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.SearchIncidents", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .search_incidents(
            "state:(active OR stable OR resolved)".to_string(),
            SearchIncidentsOptionalParams::default(),
        )
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/attachmentshttps://api.datadoghq.eu/api/v2/incidents/{incident_id}/attachmentshttps://api.ddog-gov.com/api/v2/incidents/{incident_id}/attachmentshttps://api.datadoghq.com/api/v2/incidents/{incident_id}/attachmentshttps://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/attachmentshttps://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/attachments

개요

Get all attachments for a given incident. This endpoint requires the incident_read permission.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

쿼리 문자열

이름

유형

설명

include

array

Specifies which types of related objects are included in the response.

filter[attachment_type]

array

Specifies which types of attachments are included in the response.

응답

OK

The response object containing an incident’s attachments.

Expand All

항목

유형

설명

data [required]

[object]

An array of incident attachments.

attributes [required]

 <oneOf>

The attributes object for an attachment.

Option 1

object

The attributes object for a postmortem attachment.

attachment [required]

object

The postmortem attachment.

documentUrl [required]

string

The URL of this notebook attachment.

title [required]

string

The title of this postmortem attachment.

attachment_type [required]

enum

The type of postmortem attachment attributes. Allowed enum values: postmortem

default: postmortem

Option 2

object

The attributes object for a link attachment.

attachment [required]

object

The link attachment.

documentUrl [required]

string

The URL of this link attachment.

title [required]

string

The title of this link attachment.

attachment_type [required]

enum

The type of link attachment attributes. Allowed enum values: link

default: link

modified

date-time

Timestamp when the incident attachment link was last modified.

id [required]

string

A unique identifier that represents the incident attachment.

relationships [required]

object

The incident attachment's relationships.

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

created_at

date-time

Creation time of the user.

disabled

boolean

Whether the user is disabled.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

mfa_enabled

boolean

If user has MFA enabled.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

service_account

boolean

Whether the user is a service account.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id

string

ID of the user.

relationships

object

Relationships of the user object returned by the API.

org

object

Relationship to an organization.

data [required]

object

Relationship to organization object.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_orgs

object

Relationship to organizations.

data [required]

[object]

Relationships to organization objects.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_users

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

roles

object

Relationship to roles.

data

[object]

An array containing type and the unique identifier of a role.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

type

enum

Users resource type. Allowed enum values: users

default: users

{
  "data": [
    {
      "attributes": {
        "attachment": {
          "documentUrl": "",
          "title": "Postmortem IR-123"
        },
        "attachment_type": "postmortem"
      },
      "id": "00000000-abcd-0001-0000-000000000000",
      "relationships": {
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        }
      },
      "type": "incident_attachments"
    }
  ],
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Get a list of attachments returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::ListIncidentAttachmentsOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidentAttachments", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .list_incident_attachments(
            "incident_id".to_string(),
            ListIncidentAttachmentsOptionalParams::default(),
        )
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

PATCH https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/attachmentshttps://api.datadoghq.eu/api/v2/incidents/{incident_id}/attachmentshttps://api.ddog-gov.com/api/v2/incidents/{incident_id}/attachmentshttps://api.datadoghq.com/api/v2/incidents/{incident_id}/attachmentshttps://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/attachmentshttps://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/attachments

개요

The bulk update endpoint for creating, updating, and deleting attachments for a given incident. This endpoint requires the incident_write permission.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

쿼리 문자열

이름

유형

설명

include

array

Specifies which types of related objects are included in the response.

요청

Body Data (required)

Incident Attachment Payload.

Expand All

항목

유형

설명

data [required]

[object]

An array of incident attachments. An attachment object without an "id" key indicates that you want to create that attachment. An attachment object without an "attributes" key indicates that you want to delete that attachment. An attachment object with both the "id" key and a populated "attributes" object indicates that you want to update that attachment.

attributes

 <oneOf>

Incident attachment attributes.

Option 1

object

The attributes object for a postmortem attachment.

attachment [required]

object

The postmortem attachment.

documentUrl [required]

string

The URL of this notebook attachment.

title [required]

string

The title of this postmortem attachment.

attachment_type [required]

enum

The type of postmortem attachment attributes. Allowed enum values: postmortem

default: postmortem

Option 2

object

The attributes object for a link attachment.

attachment [required]

object

The link attachment.

documentUrl [required]

string

The URL of this link attachment.

title [required]

string

The title of this link attachment.

attachment_type [required]

enum

The type of link attachment attributes. Allowed enum values: link

default: link

modified

date-time

Timestamp when the incident attachment link was last modified.

id

string

A unique identifier that represents the incident attachment.

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

{
  "data": [
    {
      "type": "incident_attachments",
      "attributes": {
        "attachment_type": "link",
        "attachment": {
          "documentUrl": "https://www.example.com/doc",
          "title": "Example-Incident"
        }
      }
    }
  ]
}

응답

OK

The response object containing the created or updated incident attachments.

Expand All

항목

유형

설명

data [required]

[object]

An array of incident attachments. Only the attachments that were created or updated by the request are returned.

attributes [required]

 <oneOf>

The attributes object for an attachment.

Option 1

object

The attributes object for a postmortem attachment.

attachment [required]

object

The postmortem attachment.

documentUrl [required]

string

The URL of this notebook attachment.

title [required]

string

The title of this postmortem attachment.

attachment_type [required]

enum

The type of postmortem attachment attributes. Allowed enum values: postmortem

default: postmortem

Option 2

object

The attributes object for a link attachment.

attachment [required]

object

The link attachment.

documentUrl [required]

string

The URL of this link attachment.

title [required]

string

The title of this link attachment.

attachment_type [required]

enum

The type of link attachment attributes. Allowed enum values: link

default: link

modified

date-time

Timestamp when the incident attachment link was last modified.

id [required]

string

A unique identifier that represents the incident attachment.

relationships [required]

object

The incident attachment's relationships.

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

The incident attachment resource type. Allowed enum values: incident_attachments

default: incident_attachments

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

created_at

date-time

Creation time of the user.

disabled

boolean

Whether the user is disabled.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

mfa_enabled

boolean

If user has MFA enabled.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

service_account

boolean

Whether the user is a service account.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id

string

ID of the user.

relationships

object

Relationships of the user object returned by the API.

org

object

Relationship to an organization.

data [required]

object

Relationship to organization object.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_orgs

object

Relationship to organizations.

data [required]

[object]

Relationships to organization objects.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_users

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

roles

object

Relationship to roles.

data

[object]

An array containing type and the unique identifier of a role.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

type

enum

Users resource type. Allowed enum values: users

default: users

{
  "data": [
    {
      "attributes": {
        "attachment": {
          "documentUrl": "",
          "title": "Postmortem IR-123"
        },
        "attachment_type": "postmortem"
      },
      "id": "00000000-abcd-0001-0000-000000000000",
      "relationships": {
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        }
      },
      "type": "incident_attachments"
    }
  ],
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Create an incident attachment returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentAttachmentsOptionalParams;
use datadog_api_client::datadogV2::model::IncidentAttachmentLinkAttachmentType;
use datadog_api_client::datadogV2::model::IncidentAttachmentLinkAttributes;
use datadog_api_client::datadogV2::model::IncidentAttachmentLinkAttributesAttachmentObject;
use datadog_api_client::datadogV2::model::IncidentAttachmentType;
use datadog_api_client::datadogV2::model::IncidentAttachmentUpdateAttributes;
use datadog_api_client::datadogV2::model::IncidentAttachmentUpdateData;
use datadog_api_client::datadogV2::model::IncidentAttachmentUpdateRequest;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let body = IncidentAttachmentUpdateRequest::new(vec![IncidentAttachmentUpdateData::new(
        IncidentAttachmentType::INCIDENT_ATTACHMENTS,
    )
    .attributes(
        IncidentAttachmentUpdateAttributes::IncidentAttachmentLinkAttributes(Box::new(
            IncidentAttachmentLinkAttributes::new(
                IncidentAttachmentLinkAttributesAttachmentObject::new(
                    "https://www.example.com/doc".to_string(),
                    "Example-Incident".to_string(),
                ),
                IncidentAttachmentLinkAttachmentType::LINK,
            ),
        )),
    )]);
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncidentAttachments", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident_attachments(
            incident_data_id.clone(),
            body,
            UpdateIncidentAttachmentsOptionalParams::default(),
        )
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrationshttps://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/integrationshttps://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/integrationshttps://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrationshttps://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrationshttps://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations

개요

Get all integration metadata for an incident. This endpoint requires the incident_read permission.

OAuth apps require the incident_read authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

응답

OK

Response with a list of incident integration metadata.

Expand All

항목

유형

설명

data [required]

[object]

An array of incident integration metadata.

attributes

object

Incident integration metadata's attributes for a create request.

created

date-time

Timestamp when the incident todo was created.

incident_id

string

UUID of the incident this integration metadata is connected to.

integration_type [required]

int32

A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.

metadata [required]

 <oneOf>

Incident integration metadata's metadata attribute.

Option 1

object

Incident integration metadata for the Slack integration.

channels [required]

[object]

Array of Slack channels in this integration metadata.

channel_id [required]

string

Slack channel ID.

channel_name [required]

string

Name of the Slack channel.

redirect_url [required]

string

URL redirecting to the Slack channel.

team_id

string

Slack team ID.

Option 2

object

Incident integration metadata for the Jira integration.

issues [required]

[object]

Array of Jira issues in this integration metadata.

account [required]

string

URL of issue's Jira account.

issue_key

string

Jira issue's issue key.

issuetype_id

string

Jira issue's issue type.

project_key [required]

string

Jira issue's project keys.

redirect_url

string

URL redirecting to the Jira issue.

Option 3

object

Incident integration metadata for the Microsoft Teams integration.

teams [required]

[object]

Array of Microsoft Teams in this integration metadata.

ms_channel_id [required]

string

Microsoft Teams channel ID.

ms_channel_name [required]

string

Microsoft Teams channel name.

ms_tenant_id [required]

string

Microsoft Teams tenant ID.

redirect_url [required]

string

URL redirecting to the Microsoft Teams channel.

modified

date-time

Timestamp when the incident todo was last modified.

status

int32

A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed.

id [required]

string

The incident integration metadata's ID.

relationships

object

The incident's integration relationships from a response.

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

created_at

date-time

Creation time of the user.

disabled

boolean

Whether the user is disabled.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

mfa_enabled

boolean

If user has MFA enabled.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

service_account

boolean

Whether the user is a service account.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id

string

ID of the user.

relationships

object

Relationships of the user object returned by the API.

org

object

Relationship to an organization.

data [required]

object

Relationship to organization object.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_orgs

object

Relationship to organizations.

data [required]

[object]

Relationships to organization objects.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_users

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

roles

object

Relationship to roles.

data

[object]

An array containing type and the unique identifier of a role.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

type

enum

Users resource type. Allowed enum values: users

default: users

meta

object

The metadata object containing pagination metadata.

pagination

object

Pagination properties.

next_offset

int64

The index of the first element in the next page of results. Equal to page size added to the current offset.

offset

int64

The index of the first element in the results.

size

int64

Maximum size of pages to return.

{
  "data": [
    {
      "attributes": {
        "created": "2019-09-19T10:00:00.000Z",
        "incident_id": "00000000-aaaa-0000-0000-000000000000",
        "integration_type": 1,
        "metadata": {
          "channels": [
            {
              "channel_id": "C0123456789",
              "channel_name": "#example-channel-name",
              "redirect_url": "https://slack.com/app_redirect?channel=C0123456789\u0026team=T01234567",
              "team_id": "T01234567"
            }
          ]
        },
        "modified": "2019-09-19T10:00:00.000Z",
        "status": "integer"
      },
      "id": "00000000-0000-0000-1234-000000000000",
      "relationships": {
        "created_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        }
      },
      "type": "incident_integrations"
    }
  ],
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ],
  "meta": {
    "pagination": {
      "next_offset": 1000,
      "offset": 10,
      "size": 1000
    }
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Get a list of an incident's integration metadata returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidentIntegrations", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .list_incident_integrations(incident_data_id.clone())
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

POST https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrationshttps://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/integrationshttps://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/integrationshttps://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrationshttps://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrationshttps://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations

개요

Create an incident integration metadata. This endpoint requires the incident_write permission.

OAuth apps require the incident_write authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

요청

Body Data (required)

Incident integration metadata payload.

Expand All

항목

유형

설명

data [required]

object

Incident integration metadata data for a create request.

attributes [required]

object

Incident integration metadata's attributes for a create request.

created

date-time

Timestamp when the incident todo was created.

incident_id

string

UUID of the incident this integration metadata is connected to.

integration_type [required]

int32

A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.

metadata [required]

 <oneOf>

Incident integration metadata's metadata attribute.

Option 1

object

Incident integration metadata for the Slack integration.

channels [required]

[object]

Array of Slack channels in this integration metadata.

channel_id [required]

string

Slack channel ID.

channel_name [required]

string

Name of the Slack channel.

redirect_url [required]

string

URL redirecting to the Slack channel.

team_id

string

Slack team ID.

Option 2

object

Incident integration metadata for the Jira integration.

issues [required]

[object]

Array of Jira issues in this integration metadata.

account [required]

string

URL of issue's Jira account.

issue_key

string

Jira issue's issue key.

issuetype_id

string

Jira issue's issue type.

project_key [required]

string

Jira issue's project keys.

redirect_url

string

URL redirecting to the Jira issue.

Option 3

object

Incident integration metadata for the Microsoft Teams integration.

teams [required]

[object]

Array of Microsoft Teams in this integration metadata.

ms_channel_id [required]

string

Microsoft Teams channel ID.

ms_channel_name [required]

string

Microsoft Teams channel name.

ms_tenant_id [required]

string

Microsoft Teams tenant ID.

redirect_url [required]

string

URL redirecting to the Microsoft Teams channel.

modified

date-time

Timestamp when the incident todo was last modified.

status

int32

A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed.

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

{
  "data": {
    "attributes": {
      "incident_id": "00000000-0000-0000-1234-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#new-channel",
            "team_id": "T01234567",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
          }
        ]
      }
    },
    "type": "incident_integrations"
  }
}

응답

CREATED

Response with an incident integration metadata.

Expand All

항목

유형

설명

data [required]

object

Incident integration metadata from a response.

attributes

object

Incident integration metadata's attributes for a create request.

created

date-time

Timestamp when the incident todo was created.

incident_id

string

UUID of the incident this integration metadata is connected to.

integration_type [required]

int32

A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.

metadata [required]

 <oneOf>

Incident integration metadata's metadata attribute.

Option 1

object

Incident integration metadata for the Slack integration.

channels [required]

[object]

Array of Slack channels in this integration metadata.

channel_id [required]

string

Slack channel ID.

channel_name [required]

string

Name of the Slack channel.

redirect_url [required]

string

URL redirecting to the Slack channel.

team_id

string

Slack team ID.

Option 2

object

Incident integration metadata for the Jira integration.

issues [required]

[object]

Array of Jira issues in this integration metadata.

account [required]

string

URL of issue's Jira account.

issue_key

string

Jira issue's issue key.

issuetype_id

string

Jira issue's issue type.

project_key [required]

string

Jira issue's project keys.

redirect_url

string

URL redirecting to the Jira issue.

Option 3

object

Incident integration metadata for the Microsoft Teams integration.

teams [required]

[object]

Array of Microsoft Teams in this integration metadata.

ms_channel_id [required]

string

Microsoft Teams channel ID.

ms_channel_name [required]

string

Microsoft Teams channel name.

ms_tenant_id [required]

string

Microsoft Teams tenant ID.

redirect_url [required]

string

URL redirecting to the Microsoft Teams channel.

modified

date-time

Timestamp when the incident todo was last modified.

status

int32

A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed.

id [required]

string

The incident integration metadata's ID.

relationships

object

The incident's integration relationships from a response.

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

created_at

date-time

Creation time of the user.

disabled

boolean

Whether the user is disabled.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

mfa_enabled

boolean

If user has MFA enabled.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

service_account

boolean

Whether the user is a service account.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id

string

ID of the user.

relationships

object

Relationships of the user object returned by the API.

org

object

Relationship to an organization.

data [required]

object

Relationship to organization object.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_orgs

object

Relationship to organizations.

data [required]

[object]

Relationships to organization objects.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_users

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

roles

object

Relationship to roles.

data

[object]

An array containing type and the unique identifier of a role.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

type

enum

Users resource type. Allowed enum values: users

default: users

{
  "data": {
    "attributes": {
      "created": "2019-09-19T10:00:00.000Z",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#example-channel-name",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789\u0026team=T01234567",
            "team_id": "T01234567"
          }
        ]
      },
      "modified": "2019-09-19T10:00:00.000Z",
      "status": "integer"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_integrations"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Create an incident integration metadata returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataAttributes;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataCreateData;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataCreateRequest;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataMetadata;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataType;
use datadog_api_client::datadogV2::model::SlackIntegrationMetadata;
use datadog_api_client::datadogV2::model::SlackIntegrationMetadataChannelItem;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let body =
        IncidentIntegrationMetadataCreateRequest::new(IncidentIntegrationMetadataCreateData::new(
            IncidentIntegrationMetadataAttributes::new(
                1,
                IncidentIntegrationMetadataMetadata::SlackIntegrationMetadata(Box::new(
                    SlackIntegrationMetadata::new(vec![SlackIntegrationMetadataChannelItem::new(
                        "C0123456789".to_string(),
                        "#new-channel".to_string(),
                        "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
                            .to_string(),
                    )
                    .team_id("T01234567".to_string())]),
                )),
            )
            .incident_id(incident_data_id.clone()),
            IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,
        ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncidentIntegration", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .create_incident_integration(incident_data_id.clone(), 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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}

개요

Get incident integration metadata details.

OAuth apps require the incident_read authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

integration_metadata_id [required]

string

The UUID of the incident integration metadata.

응답

OK

Response with an incident integration metadata.

Expand All

항목

유형

설명

data [required]

object

Incident integration metadata from a response.

attributes

object

Incident integration metadata's attributes for a create request.

created

date-time

Timestamp when the incident todo was created.

incident_id

string

UUID of the incident this integration metadata is connected to.

integration_type [required]

int32

A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.

metadata [required]

 <oneOf>

Incident integration metadata's metadata attribute.

Option 1

object

Incident integration metadata for the Slack integration.

channels [required]

[object]

Array of Slack channels in this integration metadata.

channel_id [required]

string

Slack channel ID.

channel_name [required]

string

Name of the Slack channel.

redirect_url [required]

string

URL redirecting to the Slack channel.

team_id

string

Slack team ID.

Option 2

object

Incident integration metadata for the Jira integration.

issues [required]

[object]

Array of Jira issues in this integration metadata.

account [required]

string

URL of issue's Jira account.

issue_key

string

Jira issue's issue key.

issuetype_id

string

Jira issue's issue type.

project_key [required]

string

Jira issue's project keys.

redirect_url

string

URL redirecting to the Jira issue.

Option 3

object

Incident integration metadata for the Microsoft Teams integration.

teams [required]

[object]

Array of Microsoft Teams in this integration metadata.

ms_channel_id [required]

string

Microsoft Teams channel ID.

ms_channel_name [required]

string

Microsoft Teams channel name.

ms_tenant_id [required]

string

Microsoft Teams tenant ID.

redirect_url [required]

string

URL redirecting to the Microsoft Teams channel.

modified

date-time

Timestamp when the incident todo was last modified.

status

int32

A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed.

id [required]

string

The incident integration metadata's ID.

relationships

object

The incident's integration relationships from a response.

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

created_at

date-time

Creation time of the user.

disabled

boolean

Whether the user is disabled.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

mfa_enabled

boolean

If user has MFA enabled.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

service_account

boolean

Whether the user is a service account.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id

string

ID of the user.

relationships

object

Relationships of the user object returned by the API.

org

object

Relationship to an organization.

data [required]

object

Relationship to organization object.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_orgs

object

Relationship to organizations.

data [required]

[object]

Relationships to organization objects.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_users

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

roles

object

Relationship to roles.

data

[object]

An array containing type and the unique identifier of a role.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

type

enum

Users resource type. Allowed enum values: users

default: users

{
  "data": {
    "attributes": {
      "created": "2019-09-19T10:00:00.000Z",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#example-channel-name",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789\u0026team=T01234567",
            "team_id": "T01234567"
          }
        ]
      },
      "modified": "2019-09-19T10:00:00.000Z",
      "status": "integer"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_integrations"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Get incident integration metadata details returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_integration_metadata"
    let incident_integration_metadata_data_id =
        std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetIncidentIntegration", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .get_incident_integration(
            incident_data_id.clone(),
            incident_integration_metadata_data_id.clone(),
        )
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

PATCH https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}

개요

Update an existing incident integration metadata.

OAuth apps require the incident_write authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

integration_metadata_id [required]

string

The UUID of the incident integration metadata.

요청

Body Data (required)

Incident integration metadata payload.

Expand All

항목

유형

설명

data [required]

object

Incident integration metadata data for a patch request.

attributes [required]

object

Incident integration metadata's attributes for a create request.

created

date-time

Timestamp when the incident todo was created.

incident_id

string

UUID of the incident this integration metadata is connected to.

integration_type [required]

int32

A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.

metadata [required]

 <oneOf>

Incident integration metadata's metadata attribute.

Option 1

object

Incident integration metadata for the Slack integration.

channels [required]

[object]

Array of Slack channels in this integration metadata.

channel_id [required]

string

Slack channel ID.

channel_name [required]

string

Name of the Slack channel.

redirect_url [required]

string

URL redirecting to the Slack channel.

team_id

string

Slack team ID.

Option 2

object

Incident integration metadata for the Jira integration.

issues [required]

[object]

Array of Jira issues in this integration metadata.

account [required]

string

URL of issue's Jira account.

issue_key

string

Jira issue's issue key.

issuetype_id

string

Jira issue's issue type.

project_key [required]

string

Jira issue's project keys.

redirect_url

string

URL redirecting to the Jira issue.

Option 3

object

Incident integration metadata for the Microsoft Teams integration.

teams [required]

[object]

Array of Microsoft Teams in this integration metadata.

ms_channel_id [required]

string

Microsoft Teams channel ID.

ms_channel_name [required]

string

Microsoft Teams channel name.

ms_tenant_id [required]

string

Microsoft Teams tenant ID.

redirect_url [required]

string

URL redirecting to the Microsoft Teams channel.

modified

date-time

Timestamp when the incident todo was last modified.

status

int32

A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed.

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

{
  "data": {
    "attributes": {
      "incident_id": "00000000-0000-0000-1234-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#updated-channel-name",
            "team_id": "T01234567",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
          }
        ]
      }
    },
    "type": "incident_integrations"
  }
}

응답

OK

Response with an incident integration metadata.

Expand All

항목

유형

설명

data [required]

object

Incident integration metadata from a response.

attributes

object

Incident integration metadata's attributes for a create request.

created

date-time

Timestamp when the incident todo was created.

incident_id

string

UUID of the incident this integration metadata is connected to.

integration_type [required]

int32

A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.

metadata [required]

 <oneOf>

Incident integration metadata's metadata attribute.

Option 1

object

Incident integration metadata for the Slack integration.

channels [required]

[object]

Array of Slack channels in this integration metadata.

channel_id [required]

string

Slack channel ID.

channel_name [required]

string

Name of the Slack channel.

redirect_url [required]

string

URL redirecting to the Slack channel.

team_id

string

Slack team ID.

Option 2

object

Incident integration metadata for the Jira integration.

issues [required]

[object]

Array of Jira issues in this integration metadata.

account [required]

string

URL of issue's Jira account.

issue_key

string

Jira issue's issue key.

issuetype_id

string

Jira issue's issue type.

project_key [required]

string

Jira issue's project keys.

redirect_url

string

URL redirecting to the Jira issue.

Option 3

object

Incident integration metadata for the Microsoft Teams integration.

teams [required]

[object]

Array of Microsoft Teams in this integration metadata.

ms_channel_id [required]

string

Microsoft Teams channel ID.

ms_channel_name [required]

string

Microsoft Teams channel name.

ms_tenant_id [required]

string

Microsoft Teams tenant ID.

redirect_url [required]

string

URL redirecting to the Microsoft Teams channel.

modified

date-time

Timestamp when the incident todo was last modified.

status

int32

A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed.

id [required]

string

The incident integration metadata's ID.

relationships

object

The incident's integration relationships from a response.

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

Integration metadata resource type. Allowed enum values: incident_integrations

default: incident_integrations

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

created_at

date-time

Creation time of the user.

disabled

boolean

Whether the user is disabled.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

mfa_enabled

boolean

If user has MFA enabled.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

service_account

boolean

Whether the user is a service account.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id

string

ID of the user.

relationships

object

Relationships of the user object returned by the API.

org

object

Relationship to an organization.

data [required]

object

Relationship to organization object.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_orgs

object

Relationship to organizations.

data [required]

[object]

Relationships to organization objects.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_users

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

roles

object

Relationship to roles.

data

[object]

An array containing type and the unique identifier of a role.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

type

enum

Users resource type. Allowed enum values: users

default: users

{
  "data": {
    "attributes": {
      "created": "2019-09-19T10:00:00.000Z",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#example-channel-name",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789\u0026team=T01234567",
            "team_id": "T01234567"
          }
        ]
      },
      "modified": "2019-09-19T10:00:00.000Z",
      "status": "integer"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_integrations"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Update an existing incident integration metadata returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataAttributes;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataMetadata;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataPatchData;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataPatchRequest;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataType;
use datadog_api_client::datadogV2::model::SlackIntegrationMetadata;
use datadog_api_client::datadogV2::model::SlackIntegrationMetadataChannelItem;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_integration_metadata"
    let incident_integration_metadata_data_id =
        std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();
    let body =
        IncidentIntegrationMetadataPatchRequest::new(IncidentIntegrationMetadataPatchData::new(
            IncidentIntegrationMetadataAttributes::new(
                1,
                IncidentIntegrationMetadataMetadata::SlackIntegrationMetadata(Box::new(
                    SlackIntegrationMetadata::new(vec![SlackIntegrationMetadataChannelItem::new(
                        "C0123456789".to_string(),
                        "#updated-channel-name".to_string(),
                        "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
                            .to_string(),
                    )
                    .team_id("T01234567".to_string())]),
                )),
            )
            .incident_id(incident_data_id.clone()),
            IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,
        ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncidentIntegration", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident_integration(
            incident_data_id.clone(),
            incident_integration_metadata_data_id.clone(),
            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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

DELETE https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}

개요

Delete an incident integration metadata.

OAuth apps require the incident_write authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

integration_metadata_id [required]

string

The UUID of the incident integration metadata.

응답

OK

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Delete an incident integration metadata returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_integration_metadata"
    let incident_integration_metadata_data_id =
        std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncidentIntegration", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .delete_incident_integration(
            incident_data_id.clone(),
            incident_integration_metadata_data_id.clone(),
        )
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todoshttps://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/todoshttps://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todoshttps://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todoshttps://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todoshttps://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos

개요

Get all todos for an incident. This endpoint requires the incident_read permission.

OAuth apps require the incident_read authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

응답

OK

Response with a list of incident todos.

Expand All

항목

유형

설명

data [required]

[object]

An array of incident todos.

attributes

object

Incident todo's attributes.

assignees [required]

[ <oneOf>]

Array of todo assignees.

Option 1

string

Assignee's @-handle.

Option 2

object

Anonymous assignee entity.

icon [required]

string

URL for assignee's icon.

id [required]

string

Anonymous assignee's ID.

name [required]

string

Assignee's name.

source [required]

enum

The source of the anonymous assignee. Allowed enum values: slack,microsoft_teams

default: slack

completed

string

Timestamp when the todo was completed.

content [required]

string

The follow-up task's content.

created

date-time

Timestamp when the incident todo was created.

due_date

string

Timestamp when the todo should be completed by.

incident_id

string

UUID of the incident this todo is connected to.

modified

date-time

Timestamp when the incident todo was last modified.

id [required]

string

The incident todo's ID.

relationships

object

The incident's relationships from a response.

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

Todo resource type. Allowed enum values: incident_todos

default: incident_todos

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

created_at

date-time

Creation time of the user.

disabled

boolean

Whether the user is disabled.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

mfa_enabled

boolean

If user has MFA enabled.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

service_account

boolean

Whether the user is a service account.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id

string

ID of the user.

relationships

object

Relationships of the user object returned by the API.

org

object

Relationship to an organization.

data [required]

object

Relationship to organization object.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_orgs

object

Relationship to organizations.

data [required]

[object]

Relationships to organization objects.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_users

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

roles

object

Relationship to roles.

data

[object]

An array containing type and the unique identifier of a role.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

type

enum

Users resource type. Allowed enum values: users

default: users

meta

object

The metadata object containing pagination metadata.

pagination

object

Pagination properties.

next_offset

int64

The index of the first element in the next page of results. Equal to page size added to the current offset.

offset

int64

The index of the first element in the results.

size

int64

Maximum size of pages to return.

{
  "data": [
    {
      "attributes": {
        "assignees": [
          {
            "description": "@test.user@test.com",
            "example": "@test.user@test.com",
            "type": "@test.user@test.com"
          }
        ],
        "completed": "2023-03-06T22:00:00.000000+00:00",
        "content": "Restore lost data.",
        "created": "2019-09-19T10:00:00.000Z",
        "due_date": "2023-07-10T05:00:00.000000+00:00",
        "incident_id": "00000000-aaaa-0000-0000-000000000000",
        "modified": "2019-09-19T10:00:00.000Z"
      },
      "id": "00000000-0000-0000-1234-000000000000",
      "relationships": {
        "created_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        }
      },
      "type": "incident_todos"
    }
  ],
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ],
  "meta": {
    "pagination": {
      "next_offset": 1000,
      "offset": 10,
      "size": 1000
    }
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Get a list of an incident's todos returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidentTodos", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.list_incident_todos(incident_data_id.clone()).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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

POST https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todoshttps://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/todoshttps://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todoshttps://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todoshttps://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todoshttps://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos

개요

Create an incident todo. This endpoint requires the incident_write permission.

OAuth apps require the incident_write authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

요청

Body Data (required)

Incident todo payload.

Expand All

항목

유형

설명

data [required]

object

Incident todo data for a create request.

attributes [required]

object

Incident todo's attributes.

assignees [required]

[ <oneOf>]

Array of todo assignees.

Option 1

string

Assignee's @-handle.

Option 2

object

Anonymous assignee entity.

icon [required]

string

URL for assignee's icon.

id [required]

string

Anonymous assignee's ID.

name [required]

string

Assignee's name.

source [required]

enum

The source of the anonymous assignee. Allowed enum values: slack,microsoft_teams

default: slack

completed

string

Timestamp when the todo was completed.

content [required]

string

The follow-up task's content.

created

date-time

Timestamp when the incident todo was created.

due_date

string

Timestamp when the todo should be completed by.

incident_id

string

UUID of the incident this todo is connected to.

modified

date-time

Timestamp when the incident todo was last modified.

type [required]

enum

Todo resource type. Allowed enum values: incident_todos

default: incident_todos

{
  "data": {
    "attributes": {
      "assignees": [
        "@test.user@test.com"
      ],
      "content": "Restore lost data."
    },
    "type": "incident_todos"
  }
}

응답

CREATED

Response with an incident todo.

Expand All

항목

유형

설명

data [required]

object

Incident todo response data.

attributes

object

Incident todo's attributes.

assignees [required]

[ <oneOf>]

Array of todo assignees.

Option 1

string

Assignee's @-handle.

Option 2

object

Anonymous assignee entity.

icon [required]

string

URL for assignee's icon.

id [required]

string

Anonymous assignee's ID.

name [required]

string

Assignee's name.

source [required]

enum

The source of the anonymous assignee. Allowed enum values: slack,microsoft_teams

default: slack

completed

string

Timestamp when the todo was completed.

content [required]

string

The follow-up task's content.

created

date-time

Timestamp when the incident todo was created.

due_date

string

Timestamp when the todo should be completed by.

incident_id

string

UUID of the incident this todo is connected to.

modified

date-time

Timestamp when the incident todo was last modified.

id [required]

string

The incident todo's ID.

relationships

object

The incident's relationships from a response.

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

Todo resource type. Allowed enum values: incident_todos

default: incident_todos

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

created_at

date-time

Creation time of the user.

disabled

boolean

Whether the user is disabled.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

mfa_enabled

boolean

If user has MFA enabled.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

service_account

boolean

Whether the user is a service account.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id

string

ID of the user.

relationships

object

Relationships of the user object returned by the API.

org

object

Relationship to an organization.

data [required]

object

Relationship to organization object.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_orgs

object

Relationship to organizations.

data [required]

[object]

Relationships to organization objects.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_users

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

roles

object

Relationship to roles.

data

[object]

An array containing type and the unique identifier of a role.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

type

enum

Users resource type. Allowed enum values: users

default: users

{
  "data": {
    "attributes": {
      "assignees": [
        {
          "description": "@test.user@test.com",
          "example": "@test.user@test.com",
          "type": "@test.user@test.com"
        }
      ],
      "completed": "2023-03-06T22:00:00.000000+00:00",
      "content": "Restore lost data.",
      "created": "2019-09-19T10:00:00.000Z",
      "due_date": "2023-07-10T05:00:00.000000+00:00",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "modified": "2019-09-19T10:00:00.000Z"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_todos"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Create an incident todo returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentTodoAssignee;
use datadog_api_client::datadogV2::model::IncidentTodoAttributes;
use datadog_api_client::datadogV2::model::IncidentTodoCreateData;
use datadog_api_client::datadogV2::model::IncidentTodoCreateRequest;
use datadog_api_client::datadogV2::model::IncidentTodoType;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let body = IncidentTodoCreateRequest::new(IncidentTodoCreateData::new(
        IncidentTodoAttributes::new(
            vec![IncidentTodoAssignee::IncidentTodoAssigneeHandle(
                "@test.user@test.com".to_string(),
            )],
            "Restore lost data.".to_string(),
        ),
        IncidentTodoType::INCIDENT_TODOS,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncidentTodo", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .create_incident_todo(incident_data_id.clone(), 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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}

개요

Get incident todo details. This endpoint requires the incident_read permission.

OAuth apps require the incident_read authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

todo_id [required]

string

The UUID of the incident todo.

응답

OK

Response with an incident todo.

Expand All

항목

유형

설명

data [required]

object

Incident todo response data.

attributes

object

Incident todo's attributes.

assignees [required]

[ <oneOf>]

Array of todo assignees.

Option 1

string

Assignee's @-handle.

Option 2

object

Anonymous assignee entity.

icon [required]

string

URL for assignee's icon.

id [required]

string

Anonymous assignee's ID.

name [required]

string

Assignee's name.

source [required]

enum

The source of the anonymous assignee. Allowed enum values: slack,microsoft_teams

default: slack

completed

string

Timestamp when the todo was completed.

content [required]

string

The follow-up task's content.

created

date-time

Timestamp when the incident todo was created.

due_date

string

Timestamp when the todo should be completed by.

incident_id

string

UUID of the incident this todo is connected to.

modified

date-time

Timestamp when the incident todo was last modified.

id [required]

string

The incident todo's ID.

relationships

object

The incident's relationships from a response.

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

Todo resource type. Allowed enum values: incident_todos

default: incident_todos

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

created_at

date-time

Creation time of the user.

disabled

boolean

Whether the user is disabled.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

mfa_enabled

boolean

If user has MFA enabled.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

service_account

boolean

Whether the user is a service account.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id

string

ID of the user.

relationships

object

Relationships of the user object returned by the API.

org

object

Relationship to an organization.

data [required]

object

Relationship to organization object.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_orgs

object

Relationship to organizations.

data [required]

[object]

Relationships to organization objects.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_users

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

roles

object

Relationship to roles.

data

[object]

An array containing type and the unique identifier of a role.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

type

enum

Users resource type. Allowed enum values: users

default: users

{
  "data": {
    "attributes": {
      "assignees": [
        {
          "description": "@test.user@test.com",
          "example": "@test.user@test.com",
          "type": "@test.user@test.com"
        }
      ],
      "completed": "2023-03-06T22:00:00.000000+00:00",
      "content": "Restore lost data.",
      "created": "2019-09-19T10:00:00.000Z",
      "due_date": "2023-07-10T05:00:00.000000+00:00",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "modified": "2019-09-19T10:00:00.000Z"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_todos"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Get incident todo details returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_todo"
    let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetIncidentTodo", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .get_incident_todo(incident_data_id.clone(), incident_todo_data_id.clone())
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

PATCH https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}

개요

Update an incident todo. This endpoint requires the incident_write permission.

OAuth apps require the incident_write authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

todo_id [required]

string

The UUID of the incident todo.

요청

Body Data (required)

Incident todo payload.

Expand All

항목

유형

설명

data [required]

object

Incident todo data for a patch request.

attributes [required]

object

Incident todo's attributes.

assignees [required]

[ <oneOf>]

Array of todo assignees.

Option 1

string

Assignee's @-handle.

Option 2

object

Anonymous assignee entity.

icon [required]

string

URL for assignee's icon.

id [required]

string

Anonymous assignee's ID.

name [required]

string

Assignee's name.

source [required]

enum

The source of the anonymous assignee. Allowed enum values: slack,microsoft_teams

default: slack

completed

string

Timestamp when the todo was completed.

content [required]

string

The follow-up task's content.

created

date-time

Timestamp when the incident todo was created.

due_date

string

Timestamp when the todo should be completed by.

incident_id

string

UUID of the incident this todo is connected to.

modified

date-time

Timestamp when the incident todo was last modified.

type [required]

enum

Todo resource type. Allowed enum values: incident_todos

default: incident_todos

{
  "data": {
    "attributes": {
      "assignees": [
        "@test.user@test.com"
      ],
      "content": "Restore lost data.",
      "completed": "2023-03-06T22:00:00.000000+00:00",
      "due_date": "2023-07-10T05:00:00.000000+00:00"
    },
    "type": "incident_todos"
  }
}

응답

OK

Response with an incident todo.

Expand All

항목

유형

설명

data [required]

object

Incident todo response data.

attributes

object

Incident todo's attributes.

assignees [required]

[ <oneOf>]

Array of todo assignees.

Option 1

string

Assignee's @-handle.

Option 2

object

Anonymous assignee entity.

icon [required]

string

URL for assignee's icon.

id [required]

string

Anonymous assignee's ID.

name [required]

string

Assignee's name.

source [required]

enum

The source of the anonymous assignee. Allowed enum values: slack,microsoft_teams

default: slack

completed

string

Timestamp when the todo was completed.

content [required]

string

The follow-up task's content.

created

date-time

Timestamp when the incident todo was created.

due_date

string

Timestamp when the todo should be completed by.

incident_id

string

UUID of the incident this todo is connected to.

modified

date-time

Timestamp when the incident todo was last modified.

id [required]

string

The incident todo's ID.

relationships

object

The incident's relationships from a response.

created_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

last_modified_by_user

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

type [required]

enum

Todo resource type. Allowed enum values: incident_todos

default: incident_todos

included

[ <oneOf>]

Included related resources that the user requested.

Option 1

object

User object returned by the API.

attributes

object

Attributes of user object returned by the API.

created_at

date-time

Creation time of the user.

disabled

boolean

Whether the user is disabled.

email

string

Email of the user.

handle

string

Handle of the user.

icon

string

URL of the user's icon.

mfa_enabled

boolean

If user has MFA enabled.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

service_account

boolean

Whether the user is a service account.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id

string

ID of the user.

relationships

object

Relationships of the user object returned by the API.

org

object

Relationship to an organization.

data [required]

object

Relationship to organization object.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_orgs

object

Relationship to organizations.

data [required]

[object]

Relationships to organization objects.

id [required]

string

ID of the organization.

type [required]

enum

Organizations resource type. Allowed enum values: orgs

default: orgs

other_users

object

Relationship to users.

data [required]

[object]

Relationships to user objects.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

roles

object

Relationship to roles.

data

[object]

An array containing type and the unique identifier of a role.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

type

enum

Users resource type. Allowed enum values: users

default: users

{
  "data": {
    "attributes": {
      "assignees": [
        {
          "description": "@test.user@test.com",
          "example": "@test.user@test.com",
          "type": "@test.user@test.com"
        }
      ],
      "completed": "2023-03-06T22:00:00.000000+00:00",
      "content": "Restore lost data.",
      "created": "2019-09-19T10:00:00.000Z",
      "due_date": "2023-07-10T05:00:00.000000+00:00",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "modified": "2019-09-19T10:00:00.000Z"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_todos"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Update an incident todo returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentTodoAssignee;
use datadog_api_client::datadogV2::model::IncidentTodoAttributes;
use datadog_api_client::datadogV2::model::IncidentTodoPatchData;
use datadog_api_client::datadogV2::model::IncidentTodoPatchRequest;
use datadog_api_client::datadogV2::model::IncidentTodoType;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_todo"
    let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap();
    let body = IncidentTodoPatchRequest::new(IncidentTodoPatchData::new(
        IncidentTodoAttributes::new(
            vec![IncidentTodoAssignee::IncidentTodoAssigneeHandle(
                "@test.user@test.com".to_string(),
            )],
            "Restore lost data.".to_string(),
        )
        .completed(Some("2023-03-06T22:00:00.000000+00:00".to_string()))
        .due_date(Some("2023-07-10T05:00:00.000000+00:00".to_string())),
        IncidentTodoType::INCIDENT_TODOS,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncidentTodo", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident_todo(
            incident_data_id.clone(),
            incident_todo_data_id.clone(),
            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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

DELETE https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}

개요

Delete an incident todo. This endpoint requires the incident_write permission.

OAuth apps require the incident_write authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_id [required]

string

The UUID of the incident.

todo_id [required]

string

The UUID of the incident todo.

응답

OK

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Delete an incident todo returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_todo"
    let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncidentTodo", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .delete_incident_todo(incident_data_id.clone(), incident_todo_data_id.clone())
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

POST https://api.ap1.datadoghq.com/api/v2/incidents/config/typeshttps://api.datadoghq.eu/api/v2/incidents/config/typeshttps://api.ddog-gov.com/api/v2/incidents/config/typeshttps://api.datadoghq.com/api/v2/incidents/config/typeshttps://api.us3.datadoghq.com/api/v2/incidents/config/typeshttps://api.us5.datadoghq.com/api/v2/incidents/config/types

개요

Create an incident type. This endpoint requires the incident_settings_write permission.

OAuth apps require the incident_settings_write authorization scope to access this endpoint.

요청

Body Data (required)

Incident type payload.

Expand All

항목

유형

설명

data [required]

object

Incident type data for a create request.

attributes [required]

object

Incident type's attributes.

createdAt

date-time

Timestamp when the incident type was created.

createdBy

string

A unique identifier that represents the user that created the incident type.

description

string

Text that describes the incident type.

is_default

boolean

If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.

lastModifiedBy

string

A unique identifier that represents the user that last modified the incident type.

modifiedAt

date-time

Timestamp when the incident type was last modified.

name [required]

string

The name of the incident type.

prefix

string

The string that will be prepended to the incident title across the Datadog app.

type [required]

enum

Incident type resource type. Allowed enum values: incident_types

default: incident_types

{
  "data": {
    "attributes": {
      "description": "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
      "is_default": false,
      "name": "Security Incident"
    },
    "type": "incident_types"
  }
}

응답

CREATED

Incident type response data.

Expand All

항목

유형

설명

data [required]

object

Incident type response data.

attributes

object

Incident type's attributes.

createdAt

date-time

Timestamp when the incident type was created.

createdBy

string

A unique identifier that represents the user that created the incident type.

description

string

Text that describes the incident type.

is_default

boolean

If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.

lastModifiedBy

string

A unique identifier that represents the user that last modified the incident type.

modifiedAt

date-time

Timestamp when the incident type was last modified.

name [required]

string

The name of the incident type.

prefix

string

The string that will be prepended to the incident title across the Datadog app.

id [required]

string

The incident type's ID.

type [required]

enum

Incident type resource type. Allowed enum values: incident_types

default: incident_types

{
  "data": {
    "attributes": {
      "createdAt": "2019-09-19T10:00:00.000Z",
      "createdBy": "00000000-0000-0000-0000-000000000000",
      "description": "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
      "is_default": false,
      "lastModifiedBy": "00000000-0000-0000-0000-000000000000",
      "modifiedAt": "2019-09-19T10:00:00.000Z",
      "name": "Security Incident",
      "prefix": "IR"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "type": "incident_types"
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Create an incident type returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentTypeAttributes;
use datadog_api_client::datadogV2::model::IncidentTypeCreateData;
use datadog_api_client::datadogV2::model::IncidentTypeCreateRequest;
use datadog_api_client::datadogV2::model::IncidentTypeType;

#[tokio::main]
async fn main() {
    let body =
        IncidentTypeCreateRequest::new(
            IncidentTypeCreateData::new(
                IncidentTypeAttributes::new("Security Incident".to_string())
                    .description(
                        "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.".to_string(),
                    )
                    .is_default(false),
                IncidentTypeType::INCIDENT_TYPES,
            ),
        );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncidentType", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.create_incident_type(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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/incidents/config/typeshttps://api.datadoghq.eu/api/v2/incidents/config/typeshttps://api.ddog-gov.com/api/v2/incidents/config/typeshttps://api.datadoghq.com/api/v2/incidents/config/typeshttps://api.us3.datadoghq.com/api/v2/incidents/config/typeshttps://api.us5.datadoghq.com/api/v2/incidents/config/types

개요

Get all incident types. This endpoint requires the incident_read permission.

OAuth apps require the incident_read authorization scope to access this endpoint.

인수

쿼리 문자열

이름

유형

설명

include_deleted

boolean

Include deleted incident types in the response.

응답

OK

Response with a list of incident types.

Expand All

항목

유형

설명

data [required]

[object]

An array of incident type objects.

attributes

object

Incident type's attributes.

createdAt

date-time

Timestamp when the incident type was created.

createdBy

string

A unique identifier that represents the user that created the incident type.

description

string

Text that describes the incident type.

is_default

boolean

If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.

lastModifiedBy

string

A unique identifier that represents the user that last modified the incident type.

modifiedAt

date-time

Timestamp when the incident type was last modified.

name [required]

string

The name of the incident type.

prefix

string

The string that will be prepended to the incident title across the Datadog app.

id [required]

string

The incident type's ID.

type [required]

enum

Incident type resource type. Allowed enum values: incident_types

default: incident_types

{
  "data": [
    {
      "attributes": {
        "createdAt": "2019-09-19T10:00:00.000Z",
        "createdBy": "00000000-0000-0000-0000-000000000000",
        "description": "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
        "is_default": false,
        "lastModifiedBy": "00000000-0000-0000-0000-000000000000",
        "modifiedAt": "2019-09-19T10:00:00.000Z",
        "name": "Security Incident",
        "prefix": "IR"
      },
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "incident_types"
    }
  ]
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Get a list of incident types returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::ListIncidentTypesOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidentTypes", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .list_incident_types(ListIncidentTypesOptionalParams::default())
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

GET https://api.ap1.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}https://api.datadoghq.eu/api/v2/incidents/config/types/{incident_type_id}https://api.ddog-gov.com/api/v2/incidents/config/types/{incident_type_id}https://api.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}https://api.us3.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}https://api.us5.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}

개요

Get incident type details. This endpoint requires the incident_read permission.

OAuth apps require the incident_read authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_type_id [required]

string

The UUID of the incident type.

응답

OK

Incident type response data.

Expand All

항목

유형

설명

data [required]

object

Incident type response data.

attributes

object

Incident type's attributes.

createdAt

date-time

Timestamp when the incident type was created.

createdBy

string

A unique identifier that represents the user that created the incident type.

description

string

Text that describes the incident type.

is_default

boolean

If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.

lastModifiedBy

string

A unique identifier that represents the user that last modified the incident type.

modifiedAt

date-time

Timestamp when the incident type was last modified.

name [required]

string

The name of the incident type.

prefix

string

The string that will be prepended to the incident title across the Datadog app.

id [required]

string

The incident type's ID.

type [required]

enum

Incident type resource type. Allowed enum values: incident_types

default: incident_types

{
  "data": {
    "attributes": {
      "createdAt": "2019-09-19T10:00:00.000Z",
      "createdBy": "00000000-0000-0000-0000-000000000000",
      "description": "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
      "is_default": false,
      "lastModifiedBy": "00000000-0000-0000-0000-000000000000",
      "modifiedAt": "2019-09-19T10:00:00.000Z",
      "name": "Security Incident",
      "prefix": "IR"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "type": "incident_types"
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Get incident type details returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetIncidentType", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.get_incident_type("incident_type_id".to_string()).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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

PATCH https://api.ap1.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}https://api.datadoghq.eu/api/v2/incidents/config/types/{incident_type_id}https://api.ddog-gov.com/api/v2/incidents/config/types/{incident_type_id}https://api.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}https://api.us3.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}https://api.us5.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}

개요

Update an incident type. This endpoint requires the incident_settings_write permission.

OAuth apps require the incident_settings_write authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_type_id [required]

string

The UUID of the incident type.

요청

Body Data (required)

Incident type payload.

Expand All

항목

유형

설명

data [required]

object

Incident type data for a patch request.

attributes [required]

object

Incident type's attributes for updates.

createdAt

date-time

Timestamp when the incident type was created.

createdBy

string

A unique identifier that represents the user that created the incident type.

description

string

Text that describes the incident type.

is_default

boolean

When true, this incident type will be used as the default type when an incident type is not specified.

lastModifiedBy

string

A unique identifier that represents the user that last modified the incident type.

modifiedAt

date-time

Timestamp when the incident type was last modified.

name

string

The name of the incident type.

prefix

string

The string that will be prepended to the incident title across the Datadog app.

id [required]

string

The incident type's ID.

type [required]

enum

Incident type resource type. Allowed enum values: incident_types

default: incident_types

{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "attributes": {
      "name": "Security Incident-updated"
    },
    "type": "incident_types"
  }
}

응답

OK

Incident type response data.

Expand All

항목

유형

설명

data [required]

object

Incident type response data.

attributes

object

Incident type's attributes.

createdAt

date-time

Timestamp when the incident type was created.

createdBy

string

A unique identifier that represents the user that created the incident type.

description

string

Text that describes the incident type.

is_default

boolean

If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources.

lastModifiedBy

string

A unique identifier that represents the user that last modified the incident type.

modifiedAt

date-time

Timestamp when the incident type was last modified.

name [required]

string

The name of the incident type.

prefix

string

The string that will be prepended to the incident title across the Datadog app.

id [required]

string

The incident type's ID.

type [required]

enum

Incident type resource type. Allowed enum values: incident_types

default: incident_types

{
  "data": {
    "attributes": {
      "createdAt": "2019-09-19T10:00:00.000Z",
      "createdBy": "00000000-0000-0000-0000-000000000000",
      "description": "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
      "is_default": false,
      "lastModifiedBy": "00000000-0000-0000-0000-000000000000",
      "modifiedAt": "2019-09-19T10:00:00.000Z",
      "name": "Security Incident",
      "prefix": "IR"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "type": "incident_types"
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Update an incident type returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentTypePatchData;
use datadog_api_client::datadogV2::model::IncidentTypePatchRequest;
use datadog_api_client::datadogV2::model::IncidentTypeType;
use datadog_api_client::datadogV2::model::IncidentTypeUpdateAttributes;

#[tokio::main]
async fn main() {
    // there is a valid "incident_type" in the system
    let incident_type_data_id = std::env::var("INCIDENT_TYPE_DATA_ID").unwrap();
    let body = IncidentTypePatchRequest::new(IncidentTypePatchData::new(
        IncidentTypeUpdateAttributes::new().name("Security Incident-updated".to_string()),
        incident_type_data_id.clone(),
        IncidentTypeType::INCIDENT_TYPES,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncidentType", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident_type(incident_type_data_id.clone(), 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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

Note: This endpoint is in public beta. If you have any feedback, contact Datadog support.

DELETE https://api.ap1.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}https://api.datadoghq.eu/api/v2/incidents/config/types/{incident_type_id}https://api.ddog-gov.com/api/v2/incidents/config/types/{incident_type_id}https://api.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}https://api.us3.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}https://api.us5.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}

개요

Delete an incident type. This endpoint requires the incident_settings_write permission.

OAuth apps require the incident_settings_write authorization scope to access this endpoint.

인수

경로 파라미터

이름

유형

설명

incident_type_id [required]

string

The UUID of the incident type.

응답

OK

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Unauthorized

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

코드 사례

// Delete an incident type returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident_type" in the system
    let incident_type_data_id = std::env::var("INCIDENT_TYPE_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncidentType", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .delete_incident_type(incident_type_data_id.clone())
        .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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run