Chilkat Online Tools

unicodeC / Datadog API Collection / Create an SLO object

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkHttpResponseW.h>
#include <C_CkStringBuilderW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkJsonObjectW json;
    HCkHttpResponseW resp;
    HCkStringBuilderW sbResponseBody;
    HCkJsonObjectW jResp;
    int respStatusCode;
    const wchar_t *name;
    const wchar_t *v_type;
    int created_at;
    const wchar_t *v_Email;
    const wchar_t *Handle;
    const wchar_t *Name;
    const wchar_t *description;
    const wchar_t *id;
    int modified_at;
    const wchar_t *Numerator;
    const wchar_t *Denominator;
    const wchar_t *target_threshold;
    const wchar_t *timeframe;
    const wchar_t *warning_threshold;
    int j;
    int count_j;
    int target;
    int warning;
    const wchar_t *strVal;
    int intVal;
    int Total_count;
    int Total_filtered_count;
    int i;
    int count_i;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    http = CkHttpW_Create();

    // Use this online tool to generate code from sample JSON: Generate Code to Create JSON

    // The following JSON is sent in the request body.

    // {
    //   "name": "Custom Metric SLO",
    //   "thresholds": [
    //     {
    //       "target": 95,
    //       "timeframe": "7d"
    //     },
    //     {
    //       "target": 95,
    //       "timeframe": "30d",
    //       "warning": 97
    //     }
    //   ],
    //   "type": "metric",
    //   "description": "non et",
    //   "groups": [
    //     "env:prod",
    //     "role:mysql"
    //   ],
    //   "monitor_ids": [
    //     19441105,
    //     -6429790
    //   ],
    //   "query": {
    //     "numerator": "sum:my.custom.metric{type:good}.as_count()",
    //     "denominator": "sum:my.custom.metric{*}.as_count()"
    //   },
    //   "tags": [
    //     "env:prod",
    //     "app:core"
    //   ],
    //   "target_threshold": 99.9,
    //   "timeframe": "30d",
    //   "warning_threshold": 99.95
    // }

    json = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateString(json,L"name",L"Custom Metric SLO");
    CkJsonObjectW_UpdateInt(json,L"thresholds[0].target",95);
    CkJsonObjectW_UpdateString(json,L"thresholds[0].timeframe",L"7d");
    CkJsonObjectW_UpdateInt(json,L"thresholds[1].target",95);
    CkJsonObjectW_UpdateString(json,L"thresholds[1].timeframe",L"30d");
    CkJsonObjectW_UpdateInt(json,L"thresholds[1].warning",97);
    CkJsonObjectW_UpdateString(json,L"type",L"metric");
    CkJsonObjectW_UpdateString(json,L"description",L"non et");
    CkJsonObjectW_UpdateString(json,L"groups[0]",L"env:prod");
    CkJsonObjectW_UpdateString(json,L"groups[1]",L"role:mysql");
    CkJsonObjectW_UpdateInt(json,L"monitor_ids[0]",19441105);
    CkJsonObjectW_UpdateInt(json,L"monitor_ids[1]",-6429790);
    CkJsonObjectW_UpdateString(json,L"query.numerator",L"sum:my.custom.metric{type:good}.as_count()");
    CkJsonObjectW_UpdateString(json,L"query.denominator",L"sum:my.custom.metric{*}.as_count()");
    CkJsonObjectW_UpdateString(json,L"tags[0]",L"env:prod");
    CkJsonObjectW_UpdateString(json,L"tags[1]",L"app:core");
    CkJsonObjectW_UpdateNumber(json,L"target_threshold",L"99.9");
    CkJsonObjectW_UpdateString(json,L"timeframe",L"30d");
    CkJsonObjectW_UpdateNumber(json,L"warning_threshold",L"99.95");

    CkHttpW_SetRequestHeader(http,L"Content-Type",L"application/json");
    CkHttpW_SetRequestHeader(http,L"Accept",L"application/json");

    resp = CkHttpW_PostJson3(http,L"https://api.app.ddog-gov.com/api/v1/slo",L"application/json",json);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(json);
        return;
    }

    sbResponseBody = CkStringBuilderW_Create();
    CkHttpResponseW_GetBodySb(resp,sbResponseBody);

    jResp = CkJsonObjectW_Create();
    CkJsonObjectW_LoadSb(jResp,sbResponseBody);
    CkJsonObjectW_putEmitCompact(jResp,FALSE);

    wprintf(L"Response Body:\n");
    wprintf(L"%s\n",CkJsonObjectW_emit(jResp));

    respStatusCode = CkHttpResponseW_getStatusCode(resp);
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",CkHttpResponseW_header(resp));
        wprintf(L"Failed.\n");
        CkHttpResponseW_Dispose(resp);
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(json);
        CkStringBuilderW_Dispose(sbResponseBody);
        CkJsonObjectW_Dispose(jResp);
        return;
    }

    CkHttpResponseW_Dispose(resp);

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "data": [
    //     {
    //       "name": "Custom Metric SLO",
    //       "thresholds": [
    //         {
    //           "target": 95,
    //           "timeframe": "7d"
    //         },
    //         {
    //           "target": 95,
    //           "timeframe": "30d",
    //           "warning": 97
    //         }
    //       ],
    //       "type": "metric",
    //       "created_at": -94400396,
    //       "creator": {
    //         "email": "esse ullamco",
    //         "handle": "pariatur irure sit non",
    //         "name": "in proident laborum"
    //       },
    //       "description": "est proident magna reprehenderit",
    //       "groups": [
    //         "env:prod",
    //         "role:mysql"
    //       ],
    //       "id": "ipsum laboris consequat",
    //       "modified_at": -34908193,
    //       "monitor_ids": [
    //         35412081,
    //         -51315393
    //       ],
    //       "monitor_tags": [
    //         "voluptate adipisicing fugiat elit",
    //         "reprehenderit et nostrud pariatur Excepteur"
    //       ],
    //       "query": {
    //         "numerator": "sum:my.custom.metric{type:good}.as_count()",
    //         "denominator": "sum:my.custom.metric{*}.as_count()"
    //       },
    //       "tags": [
    //         "env:prod",
    //         "app:core"
    //       ],
    //       "target_threshold": 99.9,
    //       "timeframe": "30d",
    //       "warning_threshold": 99.95
    //     },
    //     {
    //       "name": "Custom Metric SLO",
    //       "thresholds": [
    //         {
    //           "target": 95,
    //           "timeframe": "7d"
    //         },
    //         {
    //           "target": 95,
    //           "timeframe": "30d",
    //           "warning": 97
    //         }
    //       ],
    //       "type": "metric",
    //       "created_at": -83055437,
    //       "creator": {
    //         "email": "exercitation",
    //         "handle": "commodo aute incididunt ut",
    //         "name": "Lorem dolor irure"
    //       },
    //       "description": "do nostrud ex sit",
    //       "groups": [
    //         "env:prod",
    //         "role:mysql"
    //       ],
    //       "id": "ut elit commodo",
    //       "modified_at": -65512371,
    //       "monitor_ids": [
    //         70922825,
    //         -10561601
    //       ],
    //       "monitor_tags": [
    //         "laborum aliqua proident",
    //         "ullamco cillum ea consectetur"
    //       ],
    //       "query": {
    //         "numerator": "sum:my.custom.metric{type:good}.as_count()",
    //         "denominator": "sum:my.custom.metric{*}.as_count()"
    //       },
    //       "tags": [
    //         "env:prod",
    //         "app:core"
    //       ],
    //       "target_threshold": 99.9,
    //       "timeframe": "30d",
    //       "warning_threshold": 99.95
    //     }
    //   ],
    //   "errors": [
    //     "deserunt in fugiat",
    //     "proident"
    //   ],
    //   "metadata": {
    //     "page": {
    //       "total_count": 69715777,
    //       "total_filtered_count": -16033264
    //     }
    //   }
    // }

    // Sample code for parsing the JSON response...
    // Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.

    Total_count = CkJsonObjectW_IntOf(jResp,L"metadata.page.total_count");
    Total_filtered_count = CkJsonObjectW_IntOf(jResp,L"metadata.page.total_filtered_count");
    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        name = CkJsonObjectW_stringOf(jResp,L"data[i].name");
        v_type = CkJsonObjectW_stringOf(jResp,L"data[i].type");
        created_at = CkJsonObjectW_IntOf(jResp,L"data[i].created_at");
        v_Email = CkJsonObjectW_stringOf(jResp,L"data[i].creator.email");
        Handle = CkJsonObjectW_stringOf(jResp,L"data[i].creator.handle");
        Name = CkJsonObjectW_stringOf(jResp,L"data[i].creator.name");
        description = CkJsonObjectW_stringOf(jResp,L"data[i].description");
        id = CkJsonObjectW_stringOf(jResp,L"data[i].id");
        modified_at = CkJsonObjectW_IntOf(jResp,L"data[i].modified_at");
        Numerator = CkJsonObjectW_stringOf(jResp,L"data[i].query.numerator");
        Denominator = CkJsonObjectW_stringOf(jResp,L"data[i].query.denominator");
        target_threshold = CkJsonObjectW_stringOf(jResp,L"data[i].target_threshold");
        timeframe = CkJsonObjectW_stringOf(jResp,L"data[i].timeframe");
        warning_threshold = CkJsonObjectW_stringOf(jResp,L"data[i].warning_threshold");
        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data[i].thresholds");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            target = CkJsonObjectW_IntOf(jResp,L"data[i].thresholds[j].target");
            timeframe = CkJsonObjectW_stringOf(jResp,L"data[i].thresholds[j].timeframe");
            warning = CkJsonObjectW_IntOf(jResp,L"data[i].thresholds[j].warning");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data[i].groups");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            strVal = CkJsonObjectW_stringOf(jResp,L"data[i].groups[j]");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data[i].monitor_ids");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            intVal = CkJsonObjectW_IntOf(jResp,L"data[i].monitor_ids[j]");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data[i].monitor_tags");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            strVal = CkJsonObjectW_stringOf(jResp,L"data[i].monitor_tags[j]");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data[i].tags");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            strVal = CkJsonObjectW_stringOf(jResp,L"data[i].tags[j]");
            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"errors");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        strVal = CkJsonObjectW_stringOf(jResp,L"errors[i]");
        i = i + 1;
    }



    CkHttpW_Dispose(http);
    CkJsonObjectW_Dispose(json);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_Dispose(jResp);

    }

