Service Definition

API to create, update, retrieve and delete service definitions. Note: Service Catalog v3.0 schema has new API endpoints documented under Software Catalog. Use the following Service Definition endpoints for v2.2 and earlier.

GET https://api.ap1.datadoghq.com/api/v2/services/definitionshttps://api.datadoghq.eu/api/v2/services/definitionshttps://api.ddog-gov.com/api/v2/services/definitionshttps://api.datadoghq.com/api/v2/services/definitionshttps://api.us3.datadoghq.com/api/v2/services/definitionshttps://api.us5.datadoghq.com/api/v2/services/definitions

개요

Get a list of all service definitions from the Datadog Service Catalog. This endpoint requires the apm_service_catalog_read permission.

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

인수

쿼리 문자열

이름

유형

설명

page[size]

integer

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

page[number]

integer

Specific page number to return.

schema_version

enum

The schema version desired in the response.
Allowed enum values: v1, v2, v2.1, v2.2

응답

OK

Create service definitions response.

Expand All

항목

유형

설명

data

[object]

Data representing service definitions.

attributes

object

Service definition attributes.

meta

object

Metadata about a service definition.

github-html-url

string

GitHub HTML URL.

ingested-schema-version

string

Ingestion schema version.

ingestion-source

string

Ingestion source of the service definition.

last-modified-time

string

Last modified time of the service definition.

origin

string

User defined origin of the service definition.

origin-detail

string

User defined origin's detail of the service definition.

warnings

[object]

A list of schema validation warnings.

instance-location

string

The warning instance location.

keyword-location

string

The warning keyword location.

message

string

The warning message.

schema

 <oneOf>

Service definition schema.

Option 1

object

DEPRECATED: Deprecated - Service definition V1 for providing additional service metadata and integrations.

contact

object

Contact information about the service.

email

string

Service owner’s email.

slack

string

Service owner’s Slack channel.

extensions

object

Extensions to V1 schema.

external-resources

[object]

A list of external links related to the services.

name [required]

string

Link name.

type [required]

enum

Link type. Allowed enum values: doc,wiki,runbook,url,repo,dashboard,oncall,code,link

url [required]

string

Link URL.

info [required]

object

Basic information about a service.

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

description

string

A short description of the service.

display-name

string

A friendly name of the service.

service-tier

string

Service tier.

integrations

object

Third party integrations that Datadog supports.

pagerduty

string

PagerDuty service URL for the service.

org

object

Org related information about the service.

application

string

App feature this service supports.

team

string

Team that owns the service.

schema-version [required]

enum

Schema version being used. Allowed enum values: v1

default: v1

tags

[string]

A set of custom tags.

Option 2

object

Service definition V2 for providing service metadata and integrations.

contacts

[ <oneOf>]

A list of contacts related to the services.

Option 1

object

Service owner's email.

contact [required]

string

Contact value.

name

string

Contact email.

type [required]

enum

Contact type. Allowed enum values: email

Option 2

object

Service owner's Slack channel.

contact [required]

string

Slack Channel.

name

string

Contact Slack.

type [required]

enum

Contact type. Allowed enum values: slack

Option 3

object

Service owner's Microsoft Teams.

contact [required]

string

Contact value.

name

string

Contact Microsoft Teams.

type [required]

enum

Contact type. Allowed enum values: microsoft-teams

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

dd-team

string

Experimental feature. A Team handle that matches a Team in the Datadog Teams product.

docs

[object]

A list of documentation related to the services.

name [required]

string

Document name.

provider

string

Document provider.

url [required]

string

Document URL.

extensions

object

Extensions to V2 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

string

PagerDuty service URL for the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

type [required]

enum

Link type. Allowed enum values: doc,wiki,runbook,url,repo,dashboard,oncall,code,link

url [required]

string

Link URL.

repos

[object]

A list of code repositories related to the services.

name [required]

string

Repository name.

provider

string

Repository provider.

url [required]

string

Repository URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2

default: v2

tags

[string]

A set of custom tags.

team

string

Team that owns the service.

Option 3

object

Service definition v2.1 for providing service metadata and integrations.

application

string

Identifier for a group of related services serving a product feature, which the service is a part of.

contacts

[ <oneOf>]

A list of contacts related to the services.

Option 1

object

Service owner's email.

contact [required]

string

Contact value.

name

string

Contact email.

type [required]

enum

Contact type. Allowed enum values: email

Option 2

object

Service owner's Slack channel.

contact [required]

string

Slack Channel.

name

string

Contact Slack.

type [required]

enum

Contact type. Allowed enum values: slack

Option 3

object

Service owner's Microsoft Teams.

contact [required]

string

Contact value.

name

string

Contact Microsoft Teams.

type [required]

enum

Contact type. Allowed enum values: microsoft-teams

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

description

string

A short description of the service.

extensions

object

