Chilkat Online Tools

unicodeC / ForgeRock Identity Cloud Collection / Check Health

Back to Collection Items

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

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkStringBuilderW sbResponseBody;

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

    http = CkHttpW_Create();

    sbResponseBody = CkStringBuilderW_Create();
    success = CkHttpW_QuickGetSb(http,L"https://<tenant-name>.forgeblocks.com/monitoring/health",sbResponseBody);
    if (success == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkStringBuilderW_Dispose(sbResponseBody);
        return;
    }

    wprintf(L"Response status code = %d\n",CkHttpW_getLastStatus(http));
    wprintf(L"%s\n",CkStringBuilderW_getAsString(sbResponseBody));


    CkHttpW_Dispose(http);
    CkStringBuilderW_Dispose(sbResponseBody);

    }

Curl Command

curl -X GET
https://<tenant-name>.forgeblocks.com/monitoring/health

Postman Collection Item JSON

{
  "name": "Check Health",
  "event": [
    {
      "listen": "test",
      "script": {
        "exec": [
          "const JSONResponse = JSON.parse(responseBody);",
          "",
          "pm.test(\"Status code is 200.\", () => {",
          "  pm.expect(pm.response.code).to.eql(200);",
          "});",
          "",
          "pm.test(\"ID Cloud status is OK\", function () {",
          "    pm.expect(JSONResponse.status).to.eql(\"OK\");",
          "});"
        ],
        "type": "text/javascript"
      }
    }
  ],
  "request": {
    "auth": {
      "type": "noauth"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{platformUrl}}/monitoring/health",
      "host": [
        "{{platformUrl}}"
      ],
      "path": [
        "monitoring",
        "health"
      ]
    },
    "description": "Is the Identity Cloud \"alive\"?"
  },
  "response": [
    {
      "name": "Prometheus metrics for all AM pods",
      "originalRequest": {
        "method": "GET",
        "header": [
        ],
        "url": {
          "raw": "{{baseUrl}}/metrics/prometheus/am",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "metrics",
            "prometheus",
            "am"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": "# HELP am_cts_task_queue_size number of operations waiting in a CTS queue\n# TYPE am_cts_task_queue_size gauge\nam_cts_task_queue_size{kubernetes_pod_name=\"am-568cc4fbb6-cjnpg\",} 0.0"
    }
  ]
}