Chilkat Online Tools

Unicode C++ / Datadog API Collection / Get an SLO's details

Back to Collection Items

void ChilkatSample(void)
    {
    queryParams.UpdateString(L"with_configured_alert_ids",L"true");    resp->GetBodySb(sbResponseBody);    jResp.LoadSb(sbResponseBody);    jResp.put_EmitCompact(false);    jResp.put_I(i);    intVal = jResp.IntOf(L"data.configured_alert_ids[i]");    i = i + 1;    i = 0;    count_i = jResp.SizeOfArray(L"data.groups");    jResp.put_I(i);    strVal = jResp.stringOf(L"data.groups[i]");    i = i + 1;    i = 0;    count_i = jResp.SizeOfArray(L"data.monitor_ids");    jResp.put_I(i);    intVal = jResp.IntOf(L"data.monitor_ids[i]");    i = i + 1;    i = 0;    count_i = jResp.SizeOfArray(L"data.monitor_tags");    jResp.put_I(i);    strVal = jResp.stringOf(L"data.monitor_tags[i]");    i = i + 1;    i = 0;    count_i = jResp.SizeOfArray(L"data.tags");    jResp.put_I(i);    strVal = jResp.stringOf(L"data.tags[i]");    i = i + 1;    i = 0;    count_i = jResp.SizeOfArray(L"data.thresholds");    jResp.put_I(i);    target = jResp.IntOf(L"data.thresholds[i].target");    timeframe = jResp.stringOf(L"data.thresholds[i].timeframe");    warning = jResp.IntOf(L"data.thresholds[i].warning");    i = i + 1;    i = 0;    count_i = jResp.SizeOfArray(L"errors");    jResp.put_I(i);    strVal = jResp.stringOf(L"errors[i]");    i = i + 1;
    }

Curl Command

curl -G -d "with_configured_alert_ids=true"
	-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v1/slo/:slo_id

Postman Collection Item JSON

{
  "name": "Get an SLO's details",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/api/v1/slo/:slo_id?with_configured_alert_ids=true",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v1",
        "slo",
        ":slo_id"
      ],
      "query": [
        {
          "key": "with_configured_alert_ids",
          "value": "true",
          "description": "Get the IDs of SLO monitors that reference this SLO."
        }
      ],
      "variable": [
        {
          "key": "slo_id",
          "value": "tempor Ut sed velit"
        }
      ]
    },
    "description": "Get a service level objective object."
  },
  "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/v1/slo/:slo_id?with_configured_alert_ids=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id"
          ],
          "query": [
            {
              "key": "with_configured_alert_ids",
              "value": "true",
              "description": "Get the IDs of SLO monitors that reference this SLO."
            }
          ],
          "variable": [
            {
              "key": "slo_id"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"data\": {\n    \"configured_alert_ids\": [\n      123,\n      456,\n      789\n    ],\n    \"created_at\": 17466638,\n    \"creator\": {\n      \"email\": \"proident ex ullamco\",\n      \"handle\": \"laborum ad ex non\",\n      \"name\": \"officia dolor consectetur nisi\"\n    },\n    \"description\": \"est id\",\n    \"groups\": [\n      \"env:prod\",\n      \"role:mysql\"\n    ],\n    \"id\": \"esse cillum anim \",\n    \"modified_at\": -26273532,\n    \"monitor_ids\": [\n      -91642399,\n      93741\n    ],\n    \"monitor_tags\": [\n      \"aliquip nulla Lorem ut\",\n      \"reprehenderit velit\"\n    ],\n    \"name\": \"Custom Metric SLO\",\n    \"query\": {\n      \"numerator\": \"sum:my.custom.metric{type:good}.as_count()\",\n      \"denominator\": \"sum:my.custom.metric{*}.as_count()\"\n    },\n    \"tags\": [\n      \"env:prod\",\n      \"app:core\"\n    ],\n    \"target_threshold\": 99.9,\n    \"thresholds\": [\n      {\n        \"target\": 95,\n        \"timeframe\": \"7d\"\n      },\n      {\n        \"target\": 95,\n        \"timeframe\": \"30d\",\n        \"warning\": 97\n      }\n    ],\n    \"timeframe\": \"30d\",\n    \"type\": \"metric\",\n    \"warning_threshold\": 99.95\n  },\n  \"errors\": [\n    \"consectetur velit\",\n    \"elit in\"\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/v1/slo/:slo_id?with_configured_alert_ids=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id"
          ],
          "query": [
            {
              "key": "with_configured_alert_ids",
              "value": "true",
              "description": "Get the IDs of SLO monitors that reference this SLO."
            }
          ],
          "variable": [
            {
              "key": "slo_id"
            }
          ]
        }
      },
      "status": "Forbidden",
      "code": 403,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"Bad Request\",\n    \"Bad Request\"\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/v1/slo/:slo_id?with_configured_alert_ids=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id"
          ],
          "query": [
            {
              "key": "with_configured_alert_ids",
              "value": "true",
              "description": "Get the IDs of SLO monitors that reference this SLO."
            }
          ],
          "variable": [
            {
              "key": "slo_id"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"Bad Request\",\n    \"Bad Request\"\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/v1/slo/:slo_id?with_configured_alert_ids=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id"
          ],
          "query": [
            {
              "key": "with_configured_alert_ids",
              "value": "true",
              "description": "Get the IDs of SLO monitors that reference this SLO."
            }
          ],
          "variable": [
            {
              "key": "slo_id"
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"Bad Request\",\n    \"Bad Request\"\n  ]\n}"
    }
  ]
}