Extensions to v2.1 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

object

PagerDuty integration for the service.

service-url

string

PagerDuty service url.

lifecycle

string

The current life cycle phase of the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

provider

string

Link provider.

type [required]

enum

Link type. Allowed enum values: doc,repo,runbook,dashboard,other

url [required]

string

Link URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2.1

default: v2.1

tags

[string]

A set of custom tags.

team

string

Team that owns the service. It is used to locate a team defined in Datadog Teams if it exists.

tier

string

Importance of the service.

Option 4

object

Service definition v2.2 for providing service metadata and integrations.

application

string

Identifier for a group of related services serving a product feature, which the service is a part of.

ci-pipeline-fingerprints

[string]

A set of CI fingerprints.

contacts

[object]

A list of contacts related to the services.

contact [required]

string

Contact value.

name

string

Contact Name.

type [required]

string

Contact type. Datadog recognizes the following types: email, slack, and microsoft-teams.

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

description

string

A short description of the service.

extensions

object

Extensions to v2.2 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

object

PagerDuty integration for the service.

service-url

string

PagerDuty service url.

languages

[string]

The service's programming language. Datadog recognizes the following languages: dotnet, go, java, js, php, python, ruby, and c++.

lifecycle

string

The current life cycle phase of the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

provider

string

Link provider.

type [required]

string

Link type. Datadog recognizes the following types: runbook, doc, repo, dashboard, and other.

url [required]

string

Link URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2.2

default: v2.2

tags

[string]

A set of custom tags.

team

string

Team that owns the service. It is used to locate a team defined in Datadog Teams if it exists.

tier

string

Importance of the service.

type

string

The type of service.

id

string

Service definition id.

type

string

Service definition type.

