Chilkat Online Tools

PureBasic / Datadog API Collection / Update an SLO

Back to Collection Items

IncludeFile "CkJsonObject.pb"
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkHttp.pb"
IncludeFile "CkHttpResponse.pb"

Procedure ChilkatExample()

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

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success.i

    ; 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",
    ;   "created_at": -99964498,
    ;   "creator": {
    ;     "email": "nostrud aliqua dolore adipisicing",
    ;     "handle": "esse ad",
    ;     "name": "est"
    ;   },
    ;   "description": "adipisicing est quis ipsum",
    ;   "groups": [
    ;     "env:prod",
    ;     "role:mysql"
    ;   ],
    ;   "id": "nostrud officia",
    ;   "modified_at": -83338646,
    ;   "monitor_ids": [
    ;     -42604664,
    ;     -6863832
    ;   ],
    ;   "monitor_tags": [
    ;     "sint",
    ;     "cillum nisi ipsum"
    ;   ],
    ;   "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.i = CkJsonObject::ckCreate()
    If json.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkJsonObject::ckUpdateString(json,"name","Custom Metric SLO")
    CkJsonObject::ckUpdateInt(json,"thresholds[0].target",95)
    CkJsonObject::ckUpdateString(json,"thresholds[0].timeframe","7d")
    CkJsonObject::ckUpdateInt(json,"thresholds[1].target",95)
    CkJsonObject::ckUpdateString(json,"thresholds[1].timeframe","30d")
    CkJsonObject::ckUpdateInt(json,"thresholds[1].warning",97)
    CkJsonObject::ckUpdateString(json,"type","metric")
    CkJsonObject::ckUpdateInt(json,"created_at",-99964498)
    CkJsonObject::ckUpdateString(json,"creator.email","nostrud aliqua dolore adipisicing")
    CkJsonObject::ckUpdateString(json,"creator.handle","esse ad")
    CkJsonObject::ckUpdateString(json,"creator.name","est")
    CkJsonObject::ckUpdateString(json,"description","adipisicing est quis ipsum")
    CkJsonObject::ckUpdateString(json,"groups[0]","env:prod")
    CkJsonObject::ckUpdateString(json,"groups[1]","role:mysql")
    CkJsonObject::ckUpdateString(json,"id","nostrud officia")
    CkJsonObject::ckUpdateInt(json,"modified_at",-83338646)
    CkJsonObject::ckUpdateInt(json,"monitor_ids[0]",-42604664)
    CkJsonObject::ckUpdateInt(json,"monitor_ids[1]",-6863832)
    CkJsonObject::ckUpdateString(json,"monitor_tags[0]","sint")
    CkJsonObject::ckUpdateString(json,"monitor_tags[1]","cillum nisi ipsum")
    CkJsonObject::ckUpdateString(json,"query.numerator","sum:my.custom.metric{type:good}.as_count()")
    CkJsonObject::ckUpdateString(json,"query.denominator","sum:my.custom.metric{*}.as_count()")
    CkJsonObject::ckUpdateString(json,"tags[0]","env:prod")
    CkJsonObject::ckUpdateString(json,"tags[1]","app:core")
    CkJsonObject::ckUpdateNumber(json,"target_threshold","99.9")
    CkJsonObject::ckUpdateString(json,"timeframe","30d")
    CkJsonObject::ckUpdateNumber(json,"warning_threshold","99.95")

    CkHttp::ckSetRequestHeader(http,"Content-Type","application/json")
    CkHttp::ckSetRequestHeader(http,"Accept","application/json")

    sbRequestBody.i = CkStringBuilder::ckCreate()
    If sbRequestBody.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkJsonObject::ckEmitSb(json,sbRequestBody)

    resp.i = CkHttp::ckPTextSb(http,"PUT","https://api.app.ddog-gov.com/api/v1/slo/:slo_id",sbRequestBody,"utf-8","application/json",0,0)
    If CkHttp::ckLastMethodSuccess(http) = 0
        Debug CkHttp::ckLastErrorText(http)
        CkHttp::ckDispose(http)
        CkJsonObject::ckDispose(json)
        CkStringBuilder::ckDispose(sbRequestBody)
        ProcedureReturn
    EndIf

    sbResponseBody.i = CkStringBuilder::ckCreate()
    If sbResponseBody.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkHttpResponse::ckGetBodySb(resp,sbResponseBody)

    jResp.i = CkJsonObject::ckCreate()
    If jResp.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkJsonObject::ckLoadSb(jResp,sbResponseBody)
    CkJsonObject::setCkEmitCompact(jResp, 0)

    Debug "Response Body:"
    Debug CkJsonObject::ckEmit(jResp)

    respStatusCode.i = CkHttpResponse::ckStatusCode(resp)
    Debug "Response Status Code = " + Str(respStatusCode)
    If respStatusCode >= 400
        Debug "Response Header:"
        Debug CkHttpResponse::ckHeader(resp)
        Debug "Failed."
        CkHttpResponse::ckDispose(resp)

        CkHttp::ckDispose(http)
        CkJsonObject::ckDispose(json)
        CkStringBuilder::ckDispose(sbRequestBody)
        CkStringBuilder::ckDispose(sbResponseBody)
        CkJsonObject::ckDispose(jResp)
        ProcedureReturn
    EndIf

    CkHttpResponse::ckDispose(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

    name.s
    v_type.s
    created_at.i
    v_Email.s
    Handle.s
    Name.s
    description.s
    id.s
    modified_at.i
    Numerator.s
    Denominator.s
    target_threshold.s
    timeframe.s
    warning_threshold.s
    j.i
    count_j.i
    target.i
    warning.i
    strVal.s
    intVal.i

    Total_count.i = CkJsonObject::ckIntOf(jResp,"metadata.page.total_count")
    Total_filtered_count.i = CkJsonObject::ckIntOf(jResp,"metadata.page.total_filtered_count")
    i.i = 0
    count_i.i = CkJsonObject::ckSizeOfArray(jResp,"data")
    While i < count_i
        CkJsonObject::setCkI(jResp, i)
        name = CkJsonObject::ckStringOf(jResp,"data[i].name")
        v_type = CkJsonObject::ckStringOf(jResp,"data[i].type")
        created_at = CkJsonObject::ckIntOf(jResp,"data[i].created_at")
        v_Email = CkJsonObject::ckStringOf(jResp,"data[i].creator.email")
        Handle = CkJsonObject::ckStringOf(jResp,"data[i].creator.handle")
        Name = CkJsonObject::ckStringOf(jResp,"data[i].creator.name")
        description = CkJsonObject::ckStringOf(jResp,"data[i].description")
        id = CkJsonObject::ckStringOf(jResp,"data[i].id")
        modified_at = CkJsonObject::ckIntOf(jResp,"data[i].modified_at")
        Numerator = CkJsonObject::ckStringOf(jResp,"data[i].query.numerator")
        Denominator = CkJsonObject::ckStringOf(jResp,"data[i].query.denominator")
        target_threshold = CkJsonObject::ckStringOf(jResp,"data[i].target_threshold")
        timeframe = CkJsonObject::ckStringOf(jResp,"data[i].timeframe")
        warning_threshold = CkJsonObject::ckStringOf(jResp,"data[i].warning_threshold")
        j = 0
        count_j = CkJsonObject::ckSizeOfArray(jResp,"data[i].thresholds")
        While j < count_j
            CkJsonObject::setCkJ(jResp, j)
            target = CkJsonObject::ckIntOf(jResp,"data[i].thresholds[j].target")
            timeframe = CkJsonObject::ckStringOf(jResp,"data[i].thresholds[j].timeframe")
            warning = CkJsonObject::ckIntOf(jResp,"data[i].thresholds[j].warning")
            j = j + 1
        Wend
        j = 0
        count_j = CkJsonObject::ckSizeOfArray(jResp,"data[i].groups")
        While j < count_j
            CkJsonObject::setCkJ(jResp, j)
            strVal = CkJsonObject::ckStringOf(jResp,"data[i].groups[j]")
            j = j + 1
        Wend
        j = 0
        count_j = CkJsonObject::ckSizeOfArray(jResp,"data[i].monitor_ids")
        While j < count_j
            CkJsonObject::setCkJ(jResp, j)
            intVal = CkJsonObject::ckIntOf(jResp,"data[i].monitor_ids[j]")
            j = j + 1
        Wend
        j = 0
        count_j = CkJsonObject::ckSizeOfArray(jResp,"data[i].monitor_tags")
        While j < count_j
            CkJsonObject::setCkJ(jResp, j)
            strVal = CkJsonObject::ckStringOf(jResp,"data[i].monitor_tags[j]")
            j = j + 1
        Wend
        j = 0
        count_j = CkJsonObject::ckSizeOfArray(jResp,"data[i].tags")
        While j < count_j
            CkJsonObject::setCkJ(jResp, j)
            strVal = CkJsonObject::ckStringOf(jResp,"data[i].tags[j]")
            j = j + 1
        Wend
        i = i + 1
    Wend
    i = 0
    count_i = CkJsonObject::ckSizeOfArray(jResp,"errors")
    While i < count_i
        CkJsonObject::setCkI(jResp, i)
        strVal = CkJsonObject::ckStringOf(jResp,"errors[i]")
        i = i + 1
    Wend


    CkHttp::ckDispose(http)
    CkJsonObject::ckDispose(json)
    CkStringBuilder::ckDispose(sbRequestBody)
    CkStringBuilder::ckDispose(sbResponseBody)
    CkJsonObject::ckDispose(jResp)


    ProcedureReturn
EndProcedure

Curl Command

curl -X PUT
	-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",
  "created_at": -99964498,
  "creator": {
    "email": "nostrud aliqua dolore adipisicing",
    "handle": "esse ad",
    "name": "est"
  },
  "description": "adipisicing est quis ipsum",
  "groups": [
    "env:prod",
    "role:mysql"
  ],
  "id": "nostrud officia",
  "modified_at": -83338646,
  "monitor_ids": [
    -42604664,
    -6863832
  ],
  "monitor_tags": [
    "sint",
    "cillum nisi ipsum"
  ],
  "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/:slo_id

Postman Collection Item JSON

{
  "name": "Update an SLO",
  "request": {
    "method": "PUT",
    "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  \"created_at\": -99964498,\n  \"creator\": {\n    \"email\": \"nostrud aliqua dolore adipisicing\",\n    \"handle\": \"esse ad\",\n    \"name\": \"est\"\n  },\n  \"description\": \"adipisicing est quis ipsum\",\n  \"groups\": [\n    \"env:prod\",\n    \"role:mysql\"\n  ],\n  \"id\": \"nostrud officia\",\n  \"modified_at\": -83338646,\n  \"monitor_ids\": [\n    -42604664,\n    -6863832\n  ],\n  \"monitor_tags\": [\n    \"sint\",\n    \"cillum nisi ipsum\"\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/:slo_id",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v1",
        "slo",
        ":slo_id"
      ],
      "variable": [
        {
          "key": "slo_id",
          "value": "tempor Ut sed velit"
        }
      ]
    },
    "description": "Update the specified service level objective object."
  },
  "response": [
    {
      "name": "OK",
      "originalRequest": {
        "method": "PUT",
        "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  \"created_at\": -99964498,\n  \"creator\": {\n    \"email\": \"nostrud aliqua dolore adipisicing\",\n    \"handle\": \"esse ad\",\n    \"name\": \"est\"\n  },\n  \"description\": \"adipisicing est quis ipsum\",\n  \"groups\": [\n    \"env:prod\",\n    \"role:mysql\"\n  ],\n  \"id\": \"nostrud officia\",\n  \"modified_at\": -83338646,\n  \"monitor_ids\": [\n    -42604664,\n    -6863832\n  ],\n  \"monitor_tags\": [\n    \"sint\",\n    \"cillum nisi ipsum\"\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/:slo_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id"
          ],
          "variable": [
            {
              "key": "slo_id"
            }
          ]
        }
      },
      "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": "PUT",
        "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  \"created_at\": -99964498,\n  \"creator\": {\n    \"email\": \"nostrud aliqua dolore adipisicing\",\n    \"handle\": \"esse ad\",\n    \"name\": \"est\"\n  },\n  \"description\": \"adipisicing est quis ipsum\",\n  \"groups\": [\n    \"env:prod\",\n    \"role:mysql\"\n  ],\n  \"id\": \"nostrud officia\",\n  \"modified_at\": -83338646,\n  \"monitor_ids\": [\n    -42604664,\n    -6863832\n  ],\n  \"monitor_tags\": [\n    \"sint\",\n    \"cillum nisi ipsum\"\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/:slo_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id"
          ],
          "variable": [
            {
              "key": "slo_id"
            }
          ]
        }
      },
      "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": "PUT",
        "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  \"created_at\": -99964498,\n  \"creator\": {\n    \"email\": \"nostrud aliqua dolore adipisicing\",\n    \"handle\": \"esse ad\",\n    \"name\": \"est\"\n  },\n  \"description\": \"adipisicing est quis ipsum\",\n  \"groups\": [\n    \"env:prod\",\n    \"role:mysql\"\n  ],\n  \"id\": \"nostrud officia\",\n  \"modified_at\": -83338646,\n  \"monitor_ids\": [\n    -42604664,\n    -6863832\n  ],\n  \"monitor_tags\": [\n    \"sint\",\n    \"cillum nisi ipsum\"\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/:slo_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id"
          ],
          "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": "PUT",
        "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  \"created_at\": -99964498,\n  \"creator\": {\n    \"email\": \"nostrud aliqua dolore adipisicing\",\n    \"handle\": \"esse ad\",\n    \"name\": \"est\"\n  },\n  \"description\": \"adipisicing est quis ipsum\",\n  \"groups\": [\n    \"env:prod\",\n    \"role:mysql\"\n  ],\n  \"id\": \"nostrud officia\",\n  \"modified_at\": -83338646,\n  \"monitor_ids\": [\n    -42604664,\n    -6863832\n  ],\n  \"monitor_tags\": [\n    \"sint\",\n    \"cillum nisi ipsum\"\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/:slo_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id"
          ],
          "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": "PUT",
        "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  \"created_at\": -99964498,\n  \"creator\": {\n    \"email\": \"nostrud aliqua dolore adipisicing\",\n    \"handle\": \"esse ad\",\n    \"name\": \"est\"\n  },\n  \"description\": \"adipisicing est quis ipsum\",\n  \"groups\": [\n    \"env:prod\",\n    \"role:mysql\"\n  ],\n  \"id\": \"nostrud officia\",\n  \"modified_at\": -83338646,\n  \"monitor_ids\": [\n    -42604664,\n    -6863832\n  ],\n  \"monitor_tags\": [\n    \"sint\",\n    \"cillum nisi ipsum\"\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/:slo_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id"
          ],
          "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}"
    }
  ]
}