Preview catalog entities

POST https://api.ap1.datadoghq.com/api/v2/catalog/entity/previewhttps://api.ap2.datadoghq.com/api/v2/catalog/entity/previewhttps://api.datadoghq.eu/api/v2/catalog/entity/previewhttps://api.ddog-gov.com/api/v2/catalog/entity/previewhttps://api.us2.ddog-gov.com/api/v2/catalog/entity/previewhttps://api.datadoghq.com/api/v2/catalog/entity/previewhttps://api.us3.datadoghq.com/api/v2/catalog/entity/previewhttps://api.us5.datadoghq.com/api/v2/catalog/entity/preview

Overview

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

Response

Accepted

Response object containing an array of entity data items.

Expand All

Field

Type

Description

data [required]

[object]

Array of entity response data items.

attributes

object

Entity response attributes containing core entity metadata fields.

apiVersion

string

The API version of the entity schema.

description

string

A short description of the entity.

displayName

string

The user-friendly display name of the entity.

kind

string

The kind of the entity (e.g. service, datastore, queue).

name

string

The unique name of the entity within its kind and namespace.

namespace

string

The namespace the entity belongs to.

owner

string

The owner of the entity, usually a team.

properties

object

Additional custom properties for the entity.

tags

[string]

A set of custom tags assigned to the entity.

id

string

Entity unique identifier.

relationships

object

Entity relationships including incidents, oncalls, schemas, and related entities.

incidents

object

Incidents relationship containing a list of incident resources associated with this entity.

data

[object]

List of incident relationship data items.

id [required]

string

Incident resource unique identifier.

type [required]

enum

Incident resource type. Allowed enum values: incident

default: incident

oncalls

object

Oncalls relationship containing a list of oncall resources associated with this entity.

data

[object]

List of oncall relationship data items.

id [required]

string

Oncall resource unique identifier.

type [required]

enum

Oncall resource type. Allowed enum values: oncall

default: oncall

rawSchema

object

Raw schema relationship linking an entity to its raw schema resource.

data [required]

object

Raw schema relationship data containing the raw schema resource identifier and type.

id [required]

string

Raw schema unique identifier.

type [required]

enum

Raw schema resource type. Allowed enum values: rawSchema

default: rawSchema

relatedEntities

object

Related entities relationship containing a list of entity references related to this entity.

data

[object]

List of related entity relationship data items.

id [required]

string

Related entity unique identifier.

type [required]

enum

Related entity resource type. Allowed enum values: relatedEntity

default: relatedEntity

schema

object

Schema relationship linking an entity to its associated schema resource.

data [required]

object

Schema relationship data containing the schema resource identifier and type.

id [required]

string

Entity schema unique identifier.

type [required]

enum

Schema resource type. Allowed enum values: schema

default: schema

type [required]

enum

Entity resource type. Allowed enum values: entity

default: entity

{
  "data": [
    {
      "attributes": {
        "apiVersion": "string",
        "description": "string",
        "displayName": "string",
        "kind": "string",
        "name": "string",
        "namespace": "string",
        "owner": "string",
        "properties": {},
        "tags": []
      },
      "id": "string",
      "relationships": {
        "incidents": {
          "data": [
            {
              "id": "",
              "type": "incident"
            }
          ]
        },
        "oncalls": {
          "data": [
            {
              "id": "",
              "type": "oncall"
            }
          ]
        },
        "rawSchema": {
          "data": {
            "id": "",
            "type": "rawSchema"
          }
        },
        "relatedEntities": {
          "data": [
            {
              "id": "",
              "type": "relatedEntity"
            }
          ]
        },
        "schema": {
          "data": {
            "id": "",
            "type": "schema"
          }
        }
      },
      "type": "entity"
    }
  ]
}

Too many requests

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.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/catalog/entity/preview" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Preview catalog entities returns "Accepted" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = SoftwareCatalogApi(api_client)
    response = api_instance.preview_catalog_entities()

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Preview catalog entities returns "Accepted" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SoftwareCatalogAPI.new
p api_instance.preview_catalog_entities()

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Preview catalog entities returns "Accepted" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewSoftwareCatalogApi(apiClient)
	resp, r, err := api.PreviewCatalogEntities(ctx)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SoftwareCatalogApi.PreviewCatalogEntities`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `SoftwareCatalogApi.PreviewCatalogEntities`:\n%s\n", responseContent)
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Preview catalog entities returns "Accepted" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SoftwareCatalogApi;
import com.datadog.api.client.v2.model.EntityResponseArray;

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

    try {
      EntityResponseArray result = apiInstance.previewCatalogEntities();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SoftwareCatalogApi#previewCatalogEntities");
      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.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Preview catalog entities returns "Accepted" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_software_catalog::SoftwareCatalogAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SoftwareCatalogAPI::with_config(configuration);
    let resp = api.preview_catalog_entities().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Preview catalog entities returns "Accepted" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.SoftwareCatalogApi(configuration);

apiInstance
  .previewCatalogEntities()
  .then((data: v2.EntityResponseArray) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"