{
  "data": [
    {
      "attributes": {
        "meta": {
          "github-html-url": "string",
          "ingested-schema-version": "string",
          "ingestion-source": "string",
          "last-modified-time": "string",
          "origin": "string",
          "origin-detail": "string",
          "warnings": [
            {
              "instance-location": "string",
              "keyword-location": "string",
              "message": "string"
            }
          ]
        },
        "schema": {
          "contact": {
            "email": "contact@datadoghq.com",
            "slack": "https://yourcompany.slack.com/archives/channel123"
          },
          "extensions": {
            "myorg/extension": "extensionValue"
          },
          "external-resources": [
            {
              "name": "Runbook",
              "type": "runbook",
              "url": "https://my-runbook"
            }
          ],
          "info": {
            "dd-service": "myservice",
            "description": "A shopping cart service",
            "display-name": "My Service",
            "service-tier": "Tier 1"
          },
          "integrations": {
            "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
          },
          "org": {
            "application": "E-Commerce",
            "team": "my-team"
          },
          "schema-version": "v1",
          "tags": [
            "my:tag",
            "service:tag"
          ]
        }
      },
      "id": "string",
      "type": "string"
    }
  ]
}

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 all service definitions returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ServiceDefinitionApi;
import com.datadog.api.client.v2.api.ServiceDefinitionApi.ListServiceDefinitionsOptionalParameters;
import com.datadog.api.client.v2.model.ServiceDefinitionSchemaVersions;
import com.datadog.api.client.v2.model.ServiceDefinitionsListResponse;

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

    try {
      ServiceDefinitionsListResponse result =
          apiInstance.listServiceDefinitions(
              new ListServiceDefinitionsOptionalParameters()
                  .schemaVersion(ServiceDefinitionSchemaVersions.V2_1));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ServiceDefinitionApi#listServiceDefinitions");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"

POST https://api.ap1.datadoghq.com/api/v2/services/definitionshttps://api.datadoghq.eu/api/v2/services/definitionshttps://api.ddog-gov.com/api/v2/services/definitionshttps://api.datadoghq.com/api/v2/services/definitionshttps://api.us3.datadoghq.com/api/v2/services/definitionshttps://api.us5.datadoghq.com/api/v2/services/definitions

개요

Create or update service definition in the Datadog Service Catalog. This endpoint requires the apm_service_catalog_write permission.

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

요청

Body Data (required)

Service Definition YAML/JSON.

Expand All

항목

유형

설명

Option 1

object

Service definition v2.2 for providing service metadata and integrations.

application

string

Identifier for a group of related services serving a product feature, which the service is a part of.

ci-pipeline-fingerprints

[string]

A set of CI fingerprints.

contacts

[object]

A list of contacts related to the services.

contact [required]

string

Contact value.

name

string

Contact Name.

type [required]

string

Contact type. Datadog recognizes the following types: email, slack, and microsoft-teams.

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

description

string

A short description of the service.

extensions

object

Extensions to v2.2 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

object

PagerDuty integration for the service.

service-url

string

PagerDuty service url.

languages

[string]

The service's programming language. Datadog recognizes the following languages: dotnet, go, java, js, php, python, ruby, and c++.

lifecycle

string

The current life cycle phase of the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

provider

string

Link provider.

type [required]

string

Link type. Datadog recognizes the following types: runbook, doc, repo, dashboard, and other.

url [required]

string

Link URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2.2

default: v2.2

tags

[string]

A set of custom tags.

team

string

Team that owns the service. It is used to locate a team defined in Datadog Teams if it exists.

tier

string

Importance of the service.

type

string

The type of service.

Option 2

object

Service definition v2.1 for providing service metadata and integrations.

application

string

Identifier for a group of related services serving a product feature, which the service is a part of.

contacts

[ <oneOf>]

A list of contacts related to the services.

Option 1

object

Service owner's email.

contact [required]

string

Contact value.

name

string

Contact email.

type [required]

enum

Contact type. Allowed enum values: email

Option 2

object

Service owner's Slack channel.

contact [required]

string

Slack Channel.

name

string

Contact Slack.

type [required]

enum

Contact type. Allowed enum values: slack

Option 3

object

Service owner's Microsoft Teams.

contact [required]

string

Contact value.

name

string

Contact Microsoft Teams.

type [required]

enum

Contact type. Allowed enum values: microsoft-teams

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

description

string

A short description of the service.

extensions

object

Extensions to v2.1 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

object

PagerDuty integration for the service.

service-url

string

PagerDuty service url.

lifecycle

string

The current life cycle phase of the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

provider

string

Link provider.

type [required]

enum

Link type. Allowed enum values: doc,repo,runbook,dashboard,other

url [required]

string

Link URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2.1

default: v2.1

tags

[string]

A set of custom tags.

team

string

Team that owns the service. It is used to locate a team defined in Datadog Teams if it exists.

tier

string

Importance of the service.

Option 3

object

Service definition V2 for providing service metadata and integrations.

contacts

[ <oneOf>]

A list of contacts related to the services.

Option 1

object

Service owner's email.

contact [required]

string

Contact value.

name

string

Contact email.

type [required]

enum

Contact type. Allowed enum values: email

Option 2

object

Service owner's Slack channel.

contact [required]

string

Slack Channel.

name

string

Contact Slack.

type [required]

enum

Contact type. Allowed enum values: slack

Option 3

object

Service owner's Microsoft Teams.

contact [required]

string

Contact value.

name

string

Contact Microsoft Teams.

type [required]

enum

Contact type. Allowed enum values: microsoft-teams

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

dd-team

string

Experimental feature. A Team handle that matches a Team in the Datadog Teams product.

docs

[object]

A list of documentation related to the services.

name [required]

string

Document name.

provider

string

Document provider.

url [required]

string

Document URL.

extensions

object

Extensions to V2 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

string

PagerDuty service URL for the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

type [required]

enum

Link type. Allowed enum values: doc,wiki,runbook,url,repo,dashboard,oncall,code,link

url [required]

string

Link URL.

repos

[object]

A list of code repositories related to the services.

name [required]

string

Repository name.

provider

string

Repository provider.

url [required]

string

Repository URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2

default: v2

tags

[string]

A set of custom tags.

team

string

Team that owns the service.

Option 4

string

Service Definition in raw JSON/YAML representation.

{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "dd-team": "my-team",
  "docs": [
    {
      "name": "Architecture",
      "provider": "google drive",
      "url": "https://gdrive/mydoc"
    }
  ],
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    }
  ],
  "repos": [
    {
      "name": "Source Code",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    }
  ],
  "schema-version": "v2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.1",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}
{
  "contacts": [
    {
      "contact": "contact@datadoghq.com",
      "name": "Team Email",
      "type": "email"
    }
  ],
  "dd-service": "service-exampleservicedefinition",
  "extensions": {
    "myorgextension": "extensionvalue"
  },
  "integrations": {
    "opsgenie": {
      "region": "US",
      "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"
    },
    "pagerduty": {
      "service-url": "https://my-org.pagerduty.com/service-directory/PMyService"
    }
  },
  "links": [
    {
      "name": "Runbook",
      "type": "runbook",
      "url": "https://my-runbook"
    },
    {
      "name": "Source Code",
      "type": "repo",
      "provider": "GitHub",
      "url": "https://github.com/DataDog/schema"
    },
    {
      "name": "Architecture",
      "type": "doc",
      "provider": "Gigoogle drivetHub",
      "url": "https://my-runbook"
    }
  ],
  "schema-version": "v2.2",
  "tags": [
    "my:tag",
    "service:tag"
  ],
  "team": "my-team"
}

응답

CREATED

Create service definitions response.

Expand All

항목

유형

설명

data

[object]

Create service definitions response payload.

attributes

object

Service definition attributes.

meta

object

Metadata about a service definition.

github-html-url

string

GitHub HTML URL.

ingested-schema-version