Curl Command

curl -X POST
	-H "Content-Type: application/json"
	-H "Accept: application/json"
	-d '{
  "name": "Custom Metric SLO",
  "thresholds": [
    {
      "target": 95,
      "timeframe": "7d"
    },
    {
      "target": 95,
      "timeframe": "30d",
      "warning": 97
    }
  ],
  "type": "metric",
  "description": "non et",
  "groups": [
    "env:prod",
    "role:mysql"
  ],
  "monitor_ids": [
    19441105,
    -6429790
  ],
  "query": {
    "numerator": "sum:my.custom.metric{type:good}.as_count()",
    "denominator": "sum:my.custom.metric{*}.as_count()"
  },
  "tags": [
    "env:prod",
    "app:core"
  ],
  "target_threshold": 99.9,
  "timeframe": "30d",
  "warning_threshold": 99.95
}'
https://api.app.ddog-gov.com/api/v1/slo

Postman Collection Item JSON

{
  "name": "Create an SLO object",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"name\": \"Custom Metric SLO\",\n  \"thresholds\": [\n    {\n      \"target\": 95,\n      \"timeframe\": \"7d\"\n    },\n    {\n      \"target\": 95,\n      \"timeframe\": \"30d\",\n      \"warning\": 97\n    }\n  ],\n  \"type\": \"metric\",\n  \"description\": \"non et\",\n  \"groups\": [\n    \"env:prod\",\n    \"role:mysql\"\n  ],\n  \"monitor_ids\": [\n    19441105,\n    -6429790\n  ],\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  \"timeframe\": \"30d\",\n  \"warning_threshold\": 99.95\n}",
      "options": {
        "raw": {
          "headerFamily": "json",
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{baseUrl}}/api/v1/slo",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v1",
        "slo"
      ]
    },
    "description": "Create a service level objective object."
  },
  "response": [
    {
      "name": "OK",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Custom Metric SLO\",\n  \"thresholds\": [\n    {\n      \"target\": 95,\n      \"timeframe\": \"7d\"\n    },\n    {\n      \"target\": 95,\n      \"timeframe\": \"30d\",\n      \"warning\": 97\n    }\n  ],\n  \"type\": \"metric\",\n  \"description\": \"non et\",\n  \"groups\": [\n    \"env:prod\",\n    \"role:mysql\"\n  ],\n  \"monitor_ids\": [\n    19441105,\n    -6429790\n  ],\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  \"timeframe\": \"30d\",\n  \"warning_threshold\": 99.95\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/slo",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"data\": [\n    {\n      \"name\": \"Custom Metric SLO\",\n      \"thresholds\": [\n        {\n          \"target\": 95,\n          \"timeframe\": \"7d\"\n        },\n        {\n          \"target\": 95,\n          \"timeframe\": \"30d\",\n          \"warning\": 97\n        }\n      ],\n      \"type\": \"metric\",\n      \"created_at\": -94400396,\n      \"creator\": {\n        \"email\": \"esse ullamco\",\n        \"handle\": \"pariatur irure sit non\",\n        \"name\": \"in proident laborum\"\n      },\n      \"description\": \"est proident magna reprehenderit\",\n      \"groups\": [\n        \"env:prod\",\n        \"role:mysql\"\n      ],\n      \"id\": \"ipsum laboris consequat\",\n      \"modified_at\": -34908193,\n      \"monitor_ids\": [\n        35412081,\n        -51315393\n      ],\n      \"monitor_tags\": [\n        \"voluptate adipisicing fugiat elit\",\n        \"reprehenderit et nostrud pariatur Excepteur\"\n      ],\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      \"timeframe\": \"30d\",\n      \"warning_threshold\": 99.95\n    },\n    {\n      \"name\": \"Custom Metric SLO\",\n      \"thresholds\": [\n        {\n          \"target\": 95,\n          \"timeframe\": \"7d\"\n        },\n        {\n          \"target\": 95,\n          \"timeframe\": \"30d\",\n          \"warning\": 97\n        }\n      ],\n      \"type\": \"metric\",\n      \"created_at\": -83055437,\n      \"creator\": {\n        \"email\": \"exercitation\",\n        \"handle\": \"commodo aute incididunt ut\",\n        \"name\": \"Lorem dolor irure\"\n      },\n      \"description\": \"do nostrud ex sit\",\n      \"groups\": [\n        \"env:prod\",\n        \"role:mysql\"\n      ],\n      \"id\": \"ut elit commodo\",\n      \"modified_at\": -65512371,\n      \"monitor_ids\": [\n        70922825,\n        -10561601\n      ],\n      \"monitor_tags\": [\n        \"laborum aliqua proident\",\n        \"ullamco cillum ea consectetur\"\n      ],\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      \"timeframe\": \"30d\",\n      \"warning_threshold\": 99.95\n    }\n  ],\n  \"errors\": [\n    \"deserunt in fugiat\",\n    \"proident\"\n  ],\n  \"metadata\": {\n    \"page\": {\n      \"total_count\": 69715777,\n      \"total_filtered_count\": -16033264\n    }\n  }\n}"
    },
    {
      "name": "Bad Request",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Custom Metric SLO\",\n  \"thresholds\": [\n    {\n      \"target\": 95,\n      \"timeframe\": \"7d\"\n    },\n    {\n      \"target\": 95,\n      \"timeframe\": \"30d\",\n      \"warning\": 97\n    }\n  ],\n  \"type\": \"metric\",\n  \"description\": \"non et\",\n  \"groups\": [\n    \"env:prod\",\n    \"role:mysql\"\n  ],\n  \"monitor_ids\": [\n    19441105,\n    -6429790\n  ],\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  \"timeframe\": \"30d\",\n  \"warning_threshold\": 99.95\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/slo",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"Bad Request\",\n    \"Bad Request\"\n  ]\n}"
    },
    {
      "name": "Forbidden",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Custom Metric SLO\",\n  \"thresholds\": [\n    {\n      \"target\": 95,\n      \"timeframe\": \"7d\"\n    },\n    {\n      \"target\": 95,\n      \"timeframe\": \"30d\",\n      \"warning\": 97\n    }\n  ],\n  \"type\": \"metric\",\n  \"description\": \"non et\",\n  \"groups\": [\n    \"env:prod\",\n    \"role:mysql\"\n  ],\n  \"monitor_ids\": [\n    19441105,\n    -6429790\n  ],\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  \"timeframe\": \"30d\",\n  \"warning_threshold\": 99.95\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/slo",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo"
          ]
        }
      },
      "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": "Too many requests",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Custom Metric SLO\",\n  \"thresholds\": [\n    {\n      \"target\": 95,\n      \"timeframe\": \"7d\"\n    },\n    {\n      \"target\": 95,\n      \"timeframe\": \"30d\",\n      \"warning\": 97\n    }\n  ],\n  \"type\": \"metric\",\n  \"description\": \"non et\",\n  \"groups\": [\n    \"env:prod\",\n    \"role:mysql\"\n  ],\n  \"monitor_ids\": [\n    19441105,\n    -6429790\n  ],\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  \"timeframe\": \"30d\",\n  \"warning_threshold\": 99.95\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/slo",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo"
          ]
        }
      },
      "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}"
    }
  ]
}