Incident Services

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

POST https://api.datadoghq.eu/api/v2/serviceshttps://api.ddog-gov.com/api/v2/serviceshttps://api.datadoghq.com/api/v2/serviceshttps://api.us3.datadoghq.com/api/v2/services

Overview

Creates a new incident service.

Request

Body Data (required)

Incident Service Payload.

Expand All

Field

Type

Description

data [required]

object

Incident Service payload for create requests.

attributes

object

The incident service's attributes for a create request.

name [required]

string

Name of the incident service.

relationships

object

The incident service's relationships.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

last_modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

type [required]

enum

Incident service resource type. Allowed enum values: services

{
  "data": {
    "attributes": {
      "name": "an example service name"
    },
    "type": "services"
  }
}

Response

CREATED

Response with an incident service payload.

Expand All

Field

Type

Description

data [required]

object

Incident Service data from responses.

attributes

object

The incident service's attributes from a response.

created

date-time

Timestamp of when the incident service was created.

modified

date-time

Timestamp of when the incident service was modified.

name

string

Name of the incident service.

id [required]

string

The incident service's ID.

relationships

object

The incident service's relationships.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

last_modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

type [required]

enum

Incident service resource type. Allowed enum values: services

included

[object <oneOf>]

Included objects from relationships.

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.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id [required]

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

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

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

roles

object

Relationship to roles.

data [required]

[object]

An array containing type and ID of a role.

id

string

ID of the role.

type

enum

Roles type. Allowed enum values: roles

type [required]

enum

Users resource type. Allowed enum values: users