string

Ingestion schema version.

ingestion-source

string

Ingestion source of the service definition.

last-modified-time

string

Last modified time of the service definition.

origin

string

User defined origin of the service definition.

origin-detail

string

User defined origin's detail of the service definition.

warnings

[object]

A list of schema validation warnings.

instance-location

string

The warning instance location.

keyword-location

string

The warning keyword location.

message

string

The warning message.

schema

 <oneOf>

Service definition schema.

Option 1

object

DEPRECATED: Deprecated - Service definition V1 for providing additional service metadata and integrations.

contact

object

Contact information about the service.

email

string

Service owner’s email.

slack

string

Service owner’s Slack channel.

extensions

object

Extensions to V1 schema.

external-resources

[object]

A list of external links related to the services.

name [required]

string

Link name.

type [required]

enum

Link type. Allowed enum values: doc,wiki,runbook,url,repo,dashboard,oncall,code,link

url [required]

string

Link URL.

info [required]

object

Basic information about a service.

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

description

string

A short description of the service.

display-name

string

A friendly name of the service.

service-tier

string

Service tier.

integrations

object

Third party integrations that Datadog supports.

pagerduty

string

PagerDuty service URL for the service.

org

object

Org related information about the service.

application

string

App feature this service supports.

team

string

Team that owns the service.

schema-version [required]

enum

Schema version being used. Allowed enum values: v1

default: v1

tags

[string]

A set of custom tags.

Option 2

object

Service definition V2 for providing service metadata and integrations.

contacts

[ <oneOf>]

A list of contacts related to the services.

Option 1

object

Service owner's email.

contact [required]

string

Contact value.

name

string

Contact email.

type [required]

enum

Contact type. Allowed enum values: email

Option 2

object

Service owner's Slack channel.

contact [required]

string

Slack Channel.

name

string

Contact Slack.

type [required]

enum

Contact type. Allowed enum values: slack

Option 3

object

Service owner's Microsoft Teams.

contact [required]

string

Contact value.

name

string

Contact Microsoft Teams.

type [required]

enum

Contact type. Allowed enum values: microsoft-teams

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

dd-team

string

Experimental feature. A Team handle that matches a Team in the Datadog Teams product.

docs

[object]

A list of documentation related to the services.

name [required]

string

Document name.

provider

string

Document provider.

url [required]

string

Document URL.

extensions

object

Extensions to V2 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

string

PagerDuty service URL for the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

type [required]

enum

Link type. Allowed enum values: doc,wiki,runbook,url,repo,dashboard,oncall,code,link

url [required]

string

Link URL.

repos

[object]

A list of code repositories related to the services.

name [required]

string

Repository name.

provider

string

Repository provider.

url [required]

string

Repository URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2

default: v2

tags

[string]

A set of custom tags.

team

string

Team that owns the service.

Option 3

object

Service definition v2.1 for providing service metadata and integrations.

application

string

Identifier for a group of related services serving a product feature, which the service is a part of.

contacts

[ <oneOf>]

A list of contacts related to the services.

Option 1

object

Service owner's email.

contact [required]

string

Contact value.

name

string

Contact email.

type [required]

enum

Contact type. Allowed enum values: email

Option 2

object

Service owner's Slack channel.

contact [required]

string

Slack Channel.

name

string

Contact Slack.

type [required]

enum

Contact type. Allowed enum values: slack

Option 3

object

Service owner's Microsoft Teams.

contact [required]

string

Contact value.

name

string

Contact Microsoft Teams.

type [required]

enum

Contact type. Allowed enum values: microsoft-teams

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

description

string

A short description of the service.

extensions

object

Extensions to v2.1 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

object

PagerDuty integration for the service.

service-url

string

PagerDuty service url.

lifecycle

string

The current life cycle phase of the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

provider

string

Link provider.

type [required]

enum

Link type. Allowed enum values: doc,repo,runbook,dashboard,other

url [required]

string

Link URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2.1

default: v2.1

tags

[string]

A set of custom tags.

team

string

Team that owns the service. It is used to locate a team defined in Datadog Teams if it exists.

tier

string

Importance of the service.

Option 4

object

Service definition v2.2 for providing service metadata and integrations.

application

string

Identifier for a group of related services serving a product feature, which the service is a part of.

ci-pipeline-fingerprints

[string]

A set of CI fingerprints.

contacts

[object]

A list of contacts related to the services.

contact [required]

string

Contact value.

name

string

Contact Name.

type [required]

string

Contact type. Datadog recognizes the following types: email, slack, and microsoft-teams.

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

description

string

A short description of the service.

extensions

object

Extensions to v2.2 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

object

PagerDuty integration for the service.

service-url

string

PagerDuty service url.

languages

[string]

The service's programming language. Datadog recognizes the following languages: dotnet, go, java, js, php, python, ruby, and c++.

