Chilkat Online Tools

Unicode C++ / Datadog API Collection / Get a single service definition

Back to Collection Items

void ChilkatSample(void)
    {
    queryParams.UpdateString(L"schema_version",L"v1");    resp->GetBodySb(sbResponseBody);    jResp.LoadSb(sbResponseBody);    jResp.put_EmitCompact(false);    jResp.put_I(i);    instance_location = jResp.stringOf(L"data.attributes.meta.warnings[i].instance-location");    keyword_location = jResp.stringOf(L"data.attributes.meta.warnings[i].keyword-location");    message = jResp.stringOf(L"data.attributes.meta.warnings[i].message");    i = i + 1;    i = 0;    count_i = jResp.SizeOfArray(L"data.attributes.schema.external-resources");    jResp.put_I(i);    name = jResp.stringOf(L"data.attributes.schema.external-resources[i].name");    v_type = jResp.stringOf(L"data.attributes.schema.external-resources[i].type");    url = jResp.stringOf(L"data.attributes.schema.external-resources[i].url");    i = i + 1;    i = 0;    count_i = jResp.SizeOfArray(L"data.attributes.schema.tags");    jResp.put_I(i);    strVal = jResp.stringOf(L"data.attributes.schema.tags[i]");    i = i + 1;
    }

Curl Command

curl -G -d "schema_version=v1"
	-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v2/services/definitions/:service_name

Postman Collection Item JSON

{
  "name": "Get a single service definition",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/api/v2/services/definitions/:service_name?schema_version=v1",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v2",
        "services",
        "definitions",
        ":service_name"
      ],
      "query": [
        {
          "key": "schema_version",
          "value": "v1",
          "description": "The schema version desired in the response."
        }
      ],
      "variable": [
        {
          "key": "service_name",
          "value": "<string>"
        }
      ]
    },
    "description": "Get a single service definition from the Datadog Service Catalog."
  },
  "response": [
    {
      "name": "OK",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v2/services/definitions/:service_name?schema_version=v1",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "services",
            "definitions",
            ":service_name"
          ],
          "query": [
            {
              "key": "schema_version",
              "value": "v1",
              "description": "The schema version desired in the response."
            }
          ],
          "variable": [
            {
              "key": "service_name"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"data\": {\n    \"attributes\": {\n      \"meta\": {\n        \"github-html-url\": \"<string>\",\n        \"ingested-schema-version\": \"<string>\",\n        \"ingestion-source\": \"<string>\",\n        \"last-modified-time\": \"<string>\",\n        \"origin\": \"<string>\",\n        \"origin-detail\": \"<string>\",\n        \"warnings\": [\n          {\n            \"instance-location\": \"<string>\",\n            \"keyword-location\": \"<string>\",\n            \"message\": \"<string>\"\n          },\n          {\n            \"instance-location\": \"<string>\",\n            \"keyword-location\": \"<string>\",\n            \"message\": \"<string>\"\n          }\n        ]\n      },\n      \"schema\": {\n        \"schema-version\": \"v1\",\n        \"info\": {\n          \"dd-service\": \"<string>\",\n          \"description\": \"<string>\",\n          \"display-name\": \"<string>\",\n          \"service-tier\": \"<string>\"\n        },\n        \"contact\": {\n          \"email\": \"<email>\",\n          \"slack\": \"<string>\"\n        },\n        \"extensions\": {\n          \"iruree76\": {},\n          \"aliqua_0\": {},\n          \"ad_3\": {}\n        },\n        \"external-resources\": [\n          {\n            \"name\": \"<string>\",\n            \"type\": \"code\",\n            \"url\": \"<string>\"\n          },\n          {\n            \"name\": \"<string>\",\n            \"type\": \"repo\",\n            \"url\": \"<string>\"\n          }\n        ],\n        \"integrations\": {\n          \"pagerduty\": \"<string>\"\n        },\n        \"org\": {\n          \"application\": \"<string>\",\n          \"team\": \"<string>\"\n        },\n        \"tags\": [\n          \"<string>\",\n          \"<string>\"\n        ]\n      }\n    },\n    \"id\": \"<string>\",\n    \"type\": \"<string>\"\n  }\n}"
    },
    {
      "name": "Bad Request",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v2/services/definitions/:service_name?schema_version=v1",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "services",
            "definitions",
            ":service_name"
          ],
          "query": [
            {
              "key": "schema_version",
              "value": "v1",
              "description": "The schema version desired in the response."
            }
          ],
          "variable": [
            {
              "key": "service_name"
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    },
    {
      "name": "Forbidden",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v2/services/definitions/:service_name?schema_version=v1",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "services",
            "definitions",
            ":service_name"
          ],
          "query": [
            {
              "key": "schema_version",
              "value": "v1",
              "description": "The schema version desired in the response."
            }
          ],
          "variable": [
            {
              "key": "service_name"
            }
          ]
        }
      },
      "status": "Forbidden",
      "code": 403,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    },
    {
      "name": "Not Found",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v2/services/definitions/:service_name?schema_version=v1",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "services",
            "definitions",
            ":service_name"
          ],
          "query": [
            {
              "key": "schema_version",
              "value": "v1",
              "description": "The schema version desired in the response."
            }
          ],
          "variable": [
            {
              "key": "service_name"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    },
    {
      "name": "Conflict",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v2/services/definitions/:service_name?schema_version=v1",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "services",
            "definitions",
            ":service_name"
          ],
          "query": [
            {
              "key": "schema_version",
              "value": "v1",
              "description": "The schema version desired in the response."
            }
          ],
          "variable": [
            {
              "key": "service_name"
            }
          ]
        }
      },
      "status": "Conflict",
      "code": 409,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    },
    {
      "name": "Too many requests",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v2/services/definitions/:service_name?schema_version=v1",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "services",
            "definitions",
            ":service_name"
          ],
          "query": [
            {
              "key": "schema_version",
              "value": "v1",
              "description": "The schema version desired in the response."
            }
          ],
          "variable": [
            {
              "key": "service_name"
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    }
  ]
}