{
  "data": {
    "attributes": {
      "created": "2019-09-19T10:00:00.000Z",
      "modified": "2019-09-19T10:00:00.000Z",
      "name": "service name"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "relationships": {
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      },
      "last_modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      }
    },
    "type": "services"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example


# Curl command
curl -X POST "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v2/services" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "an example service name"
    },
    "type": "services"
  }
}
EOF
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    body := *datadog.NewIncidentServiceCreateRequest(*datadog.NewIncidentServiceCreateData(datadog.IncidentServiceType("services"))) // IncidentServiceCreateRequest | Incident Service Payload.

    configuration := datadog.NewConfiguration()
    configuration.SetUnstableOperationEnabled("CreateIncidentService", true)

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.IncidentServicesApi.CreateIncidentService(ctx, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IncidentServicesApi.CreateIncidentService`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateIncidentService`: IncidentServiceResponse
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from IncidentServicesApi.CreateIncidentService:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v2 import ApiClient, ApiException, Configuration
from datadog_api_client.v2.api import incident_services_api
from datadog_api_client.v2.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
configuration.unstable_operations["create_incident_service"] = True

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = incident_services_api.IncidentServicesApi(api_client)
    body = IncidentServiceCreateRequest(
        data=IncidentServiceCreateData(
            attributes=IncidentServiceCreateAttributes(
                name="an example service name",
            ),
            relationships=IncidentServiceRelationships(
                created_by=RelationshipToUser(
                    data=RelationshipToUserData(
                        id="00000000-0000-0000-0000-000000000000",
                        type=UsersType("users"),
                    ),
                ),
                last_modified_by=RelationshipToUser(
                    data=RelationshipToUserData(
                        id="00000000-0000-0000-0000-000000000000",
                        type=UsersType("users"),
                    ),
                ),
            ),
            type=IncidentServiceType("services"),
        ),
    )  # IncidentServiceCreateRequest | Incident Service Payload.

    # example passing only required values which don't have defaults set
    try:
        # Create a new incident service
        api_response = api_instance.create_incident_service(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling IncidentServicesApi->create_incident_service: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'

DatadogAPIClient::V2.configure do |config|
  config.unstable_operations[:create_incident_service] = true
end

api_instance = DatadogAPIClient::V2::IncidentServicesAPI.new
body = DatadogAPIClient::V2::IncidentServiceCreateRequest.new({data: DatadogAPIClient::V2::IncidentServiceCreateData.new({type: DatadogAPIClient::V2::IncidentServiceType::SERVICES})}) # IncidentServiceCreateRequest | Incident Service Payload.

begin
  # Create a new incident service
  result = api_instance.create_incident_service(body)
  p result
rescue DatadogAPIClient::V2::APIError => e
  puts "Error when calling IncidentServicesAPI->create_incident_service: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import java.util.*;
import com.datadog.api.v2.client.ApiClient;
import com.datadog.api.v2.client.ApiException;
import com.datadog.api.v2.client.Configuration;
import com.datadog.api.v2.client.model.*;
import com.datadog.api.v2.client.api.IncidentServicesApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        IncidentServicesApi apiInstance = new IncidentServicesApi(defaultClient);
        IncidentServiceCreateRequest body = new IncidentServiceCreateRequest(); // IncidentServiceCreateRequest | Incident Service Payload.
        try {
            IncidentServiceResponse result = apiInstance.createIncidentService(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IncidentServicesApi#createIncidentService");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

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

DELETE https://api.datadoghq.eu/api/v2/services/{service_id}https://api.ddog-gov.com/api/v2/services/{service_id}https://api.datadoghq.com/api/v2/services/{service_id}https://api.us3.datadoghq.com/api/v2/services/{service_id}

Overview

Deletes an existing incident service.

Arguments

Path Parameters

Name

Type

Description

service_id [required]

string

The ID of the incident service.

Response

OK

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example


# Path parameters
export service_id="CHANGE_ME"
# Curl command curl -X DELETE "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v2/services/${service_id}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
package main

import (
    "context"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    serviceId := "serviceId_example" // string | The ID of the incident service.

    configuration := datadog.NewConfiguration()
    configuration.SetUnstableOperationEnabled("DeleteIncidentService", true)

    apiClient := datadog.NewAPIClient(configuration)
    r, err := apiClient.IncidentServicesApi.DeleteIncidentService(ctx, serviceId)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IncidentServicesApi.DeleteIncidentService`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v2 import ApiClient, ApiException, Configuration
from datadog_api_client.v2.api import incident_services_api
from datadog_api_client.v2.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
configuration.unstable_operations["delete_incident_service"] = True

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = incident_services_api.IncidentServicesApi(api_client)
    service_id = "service_id_example"  # str | The ID of the incident service.

    # example passing only required values which don't have defaults set
    try:
        # Delete an existing incident service
        api_instance.delete_incident_service(service_id)
    except ApiException as e:
        print("Exception when calling IncidentServicesApi->delete_incident_service: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'

DatadogAPIClient::V2.configure do |config|
  config.unstable_operations[:delete_incident_service] = true
end

api_instance = DatadogAPIClient::V2::IncidentServicesAPI.new
service_id = 'service_id_example' # String | The ID of the incident service.

begin
  # Delete an existing incident service
  api_instance.delete_incident_service(service_id)
rescue DatadogAPIClient::V2::APIError => e
  puts "Error when calling IncidentServicesAPI->delete_incident_service: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import java.util.*;
import com.datadog.api.v2.client.ApiClient;
import com.datadog.api.v2.client.ApiException;
import com.datadog.api.v2.client.Configuration;
import com.datadog.api.v2.client.model.*;
import com.datadog.api.v2.client.api.IncidentServicesApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        IncidentServicesApi apiInstance = new IncidentServicesApi(defaultClient);
        String serviceId = "serviceId_example"; // String | The ID of the incident service.
        try {
            apiInstance.deleteIncidentService(serviceId);
        } catch (ApiException e) {
            System.err.println("Exception when calling IncidentServicesApi#deleteIncidentService");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

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

GET https://api.datadoghq.eu/api/v2/serviceshttps://api.ddog-gov.com/api/v2/serviceshttps://api.datadoghq.com/api/v2/serviceshttps://api.us3.datadoghq.com/api/v2/services

Overview

Get all incident services uploaded for the requesting user’s organization. If the include[users] query parameter is provided, the included attribute will contain the users related to these incident services.

Arguments

Query Strings

Name

Type

Description

include

string

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

page[size]

integer

Size for a given page.

page[offset]

integer

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

filter

string

A search query that filters services by name.

Response

OK

Response with a list of incident service payloads.

Expand All

Field

Type

Description

data [required]

[object]

An array of incident services.

attributes

object

The incident service's attributes from a response.

created

date-time

Timestamp of when the incident service was created.

modified

date-time

Timestamp of when the incident service was modified.

name

string

Name of the incident service.

id [required]

string

The incident service's ID.

relationships

object

The incident service's relationships.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

last_modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

type [required]

enum

Incident service resource type. Allowed enum values: services

included

[object <oneOf>]

Included related resources which 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.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id [required]

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

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

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

roles

object

Relationship to roles.

data [required]

[object]

An array containing type and ID of a role.

id

string

ID of the role.

type

enum

Roles type. Allowed enum values: roles

type [required]

enum

Users resource type. Allowed enum values: 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",
        "modified": "2019-09-19T10:00:00.000Z",
        "name": "service name"
      },
      "id": "00000000-0000-0000-0000-000000000000",
      "relationships": {
        "created_by": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "users"
          }
        },
        "last_modified_by": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "users"
          }
        }
      },
      "type": "services"
    }
  ],
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-0000-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

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example


# Curl command
curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v2/services" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    include := datadog.IncidentRelatedObject("users") // IncidentRelatedObject | Specifies which types of related objects should be included in the response. (optional)
    pageSize := int64(789) // int64 | Size for a given page. (optional) (default to 10)
    pageOffset := int64(789) // int64 | Specific offset to use as the beginning of the returned page. (optional) (default to 0)
    filter := "ExampleServiceName" // string | A search query that filters services by name. (optional)
    optionalParams := datadog.ListIncidentServicesOptionalParameters{
        Include: &include,
        PageSize: &pageSize,
        PageOffset: &pageOffset,
        Filter: &filter,
    }

    configuration := datadog.NewConfiguration()
    configuration.SetUnstableOperationEnabled("ListIncidentServices", true)

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.IncidentServicesApi.ListIncidentServices(ctx, optionalParams)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IncidentServicesApi.ListIncidentServices`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListIncidentServices`: IncidentServicesResponse
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from IncidentServicesApi.ListIncidentServices:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v2 import ApiClient, ApiException, Configuration
from datadog_api_client.v2.api import incident_services_api
from datadog_api_client.v2.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
configuration.unstable_operations["list_incident_services"] = True

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = incident_services_api.IncidentServicesApi(api_client)
    include = IncidentRelatedObject("users")  # IncidentRelatedObject | Specifies which types of related objects should be included in the response. (optional)
    page_size = 10  # int | Size for a given page. (optional) if omitted the server will use the default value of 10
    page_offset = 0  # int | Specific offset to use as the beginning of the returned page. (optional) if omitted the server will use the default value of 0
    filter = "ExampleServiceName"  # str | A search query that filters services by name. (optional)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get a list of all incident services
        api_response = api_instance.list_incident_services(include=include, page_size=page_size, page_offset=page_offset, filter=filter)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling IncidentServicesApi->list_incident_services: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'

DatadogAPIClient::V2.configure do |config|
  config.unstable_operations[:list_incident_services] = true
end

api_instance = DatadogAPIClient::V2::IncidentServicesAPI.new
opts = {
  include: DatadogAPIClient::V2::IncidentRelatedObject::USERS, # IncidentRelatedObject | Specifies which types of related objects should be included in the response.
  page_size: 789, # Integer | Size for a given page.
  page_offset: 789, # Integer | Specific offset to use as the beginning of the returned page.
  filter: 'ExampleServiceName' # String | A search query that filters services by name.
}

begin
  # Get a list of all incident services
  result = api_instance.list_incident_services(opts)
  p result
rescue DatadogAPIClient::V2::APIError => e
  puts "Error when calling IncidentServicesAPI->list_incident_services: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import java.util.*;
import com.datadog.api.v2.client.ApiClient;
import com.datadog.api.v2.client.ApiException;
import com.datadog.api.v2.client.Configuration;
import com.datadog.api.v2.client.model.*;
import com.datadog.api.v2.client.api.IncidentServicesApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        IncidentServicesApi apiInstance = new IncidentServicesApi(defaultClient);
        IncidentRelatedObject include = IncidentRelatedObject.fromValue("users"); // IncidentRelatedObject | Specifies which types of related objects should be included in the response.
        Long pageSize = 10L; // Long | Size for a given page.
        Long pageOffset = 0L; // Long | Specific offset to use as the beginning of the returned page.
        String filter = "ExampleServiceName"; // String | A search query that filters services by name.
        try {
	    IncidentServicesResponse result = apiInstance.listIncidentServices(new IncidentServicesApi.ListIncidentServicesOptionalParameters()
                .include(include)
                .pageSize(pageSize)
                .pageOffset(pageOffset)
                .filter(filter));
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IncidentServicesApi#listIncidentServices");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

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

GET https://api.datadoghq.eu/api/v2/services/{service_id}https://api.ddog-gov.com/api/v2/services/{service_id}https://api.datadoghq.com/api/v2/services/{service_id}https://api.us3.datadoghq.com/api/v2/services/{service_id}

Overview

Get details of an incident service. If the include[users] query parameter is provided, the included attribute will contain the users related to these incident services.

Arguments

Path Parameters

Name

Type

Description

service_id [required]

string

The ID of the incident service.

Query Strings

Name

Type

Description

include

string

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

Response

OK

Response with an incident service payload.

Expand All

Field

Type

Description

data [required]

object

Incident Service data from responses.

attributes

object

The incident service's attributes from a response.

created

date-time

Timestamp of when the incident service was created.

modified

date-time

Timestamp of when the incident service was modified.

name

string

Name of the incident service.

id [required]

string

The incident service's ID.

relationships

object

The incident service's relationships.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

last_modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

type [required]

enum

Incident service resource type. Allowed enum values: services

included

[object <oneOf>]

Included objects from relationships.

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.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id [required]

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

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

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

roles

object

Relationship to roles.

data [required]

[object]

An array containing type and ID of a role.

id

string

ID of the role.

type

enum

Roles type. Allowed enum values: roles

type [required]

enum

Users resource type. Allowed enum values: users

{
  "data": {
    "attributes": {
      "created": "2019-09-19T10:00:00.000Z",
      "modified": "2019-09-19T10:00:00.000Z",
      "name": "service name"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "relationships": {
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      },
      "last_modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      }
    },
    "type": "services"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example


# Path parameters
export service_id="CHANGE_ME"
# Curl command curl -X GET "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v2/services/${service_id}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    serviceId := "serviceId_example" // string | The ID of the incident service.
    include := datadog.IncidentRelatedObject("users") // IncidentRelatedObject | Specifies which types of related objects should be included in the response. (optional)
    optionalParams := datadog.GetIncidentServiceOptionalParameters{
        Include: &include,
    }

    configuration := datadog.NewConfiguration()
    configuration.SetUnstableOperationEnabled("GetIncidentService", true)

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.IncidentServicesApi.GetIncidentService(ctx, serviceId, optionalParams)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IncidentServicesApi.GetIncidentService`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetIncidentService`: IncidentServiceResponse
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from IncidentServicesApi.GetIncidentService:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v2 import ApiClient, ApiException, Configuration
from datadog_api_client.v2.api import incident_services_api
from datadog_api_client.v2.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
configuration.unstable_operations["get_incident_service"] = True

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = incident_services_api.IncidentServicesApi(api_client)
    service_id = "service_id_example"  # str | The ID of the incident service.
    include = IncidentRelatedObject("users")  # IncidentRelatedObject | Specifies which types of related objects should be included in the response. (optional)

    # example passing only required values which don't have defaults set
    try:
        # Get details of an incident service
        api_response = api_instance.get_incident_service(service_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling IncidentServicesApi->get_incident_service: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get details of an incident service
        api_response = api_instance.get_incident_service(service_id, include=include)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling IncidentServicesApi->get_incident_service: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'

DatadogAPIClient::V2.configure do |config|
  config.unstable_operations[:get_incident_service] = true
end

api_instance = DatadogAPIClient::V2::IncidentServicesAPI.new
service_id = 'service_id_example' # String | The ID of the incident service.
opts = {
  include: DatadogAPIClient::V2::IncidentRelatedObject::USERS # IncidentRelatedObject | Specifies which types of related objects should be included in the response.
}

begin
  # Get details of an incident service
  result = api_instance.get_incident_service(service_id, opts)
  p result
rescue DatadogAPIClient::V2::APIError => e
  puts "Error when calling IncidentServicesAPI->get_incident_service: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import java.util.*;
import com.datadog.api.v2.client.ApiClient;
import com.datadog.api.v2.client.ApiException;
import com.datadog.api.v2.client.Configuration;
import com.datadog.api.v2.client.model.*;
import com.datadog.api.v2.client.api.IncidentServicesApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        IncidentServicesApi apiInstance = new IncidentServicesApi(defaultClient);
        String serviceId = "serviceId_example"; // String | The ID of the incident service.
        IncidentRelatedObject include = IncidentRelatedObject.fromValue("users"); // IncidentRelatedObject | Specifies which types of related objects should be included in the response.
        try {
	    IncidentServiceResponse result = apiInstance.getIncidentService(serviceId, new IncidentServicesApi.GetIncidentServiceOptionalParameters()
                .include(include));
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IncidentServicesApi#getIncidentService");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

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

PATCH https://api.datadoghq.eu/api/v2/services/{service_id}https://api.ddog-gov.com/api/v2/services/{service_id}https://api.datadoghq.com/api/v2/services/{service_id}https://api.us3.datadoghq.com/api/v2/services/{service_id}

Overview

Updates an existing incident service. Only provide the attributes which should be updated as this request is a partial update.

Arguments

Path Parameters

Name

Type

Description

service_id [required]

string

The ID of the incident service.

Request

Body Data (required)

Incident Service Payload.

Expand All

Field

Type

Description

data [required]

object

Incident Service payload for update requests.

attributes

object

The incident service's attributes for an update request.

name [required]

string

Name of the incident service.

id

string

The incident service's ID.

relationships

object

The incident service's relationships.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

last_modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

type [required]

enum

Incident service resource type. Allowed enum values: services

{
  "data": {
    "attributes": {
      "name": "an example service name"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "type": "services"
  }
}

Response

OK

Response with an incident service payload.

Expand All

Field

Type

Description

data [required]

object

Incident Service data from responses.

attributes

object

The incident service's attributes from a response.

created

date-time

Timestamp of when the incident service was created.

modified

date-time

Timestamp of when the incident service was modified.

name

string

Name of the incident service.

id [required]

string

The incident service's ID.

relationships

object

The incident service's relationships.

created_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

last_modified_by

object

Relationship to user.

data [required]

object

Relationship to user object.

id [required]

string

A unique identifier that represents the user.

type [required]

enum

Users resource type. Allowed enum values: users

type [required]

enum

Incident service resource type. Allowed enum values: services

included

[object <oneOf>]

Included objects from relationships.

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.

modified_at

date-time

Time that the user was last modified.

name

string

Name of the user.

status

string

Status of the user.

title

string

Title of the user.

verified

boolean

Whether the user is verified.

id [required]

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

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

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

roles

object

Relationship to roles.

data [required]

[object]

An array containing type and ID of a role.

id

string

ID of the role.

type

enum

Roles type. Allowed enum values: roles

type [required]

enum

Users resource type. Allowed enum values: users

{
  "data": {
    "attributes": {
      "created": "2019-09-19T10:00:00.000Z",
      "modified": "2019-09-19T10:00:00.000Z",
      "name": "service name"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "relationships": {
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      },
      "last_modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      }
    },
    "type": "services"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-0000-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example


# Path parameters
export service_id="CHANGE_ME"
# Curl command curl -X PATCH "https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com/api/v2/services/${service_id}" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "name": "an example service name" }, "type": "services" } } EOF
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    serviceId := "serviceId_example" // string | The ID of the incident service.
    body := *datadog.NewIncidentServiceUpdateRequest(*datadog.NewIncidentServiceUpdateData(datadog.IncidentServiceType("services"))) // IncidentServiceUpdateRequest | Incident Service Payload.

    configuration := datadog.NewConfiguration()
    configuration.SetUnstableOperationEnabled("UpdateIncidentService", true)

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.IncidentServicesApi.UpdateIncidentService(ctx, serviceId, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IncidentServicesApi.UpdateIncidentService`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateIncidentService`: IncidentServiceResponse
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from IncidentServicesApi.UpdateIncidentService:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v2 import ApiClient, ApiException, Configuration
from datadog_api_client.v2.api import incident_services_api
from datadog_api_client.v2.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()
configuration.unstable_operations["update_incident_service"] = True

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = incident_services_api.IncidentServicesApi(api_client)
    service_id = "service_id_example"  # str | The ID of the incident service.
    body = IncidentServiceUpdateRequest(
        data=IncidentServiceUpdateData(
            attributes=IncidentServiceUpdateAttributes(
                name="an example service name",
            ),
            id="00000000-0000-0000-0000-000000000000",
            relationships=IncidentServiceRelationships(
                created_by=RelationshipToUser(
                    data=RelationshipToUserData(
                        id="00000000-0000-0000-0000-000000000000",
                        type=UsersType("users"),
                    ),
                ),
                last_modified_by=RelationshipToUser(
                    data=RelationshipToUserData(
                        id="00000000-0000-0000-0000-000000000000",
                        type=UsersType("users"),
                    ),
                ),
            ),
            type=IncidentServiceType("services"),
        ),
    )  # IncidentServiceUpdateRequest | Incident Service Payload.

    # example passing only required values which don't have defaults set
    try:
        # Update an existing incident service
        api_response = api_instance.update_incident_service(service_id, body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling IncidentServicesApi->update_incident_service: %s\n" % e)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
require 'datadog_api_client'

DatadogAPIClient::V2.configure do |config|
  config.unstable_operations[:update_incident_service] = true
end

api_instance = DatadogAPIClient::V2::IncidentServicesAPI.new
service_id = 'service_id_example' # String | The ID of the incident service.
body = DatadogAPIClient::V2::IncidentServiceUpdateRequest.new({data: DatadogAPIClient::V2::IncidentServiceUpdateData.new({type: DatadogAPIClient::V2::IncidentServiceType::SERVICES})}) # IncidentServiceUpdateRequest | Incident Service Payload.

begin
  # Update an existing incident service
  result = api_instance.update_incident_service(service_id, body)
  p result
rescue DatadogAPIClient::V2::APIError => e
  puts "Error when calling IncidentServicesAPI->update_incident_service: #{e}"
end

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
import java.util.*;
import com.datadog.api.v2.client.ApiClient;
import com.datadog.api.v2.client.ApiException;
import com.datadog.api.v2.client.Configuration;
import com.datadog.api.v2.client.model.*;
import com.datadog.api.v2.client.api.IncidentServicesApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        IncidentServicesApi apiInstance = new IncidentServicesApi(defaultClient);
        String serviceId = "serviceId_example"; // String | The ID of the incident service.
        IncidentServiceUpdateRequest body = new IncidentServiceUpdateRequest(); // IncidentServiceUpdateRequest | Incident Service Payload.
        try {
            IncidentServiceResponse result = apiInstance.updateIncidentService(serviceId, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IncidentServicesApi#updateIncidentService");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

              
export DD_SITE="datadoghq.comus3.datadoghq.comdatadoghq.euddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"