lifecycle

string

The current life cycle phase of the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

provider

string

Link provider.

type [required]

string

Link type. Datadog recognizes the following types: runbook, doc, repo, dashboard, and other.

url [required]

string

Link URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2.2

default: v2.2

tags

[string]

A set of custom tags.

team

string

Team that owns the service. It is used to locate a team defined in Datadog Teams if it exists.

tier

string

Importance of the service.

type

string

The type of service.

id

string

Service definition id.

type

string

Service definition type.

{
  "data": [
    {
      "attributes": {
        "meta": {
          "github-html-url": "string",
          "ingested-schema-version": "string",
          "ingestion-source": "string",
          "last-modified-time": "string",
          "origin": "string",
          "origin-detail": "string",
          "warnings": [
            {
              "instance-location": "string",
              "keyword-location": "string",
              "message": "string"
            }
          ]
        },
        "schema": {
          "contact": {
            "email": "contact@datadoghq.com",
            "slack": "https://yourcompany.slack.com/archives/channel123"
          },
          "extensions": {
            "myorg/extension": "extensionValue"
          },
          "external-resources": [
            {
              "name": "Runbook",
              "type": "runbook",
              "url": "https://my-runbook"
            }
          ],
          "info": {
            "dd-service": "myservice",
            "description": "A shopping cart service",
            "display-name": "My Service",
            "service-tier": "Tier 1"
          },
          "integrations": {
            "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
          },
          "org": {
            "application": "E-Commerce",
            "team": "my-team"
          },
          "schema-version": "v1",
          "tags": [
            "my:tag",
            "service:tag"
          ]
        }
      },
      "id": "string",
      "type": "string"
    }
  ]
}

Bad Request

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"
  ]
}

