Chilkat Online Tools

ListAnomaliesForInsight C++ Example

Amazon DevOps Guru

#include <CkRest.h>
#include <CkAuthAws.h>
#include <CkJsonObject.h>
#include <CkStringBuilder.h>

void ChilkatSample(void)
    {
    // This example requires the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkRest rest;
    bool success;

    CkAuthAws authAws;
    authAws.put_AccessKey("AWS_ACCESS_KEY");
    authAws.put_SecretKey("AWS_SECRET_KEY");

    // Don't forget to change the region to your particular region. (Also make the same change in the call to Connect below.)
    authAws.put_Region("us-west-2");
    authAws.put_ServiceName("devops-guru");
    // SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
    rest.SetAuthAws(authAws);

    // URL: https://devops-guru.us-west-2.amazonaws.com/
    // Use the same region as specified above.
    success = rest.Connect("devops-guru.us-west-2.amazonaws.com",443,true,true);
    if (success != true) {
        std::cout << "ConnectFailReason: " << rest.get_ConnectFailReason() << "\r\n";
        std::cout << rest.lastErrorText() << "\r\n";
        return;
    }

    // The following code creates the JSON request body.
    // The JSON created by this code is shown below.

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

    CkJsonObject json;
    json.UpdateString("AccountId","string");
    json.UpdateInt("MaxResults",123);
    json.UpdateString("NextToken","string");
    json.UpdateInt("StartTimeRange.FromTime",123);
    json.UpdateInt("StartTimeRange.ToTime",123);

    // The JSON request body created by the above code:

    // {
    //   "AccountId": "string",
    //   "MaxResults": number,
    //   "NextToken": "string",
    //   "StartTimeRange": {
    //     "FromTime": number,
    //     "ToTime": number
    //   }
    // }

    rest.AddHeader("Content-Type","application/x-amz-json-1.1");
    rest.AddHeader("X-Amz-Target","ListAnomaliesForInsight");

    CkStringBuilder sbRequestBody;
    json.EmitSb(sbRequestBody);
    CkStringBuilder sbResponseBody;
    success = rest.FullRequestSb("POST","/anomalies/insight/{InsightId}",sbRequestBody,sbResponseBody);
    if (success != true) {
        std::cout << rest.lastErrorText() << "\r\n";
        return;
    }

    int respStatusCode = rest.get_ResponseStatusCode();
    std::cout << "response status code = " << respStatusCode << "\r\n";
    if (respStatusCode != 200) {
        std::cout << "Response Header:" << "\r\n";
        std::cout << rest.responseHeader() << "\r\n";
        std::cout << "Response Body:" << "\r\n";
        std::cout << sbResponseBody.getAsString() << "\r\n";
        return;
    }

    CkJsonObject jResp;
    jResp.LoadSb(sbResponseBody);

    // The following code parses the JSON response.
    // A sample JSON response is shown below the sample code.

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

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.
    // See this example explaining how this memory should be used: const char * functions.

    int CloseTime;
    int OpenTime;
    int EndTime;
    int StartTime;
    const char *AssociatedInsightId = 0;
    const char *Id = 0;
    int Limit;
    int PredictionTimeRangeEndTime;
    int PredictionTimeRangeStartTime;
    const char *Severity = 0;
    const char *Source = 0;
    const char *SourceResourceName = 0;
    const char *SourceResourceType = 0;
    const char *Status = 0;
    int UpdateTime;
    int j;
    int count_j;
    const char *Name = 0;
    const char *v_Type = 0;
    const char *strVal = 0;
    const char *AppBoundaryKey = 0;
    int k;
    int count_k;
    const char *StatusCode = 0;
    const char *MetricName = 0;
    const char *Namespace = 0;
    int Period;
    const char *Stat = 0;
    const char *Unit = 0;
    const char *Value = 0;
    int MetricValue;
    int Timestamp;
    const char *MetricDisplayName = 0;
    const char *v_String = 0;
    const char *Group = 0;
    int GroupByLimit;
    const char *Metric = 0;
    const char *FilterString = 0;
    const char *GroupByGroup = 0;
    const char *MetricQueryMetric = 0;
    int ReferenceScalarValue;
    CkJsonObject *json1 = 0;
    int i1;
    int count_i1;
    int Value_int;
    int AnomalyReportedTimeRangeCloseTime;
    int AnomalyReportedTimeRangeOpenTime;
    int AnomalyTimeRangeEndTime;
    int AnomalyTimeRangeStartTime;
    const char *CausalAnomalyId = 0;
    const char *Description = 0;
    const char *MetricDataSummaryStatusCode = 0;

    const char *NextToken = jResp.stringOf("NextToken");
    int i = 0;
    int count_i = jResp.SizeOfArray("ProactiveAnomalies");
    while (i < count_i) {
        jResp.put_I(i);
        CloseTime = jResp.IntOf("ProactiveAnomalies[i].AnomalyReportedTimeRange.CloseTime");
        OpenTime = jResp.IntOf("ProactiveAnomalies[i].AnomalyReportedTimeRange.OpenTime");
        EndTime = jResp.IntOf("ProactiveAnomalies[i].AnomalyTimeRange.EndTime");
        StartTime = jResp.IntOf("ProactiveAnomalies[i].AnomalyTimeRange.StartTime");
        AssociatedInsightId = jResp.stringOf("ProactiveAnomalies[i].AssociatedInsightId");
        Id = jResp.stringOf("ProactiveAnomalies[i].Id");
        Limit = jResp.IntOf("ProactiveAnomalies[i].Limit");
        PredictionTimeRangeEndTime = jResp.IntOf("ProactiveAnomalies[i].PredictionTimeRange.EndTime");
        PredictionTimeRangeStartTime = jResp.IntOf("ProactiveAnomalies[i].PredictionTimeRange.StartTime");
        Severity = jResp.stringOf("ProactiveAnomalies[i].Severity");
        Source = jResp.stringOf("ProactiveAnomalies[i].SourceMetadata.Source");
        SourceResourceName = jResp.stringOf("ProactiveAnomalies[i].SourceMetadata.SourceResourceName");
        SourceResourceType = jResp.stringOf("ProactiveAnomalies[i].SourceMetadata.SourceResourceType");
        Status = jResp.stringOf("ProactiveAnomalies[i].Status");
        UpdateTime = jResp.IntOf("ProactiveAnomalies[i].UpdateTime");
        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomalies[i].AnomalyResources");
        while (j < count_j) {
            jResp.put_J(j);
            Name = jResp.stringOf("ProactiveAnomalies[i].AnomalyResources[j].Name");
            v_Type = jResp.stringOf("ProactiveAnomalies[i].AnomalyResources[j].Type");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("ProactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomalies[i].ResourceCollection.Tags");
        while (j < count_j) {
            jResp.put_J(j);
            AppBoundaryKey = jResp.stringOf("ProactiveAnomalies[i].ResourceCollection.Tags[j].AppBoundaryKey");
            k = 0;
            count_k = jResp.SizeOfArray("ProactiveAnomalies[i].ResourceCollection.Tags[j].TagValues");
            while (k < count_k) {
                jResp.put_K(k);
                strVal = jResp.stringOf("ProactiveAnomalies[i].ResourceCollection.Tags[j].TagValues[k]");
                k = k + 1;
            }

            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics");
        while (j < count_j) {
            jResp.put_J(j);
            StatusCode = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.StatusCode");
            MetricName = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricName");
            Namespace = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Namespace");
            Period = jResp.IntOf("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Period");
            Stat = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Stat");
            Unit = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Unit");
            k = 0;
            count_k = jResp.SizeOfArray("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions");
            while (k < count_k) {
                jResp.put_K(k);
                Name = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Name");
                Value = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Value");
                k = k + 1;
            }

            k = 0;
            count_k = jResp.SizeOfArray("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList");
            while (k < count_k) {
                jResp.put_K(k);
                MetricValue = jResp.IntOf("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].MetricValue");
                Timestamp = jResp.IntOf("ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].Timestamp");
                k = k + 1;
            }

            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics");
        while (j < count_j) {
            jResp.put_J(j);
            MetricDisplayName = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricDisplayName");
            v_String = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Filter.string");
            Group = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Group");
            GroupByLimit = jResp.IntOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Limit");
            Metric = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Metric");
            Unit = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].Unit");
            k = 0;
            count_k = jResp.SizeOfArray("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions");
            while (k < count_k) {
                jResp.put_K(k);
                strVal = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions[k]");
                k = k + 1;
            }

            k = 0;
            count_k = jResp.SizeOfArray("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData");
            while (k < count_k) {
                jResp.put_K(k);
                FilterString = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Filter.string");
                GroupByGroup = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Group");
                GroupByLimit = jResp.IntOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Limit");
                MetricQueryMetric = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Metric");
                ReferenceScalarValue = jResp.IntOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceScalar.Value");
                Name = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].Name");

                json1 = jResp.ObjectOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k]");
                i1 = 0;
                count_i1 = json1->SizeOfArray("ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions");
                while (i1 < count_i1) {
                    json1->put_I(i1);
                    strVal = json1->stringOf("ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[i]");
                    i1 = i1 + 1;
                }

                delete json1;
                k = k + 1;
            }

            k = 0;
            count_k = jResp.SizeOfArray("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly");
            while (k < count_k) {
                jResp.put_K(k);
                v_Type = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Type");
                Value_int = jResp.IntOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Value");
                k = k + 1;
            }

            k = 0;
            count_k = jResp.SizeOfArray("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline");
            while (k < count_k) {
                jResp.put_K(k);
                v_Type = jResp.stringOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline[k].Type");
                Value_int = jResp.IntOf("ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline[k].Value");
                k = k + 1;
            }

            j = j + 1;
        }

        i = i + 1;
    }

    i = 0;
    count_i = jResp.SizeOfArray("ReactiveAnomalies");
    while (i < count_i) {
        jResp.put_I(i);
        AnomalyReportedTimeRangeCloseTime = jResp.IntOf("ReactiveAnomalies[i].AnomalyReportedTimeRange.CloseTime");
        AnomalyReportedTimeRangeOpenTime = jResp.IntOf("ReactiveAnomalies[i].AnomalyReportedTimeRange.OpenTime");
        AnomalyTimeRangeEndTime = jResp.IntOf("ReactiveAnomalies[i].AnomalyTimeRange.EndTime");
        AnomalyTimeRangeStartTime = jResp.IntOf("ReactiveAnomalies[i].AnomalyTimeRange.StartTime");
        AssociatedInsightId = jResp.stringOf("ReactiveAnomalies[i].AssociatedInsightId");
        CausalAnomalyId = jResp.stringOf("ReactiveAnomalies[i].CausalAnomalyId");
        Description = jResp.stringOf("ReactiveAnomalies[i].Description");
        Id = jResp.stringOf("ReactiveAnomalies[i].Id");
        Name = jResp.stringOf("ReactiveAnomalies[i].Name");
        Severity = jResp.stringOf("ReactiveAnomalies[i].Severity");
        Status = jResp.stringOf("ReactiveAnomalies[i].Status");
        v_Type = jResp.stringOf("ReactiveAnomalies[i].Type");
        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomalies[i].AnomalyResources");
        while (j < count_j) {
            jResp.put_J(j);
            Name = jResp.stringOf("ReactiveAnomalies[i].AnomalyResources[j].Name");
            v_Type = jResp.stringOf("ReactiveAnomalies[i].AnomalyResources[j].Type");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames");
        while (j < count_j) {
            jResp.put_J(j);
            strVal = jResp.stringOf("ReactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames[j]");
            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomalies[i].ResourceCollection.Tags");
        while (j < count_j) {
            jResp.put_J(j);
            AppBoundaryKey = jResp.stringOf("ReactiveAnomalies[i].ResourceCollection.Tags[j].AppBoundaryKey");
            k = 0;
            count_k = jResp.SizeOfArray("ReactiveAnomalies[i].ResourceCollection.Tags[j].TagValues");
            while (k < count_k) {
                jResp.put_K(k);
                strVal = jResp.stringOf("ReactiveAnomalies[i].ResourceCollection.Tags[j].TagValues[k]");
                k = k + 1;
            }

            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics");
        while (j < count_j) {
            jResp.put_J(j);
            MetricDataSummaryStatusCode = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.StatusCode");
            MetricName = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricName");
            Namespace = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Namespace");
            Period = jResp.IntOf("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Period");
            Stat = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Stat");
            Unit = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Unit");
            k = 0;
            count_k = jResp.SizeOfArray("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions");
            while (k < count_k) {
                jResp.put_K(k);
                Name = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Name");
                Value = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Value");
                k = k + 1;
            }

            k = 0;
            count_k = jResp.SizeOfArray("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList");
            while (k < count_k) {
                jResp.put_K(k);
                MetricValue = jResp.IntOf("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].MetricValue");
                Timestamp = jResp.IntOf("ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].Timestamp");
                k = k + 1;
            }

            j = j + 1;
        }

        j = 0;
        count_j = jResp.SizeOfArray("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics");
        while (j < count_j) {
            jResp.put_J(j);
            MetricDisplayName = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricDisplayName");
            FilterString = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Filter.string");
            GroupByGroup = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Group");
            GroupByLimit = jResp.IntOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Limit");
            MetricQueryMetric = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Metric");
            Unit = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].Unit");
            k = 0;
            count_k = jResp.SizeOfArray("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions");
            while (k < count_k) {
                jResp.put_K(k);
                strVal = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions[k]");
                k = k + 1;
            }

            k = 0;
            count_k = jResp.SizeOfArray("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData");
            while (k < count_k) {
                jResp.put_K(k);
                FilterString = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Filter.string");
                GroupByGroup = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Group");
                GroupByLimit = jResp.IntOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Limit");
                MetricQueryMetric = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Metric");
                ReferenceScalarValue = jResp.IntOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceScalar.Value");
                Name = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].Name");

                json1 = jResp.ObjectOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k]");
                i1 = 0;
                count_i1 = json1->SizeOfArray("ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions");
                while (i1 < count_i1) {
                    json1->put_I(i1);
                    strVal = json1->stringOf("ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[i]");
                    i1 = i1 + 1;
                }

                delete json1;
                k = k + 1;
            }

            k = 0;
            count_k = jResp.SizeOfArray("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly");
            while (k < count_k) {
                jResp.put_K(k);
                v_Type = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Type");
                Value_int = jResp.IntOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Value");
                k = k + 1;
            }

            k = 0;
            count_k = jResp.SizeOfArray("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline");
            while (k < count_k) {
                jResp.put_K(k);
                v_Type = jResp.stringOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline[k].Type");
                Value_int = jResp.IntOf("ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline[k].Value");
                k = k + 1;
            }

            j = j + 1;
        }

        i = i + 1;
    }

    // A sample JSON response body parsed by the above code:

    // {
    //   "NextToken": "string",
    //   "ProactiveAnomalies": [
    //     {
    //       "AnomalyReportedTimeRange": {
    //         "CloseTime": number,
    //         "OpenTime": number
    //       },
    //       "AnomalyResources": [
    //         {
    //           "Name": "string",
    //           "Type": "string"
    //         }
    //       ],
    //       "AnomalyTimeRange": {
    //         "EndTime": number,
    //         "StartTime": number
    //       },
    //       "AssociatedInsightId": "string",
    //       "Id": "string",
    //       "Limit": number,
    //       "PredictionTimeRange": {
    //         "EndTime": number,
    //         "StartTime": number
    //       },
    //       "ResourceCollection": {
    //         "CloudFormation": {
    //           "StackNames": [
    //             "string"
    //           ]
    //         },
    //         "Tags": [
    //           {
    //             "AppBoundaryKey": "string",
    //             "TagValues": [
    //               "string"
    //             ]
    //           }
    //         ]
    //       },
    //       "Severity": "string",
    //       "SourceDetails": {
    //         "CloudWatchMetrics": [
    //           {
    //             "Dimensions": [
    //               {
    //                 "Name": "string",
    //                 "Value": "string"
    //               }
    //             ],
    //             "MetricDataSummary": {
    //               "StatusCode": "string",
    //               "TimestampMetricValuePairList": [
    //                 {
    //                   "MetricValue": number,
    //                   "Timestamp": number
    //                 }
    //               ]
    //             },
    //             "MetricName": "string",
    //             "Namespace": "string",
    //             "Period": number,
    //             "Stat": "string",
    //             "Unit": "string"
    //           }
    //         ],
    //         "PerformanceInsightsMetrics": [
    //           {
    //             "MetricDisplayName": "string",
    //             "MetricQuery": {
    //               "Filter": {
    //                 "string": "string"
    //               },
    //               "GroupBy": {
    //                 "Dimensions": [
    //                   "string"
    //                 ],
    //                 "Group": "string",
    //                 "Limit": number
    //               },
    //               "Metric": "string"
    //             },
    //             "ReferenceData": [
    //               {
    //                 "ComparisonValues": {
    //                   "ReferenceMetric": {
    //                     "MetricQuery": {
    //                       "Filter": {
    //                         "string": "string"
    //                       },
    //                       "GroupBy": {
    //                         "Dimensions": [
    //                           "string"
    //                         ],
    //                         "Group": "string",
    //                         "Limit": number
    //                       },
    //                       "Metric": "string"
    //                     }
    //                   },
    //                   "ReferenceScalar": {
    //                     "Value": number
    //                   }
    //                 },
    //                 "Name": "string"
    //               }
    //             ],
    //             "StatsAtAnomaly": [
    //               {
    //                 "Type": "string",
    //                 "Value": number
    //               }
    //             ],
    //             "StatsAtBaseline": [
    //               {
    //                 "Type": "string",
    //                 "Value": number
    //               }
    //             ],
    //             "Unit": "string"
    //           }
    //         ]
    //       },
    //       "SourceMetadata": {
    //         "Source": "string",
    //         "SourceResourceName": "string",
    //         "SourceResourceType": "string"
    //       },
    //       "Status": "string",
    //       "UpdateTime": number
    //     }
    //   ],
    //   "ReactiveAnomalies": [
    //     {
    //       "AnomalyReportedTimeRange": {
    //         "CloseTime": number,
    //         "OpenTime": number
    //       },
    //       "AnomalyResources": [
    //         {
    //           "Name": "string",
    //           "Type": "string"
    //         }
    //       ],
    //       "AnomalyTimeRange": {
    //         "EndTime": number,
    //         "StartTime": number
    //       },
    //       "AssociatedInsightId": "string",
    //       "CausalAnomalyId": "string",
    //       "Description": "string",
    //       "Id": "string",
    //       "Name": "string",
    //       "ResourceCollection": {
    //         "CloudFormation": {
    //           "StackNames": [
    //             "string"
    //           ]
    //         },
    //         "Tags": [
    //           {
    //             "AppBoundaryKey": "string",
    //             "TagValues": [
    //               "string"
    //             ]
    //           }
    //         ]
    //       },
    //       "Severity": "string",
    //       "SourceDetails": {
    //         "CloudWatchMetrics": [
    //           {
    //             "Dimensions": [
    //               {
    //                 "Name": "string",
    //                 "Value": "string"
    //               }
    //             ],
    //             "MetricDataSummary": {
    //               "StatusCode": "string",
    //               "TimestampMetricValuePairList": [
    //                 {
    //                   "MetricValue": number,
    //                   "Timestamp": number
    //                 }
    //               ]
    //             },
    //             "MetricName": "string",
    //             "Namespace": "string",
    //             "Period": number,
    //             "Stat": "string",
    //             "Unit": "string"
    //           }
    //         ],
    //         "PerformanceInsightsMetrics": [
    //           {
    //             "MetricDisplayName": "string",
    //             "MetricQuery": {
    //               "Filter": {
    //                 "string": "string"
    //               },
    //               "GroupBy": {
    //                 "Dimensions": [
    //                   "string"
    //                 ],
    //                 "Group": "string",
    //                 "Limit": number
    //               },
    //               "Metric": "string"
    //             },
    //             "ReferenceData": [
    //               {
    //                 "ComparisonValues": {
    //                   "ReferenceMetric": {
    //                     "MetricQuery": {
    //                       "Filter": {
    //                         "string": "string"
    //                       },
    //                       "GroupBy": {
    //                         "Dimensions": [
    //                           "string"
    //                         ],
    //                         "Group": "string",
    //                         "Limit": number
    //                       },
    //                       "Metric": "string"
    //                     }
    //                   },
    //                   "ReferenceScalar": {
    //                     "Value": number
    //                   }
    //                 },
    //                 "Name": "string"
    //               }
    //             ],
    //             "StatsAtAnomaly": [
    //               {
    //                 "Type": "string",
    //                 "Value": number
    //               }
    //             ],
    //             "StatsAtBaseline": [
    //               {
    //                 "Type": "string",
    //                 "Value": number
    //               }
    //             ],
    //             "Unit": "string"
    //           }
    //         ]
    //       },
    //       "Status": "string",
    //       "Type": "string"
    //     }
    //   ]
    // }
    }