Conflict

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 or update service definition using schema v2 returns "CREATED" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ServiceDefinitionApi;
import com.datadog.api.client.v2.model.ServiceDefinitionCreateResponse;
import com.datadog.api.client.v2.model.ServiceDefinitionV2;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Contact;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Doc;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Email;
import com.datadog.api.client.v2.model.ServiceDefinitionV2EmailType;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Integrations;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Link;
import com.datadog.api.client.v2.model.ServiceDefinitionV2LinkType;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Opsgenie;
import com.datadog.api.client.v2.model.ServiceDefinitionV2OpsgenieRegion;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Repo;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Version;
import com.datadog.api.client.v2.model.ServiceDefinitionsCreateRequest;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;

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

    ServiceDefinitionsCreateRequest body =
        new ServiceDefinitionsCreateRequest(
            new ServiceDefinitionV2()
                .contacts(
                    Collections.singletonList(
                        new ServiceDefinitionV2Contact(
                            new ServiceDefinitionV2Email()
                                .contact("contact@datadoghq.com")
                                .name("Team Email")
                                .type(ServiceDefinitionV2EmailType.EMAIL))))
                .ddService("service-exampleservicedefinition")
                .ddTeam("my-team")
                .docs(
                    Collections.singletonList(
                        new ServiceDefinitionV2Doc()
                            .name("Architecture")
                            .provider("google drive")
                            .url("https://gdrive/mydoc")))
                .extensions(Map.ofEntries(Map.entry("myorgextension", "extensionvalue")))
                .integrations(
                    new ServiceDefinitionV2Integrations()
                        .opsgenie(
                            new ServiceDefinitionV2Opsgenie()
                                .region(ServiceDefinitionV2OpsgenieRegion.US)
                                .serviceUrl(
                                    "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"))
                        .pagerduty("https://my-org.pagerduty.com/service-directory/PMyService"))
                .links(
                    Collections.singletonList(
                        new ServiceDefinitionV2Link()
                            .name("Runbook")
                            .type(ServiceDefinitionV2LinkType.RUNBOOK)
                            .url("https://my-runbook")))
                .repos(
                    Collections.singletonList(
                        new ServiceDefinitionV2Repo()
                            .name("Source Code")
                            .provider("GitHub")
                            .url("https://github.com/DataDog/schema")))
                .schemaVersion(ServiceDefinitionV2Version.V2)
                .tags(Arrays.asList("my:tag", "service:tag"))
                .team("my-team"));

    try {
      ServiceDefinitionCreateResponse result = apiInstance.createOrUpdateServiceDefinitions(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling ServiceDefinitionApi#createOrUpdateServiceDefinitions");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// Create or update service definition using schema v2-1 returns "CREATED" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ServiceDefinitionApi;
import com.datadog.api.client.v2.model.ServiceDefinitionCreateResponse;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot1;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot1Contact;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot1Email;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot1EmailType;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot1Integrations;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot1Link;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot1LinkType;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot1Opsgenie;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot1OpsgenieRegion;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot1Pagerduty;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot1Version;
import com.datadog.api.client.v2.model.ServiceDefinitionsCreateRequest;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;

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

    ServiceDefinitionsCreateRequest body =
        new ServiceDefinitionsCreateRequest(
            new ServiceDefinitionV2Dot1()
                .contacts(
                    Collections.singletonList(
                        new ServiceDefinitionV2Dot1Contact(
                            new ServiceDefinitionV2Dot1Email()
                                .contact("contact@datadoghq.com")
                                .name("Team Email")
                                .type(ServiceDefinitionV2Dot1EmailType.EMAIL))))
                .ddService("service-exampleservicedefinition")
                .extensions(Map.ofEntries(Map.entry("myorgextension", "extensionvalue")))
                .integrations(
                    new ServiceDefinitionV2Dot1Integrations()
                        .opsgenie(
                            new ServiceDefinitionV2Dot1Opsgenie()
                                .region(ServiceDefinitionV2Dot1OpsgenieRegion.US)
                                .serviceUrl(
                                    "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"))
                        .pagerduty(
                            new ServiceDefinitionV2Dot1Pagerduty()
                                .serviceUrl(
                                    "https://my-org.pagerduty.com/service-directory/PMyService")))
                .links(
                    Arrays.asList(
                        new ServiceDefinitionV2Dot1Link()
                            .name("Runbook")
                            .type(ServiceDefinitionV2Dot1LinkType.RUNBOOK)
                            .url("https://my-runbook"),
                        new ServiceDefinitionV2Dot1Link()
                            .name("Source Code")
                            .type(ServiceDefinitionV2Dot1LinkType.REPO)
                            .provider("GitHub")
                            .url("https://github.com/DataDog/schema"),
                        new ServiceDefinitionV2Dot1Link()
                            .name("Architecture")
                            .type(ServiceDefinitionV2Dot1LinkType.DOC)
                            .provider("Gigoogle drivetHub")
                            .url("https://my-runbook")))
                .schemaVersion(ServiceDefinitionV2Dot1Version.V2_1)
                .tags(Arrays.asList("my:tag", "service:tag"))
                .team("my-team"));

    try {
      ServiceDefinitionCreateResponse result = apiInstance.createOrUpdateServiceDefinitions(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling ServiceDefinitionApi#createOrUpdateServiceDefinitions");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// Create or update service definition using schema v2-2 returns "CREATED" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ServiceDefinitionApi;
import com.datadog.api.client.v2.model.ServiceDefinitionCreateResponse;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot2;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot2Contact;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot2Integrations;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot2Link;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot2Opsgenie;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot2OpsgenieRegion;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot2Pagerduty;
import com.datadog.api.client.v2.model.ServiceDefinitionV2Dot2Version;
import com.datadog.api.client.v2.model.ServiceDefinitionsCreateRequest;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;

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

    ServiceDefinitionsCreateRequest body =
        new ServiceDefinitionsCreateRequest(
            new ServiceDefinitionV2Dot2()
                .contacts(
                    Collections.singletonList(
                        new ServiceDefinitionV2Dot2Contact()
                            .contact("contact@datadoghq.com")
                            .name("Team Email")
                            .type("email")))
                .ddService("service-exampleservicedefinition")
                .extensions(Map.ofEntries(Map.entry("myorgextension", "extensionvalue")))
                .integrations(
                    new ServiceDefinitionV2Dot2Integrations()
                        .opsgenie(
                            new ServiceDefinitionV2Dot2Opsgenie()
                                .region(ServiceDefinitionV2Dot2OpsgenieRegion.US)
                                .serviceUrl(
                                    "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"))
                        .pagerduty(
                            new ServiceDefinitionV2Dot2Pagerduty()
                                .serviceUrl(
                                    "https://my-org.pagerduty.com/service-directory/PMyService")))
                .links(
                    Arrays.asList(
                        new ServiceDefinitionV2Dot2Link()
                            .name("Runbook")
                            .type("runbook")
                            .url("https://my-runbook"),
                        new ServiceDefinitionV2Dot2Link()
                            .name("Source Code")
                            .type("repo")
                            .provider("GitHub")
                            .url("https://github.com/DataDog/schema"),
                        new ServiceDefinitionV2Dot2Link()
                            .name("Architecture")
                            .type("doc")
                            .provider("Gigoogle drivetHub")
                            .url("https://my-runbook")))
                .schemaVersion(ServiceDefinitionV2Dot2Version.V2_2)
                .tags(Arrays.asList("my:tag", "service:tag"))
                .team("my-team"));

    try {
      ServiceDefinitionCreateResponse result = apiInstance.createOrUpdateServiceDefinitions(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling ServiceDefinitionApi#createOrUpdateServiceDefinitions");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"

GET https://api.ap1.datadoghq.com/api/v2/services/definitions/{service_name}https://api.datadoghq.eu/api/v2/services/definitions/{service_name}https://api.ddog-gov.com/api/v2/services/definitions/{service_name}https://api.datadoghq.com/api/v2/services/definitions/{service_name}https://api.us3.datadoghq.com/api/v2/services/definitions/{service_name}https://api.us5.datadoghq.com/api/v2/services/definitions/{service_name}

개요

Get a single service definition from the Datadog Service Catalog. This endpoint requires the apm_service_catalog_read permission.

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

인수

경로 파라미터

이름

유형

설명

service_name [required]

string

The name of the service.

쿼리 문자열

이름

유형

설명

schema_version

enum

The schema version desired in the response.
Allowed enum values: v1, v2, v2.1, v2.2

응답

OK

Get service definition response.

Expand All

항목

유형

설명

data

object

Service definition data.

attributes

object

Service definition attributes.

meta

object

Metadata about a service definition.

github-html-url

string

GitHub HTML URL.

ingested-schema-version

string

Ingestion schema version.

ingestion-source

string

Ingestion source of the service definition.

last-modified-time

string

Last modified time of the service definition.

origin

string

User defined origin of the service definition.

origin-detail

string

User defined origin's detail of the service definition.

warnings

[object]

A list of schema validation warnings.

instance-location

string

The warning instance location.

keyword-location

string

The warning keyword location.

message

string

The warning message.

schema

 <oneOf>

Service definition schema.

Option 1

object

DEPRECATED: Deprecated - Service definition V1 for providing additional service metadata and integrations.

contact

object

Contact information about the service.

email

string

Service owner’s email.

slack

string

Service owner’s Slack channel.

extensions

object

Extensions to V1 schema.

external-resources

[object]

A list of external links related to the services.

name [required]

string

Link name.

type [required]

enum

Link type. Allowed enum values: doc,wiki,runbook,url,repo,dashboard,oncall,code,link

url [required]

string

Link URL.

info [required]

object

Basic information about a service.

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

description

string

A short description of the service.

display-name

string

A friendly name of the service.

service-tier

string

Service tier.

integrations

object

Third party integrations that Datadog supports.

pagerduty

string

PagerDuty service URL for the service.

org

object

Org related information about the service.

application

string

App feature this service supports.

team

string

Team that owns the service.

schema-version [required]

enum

Schema version being used. Allowed enum values: v1

default: v1

tags

[string]

A set of custom tags.

Option 2

object

Service definition V2 for providing service metadata and integrations.

contacts

[ <oneOf>]

A list of contacts related to the services.

Option 1

object

Service owner's email.

contact [required]

string

Contact value.

name

string

Contact email.

type [required]

enum

Contact type. Allowed enum values: email

Option 2

object

Service owner's Slack channel.

contact [required]

string

Slack Channel.

name

string

Contact Slack.

type [required]

enum

Contact type. Allowed enum values: slack

Option 3

object

Service owner's Microsoft Teams.

contact [required]

string

Contact value.

name

string

Contact Microsoft Teams.

type [required]

enum

Contact type. Allowed enum values: microsoft-teams

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

dd-team

string

Experimental feature. A Team handle that matches a Team in the Datadog Teams product.

docs

[object]

A list of documentation related to the services.

name [required]

string

Document name.

provider

string

Document provider.

url [required]

string

Document URL.

extensions

object

Extensions to V2 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

string

PagerDuty service URL for the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

type [required]

enum

Link type. Allowed enum values: doc,wiki,runbook,url,repo,dashboard,oncall,code,link

url [required]

string

Link URL.

repos

[object]

A list of code repositories related to the services.

name [required]

string

Repository name.

provider

string

Repository provider.

url [required]

string

Repository URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2

default: v2

tags

[string]

A set of custom tags.

team

string

Team that owns the service.

Option 3

object

Service definition v2.1 for providing service metadata and integrations.

application

string

Identifier for a group of related services serving a product feature, which the service is a part of.

contacts

[ <oneOf>]

A list of contacts related to the services.

Option 1

object

Service owner's email.

contact [required]

string

Contact value.

name

string

Contact email.

type [required]

enum

Contact type. Allowed enum values: email

Option 2

object

Service owner's Slack channel.

contact [required]

string

Slack Channel.

name

string

Contact Slack.

type [required]

enum

Contact type. Allowed enum values: slack

Option 3

object

Service owner's Microsoft Teams.

contact [required]

string

Contact value.

name

string

Contact Microsoft Teams.

type [required]

enum

Contact type. Allowed enum values: microsoft-teams

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

description

string

A short description of the service.

extensions

object

Extensions to v2.1 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

object

PagerDuty integration for the service.

service-url

string

PagerDuty service url.

lifecycle

string

The current life cycle phase of the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

provider

string

Link provider.

type [required]

enum

Link type. Allowed enum values: doc,repo,runbook,dashboard,other

url [required]

string

Link URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2.1

default: v2.1

tags

[string]

A set of custom tags.

team

string

Team that owns the service. It is used to locate a team defined in Datadog Teams if it exists.

tier

string

Importance of the service.

Option 4

object

Service definition v2.2 for providing service metadata and integrations.

application

string

Identifier for a group of related services serving a product feature, which the service is a part of.

ci-pipeline-fingerprints

[string]

A set of CI fingerprints.

contacts

[object]

A list of contacts related to the services.

contact [required]

string

Contact value.

name

string

Contact Name.

type [required]

string

Contact type. Datadog recognizes the following types: email, slack, and microsoft-teams.

dd-service [required]

string

Unique identifier of the service. Must be unique across all services and is used to match with a service in Datadog.

description

string

A short description of the service.

extensions

object

Extensions to v2.2 schema.

integrations

object

Third party integrations that Datadog supports.

opsgenie

object

Opsgenie integration for the service.

region

enum

Opsgenie instance region. Allowed enum values: US,EU

service-url [required]

string

Opsgenie service url.

pagerduty

object

PagerDuty integration for the service.

service-url

string

PagerDuty service url.

languages

[string]

The service's programming language. Datadog recognizes the following languages: dotnet, go, java, js, php, python, ruby, and c++.

lifecycle

string

The current life cycle phase of the service.

links

[object]

A list of links related to the services.

name [required]

string

Link name.

provider

string

Link provider.

type [required]

string

Link type. Datadog recognizes the following types: runbook, doc, repo, dashboard, and other.

url [required]

string

Link URL.

schema-version [required]

enum

Schema version being used. Allowed enum values: v2.2

default: v2.2

tags

[string]

A set of custom tags.

team

string

Team that owns the service. It is used to locate a team defined in Datadog Teams if it exists.

tier

string

Importance of the service.

type

string

The type of service.

id

string

Service definition id.

type

string

Service definition type.

{
  "data": {
    "attributes": {
      "meta": {
        "github-html-url": "string",
        "ingested-schema-version": "string",
        "ingestion-source": "string",
        "last-modified-time": "string",
        "origin": "string",
        "origin-detail": "string",
        "warnings": [
          {
            "instance-location": "string",
            "keyword-location": "string",
            "message": "string"
          }
        ]
      },
      "schema": {
        "contact": {
          "email": "contact@datadoghq.com",
          "slack": "https://yourcompany.slack.com/archives/channel123"
        },
        "extensions": {
          "myorg/extension": "extensionValue"
        },
        "external-resources": [
          {
            "name": "Runbook",
            "type": "runbook",
            "url": "https://my-runbook"
          }
        ],
        "info": {
          "dd-service": "myservice",
          "description": "A shopping cart service",
          "display-name": "My Service",
          "service-tier": "Tier 1"
        },
        "integrations": {
          "pagerduty": "https://my-org.pagerduty.com/service-directory/PMyService"
        },
        "org": {
          "application": "E-Commerce",
          "team": "my-team"
        },
        "schema-version": "v1",
        "tags": [
          "my:tag",
          "service:tag"
        ]
      }
    },
    "id": "string",
    "type": "string"
  }
}

Bad Request

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"
  ]
}

Conflict

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 single service definition returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ServiceDefinitionApi;
import com.datadog.api.client.v2.api.ServiceDefinitionApi.GetServiceDefinitionOptionalParameters;
import com.datadog.api.client.v2.model.ServiceDefinitionGetResponse;
import com.datadog.api.client.v2.model.ServiceDefinitionSchemaVersions;

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

    try {
      ServiceDefinitionGetResponse result =
          apiInstance.getServiceDefinition(
              "service-definition-test",
              new GetServiceDefinitionOptionalParameters()
                  .schemaVersion(ServiceDefinitionSchemaVersions.V2_1));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ServiceDefinitionApi#getServiceDefinition");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"

DELETE https://api.ap1.datadoghq.com/api/v2/services/definitions/{service_name}https://api.datadoghq.eu/api/v2/services/definitions/{service_name}https://api.ddog-gov.com/api/v2/services/definitions/{service_name}https://api.datadoghq.com/api/v2/services/definitions/{service_name}https://api.us3.datadoghq.com/api/v2/services/definitions/{service_name}https://api.us5.datadoghq.com/api/v2/services/definitions/{service_name}

개요

Delete a single service definition in the Datadog Service Catalog. This endpoint requires the apm_service_catalog_write permission.

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

인수

경로 파라미터

이름

유형

설명

service_name [required]

string

The name of the service.

응답

OK

Bad Request

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 a single service definition returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ServiceDefinitionApi;

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

    try {
      apiInstance.deleteServiceDefinition("service-definition-test");
    } catch (ApiException e) {
      System.err.println("Exception when calling ServiceDefinitionApi#deleteServiceDefinition");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"