ListAnomaliesForInsight unicodeC Example
#include <C_CkRestW.h>
#include <C_CkAuthAwsW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkStringBuilderW.h>
void ChilkatSample(void)
{
HCkRestW rest;
BOOL success;
HCkAuthAwsW authAws;
HCkJsonObjectW json;
HCkStringBuilderW sbRequestBody;
HCkStringBuilderW sbResponseBody;
int respStatusCode;
HCkJsonObjectW jResp;
int CloseTime;
int OpenTime;
int EndTime;
int StartTime;
const wchar_t *AssociatedInsightId;
const wchar_t *Id;
int Limit;
int PredictionTimeRangeEndTime;
int PredictionTimeRangeStartTime;
const wchar_t *Severity;
const wchar_t *Source;
const wchar_t *SourceResourceName;
const wchar_t *SourceResourceType;
const wchar_t *Status;
int UpdateTime;
int j;
int count_j;
const wchar_t *Name;
const wchar_t *v_Type;
const wchar_t *strVal;
const wchar_t *AppBoundaryKey;
int k;
int count_k;
const wchar_t *StatusCode;
const wchar_t *MetricName;
const wchar_t *Namespace;
int Period;
const wchar_t *Stat;
const wchar_t *Unit;
const wchar_t *Value;
int MetricValue;
int Timestamp;
const wchar_t *MetricDisplayName;
const wchar_t *v_String;
const wchar_t *Group;
int GroupByLimit;
const wchar_t *Metric;
const wchar_t *FilterString;
const wchar_t *GroupByGroup;
const wchar_t *MetricQueryMetric;
int ReferenceScalarValue;
HCkJsonObjectW json1;
int i1;
int count_i1;
int Value_int;
int AnomalyReportedTimeRangeCloseTime;
int AnomalyReportedTimeRangeOpenTime;
int AnomalyTimeRangeEndTime;
int AnomalyTimeRangeStartTime;
const wchar_t *CausalAnomalyId;
const wchar_t *Description;
const wchar_t *MetricDataSummaryStatusCode;
const wchar_t *NextToken;
int i;
int count_i;
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
rest = CkRestW_Create();
authAws = CkAuthAwsW_Create();
CkAuthAwsW_putAccessKey(authAws,L"AWS_ACCESS_KEY");
CkAuthAwsW_putSecretKey(authAws,L"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.)
CkAuthAwsW_putRegion(authAws,L"us-west-2");
CkAuthAwsW_putServiceName(authAws,L"devops-guru");
// SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
CkRestW_SetAuthAws(rest,authAws);
// URL: https://devops-guru.us-west-2.amazonaws.com/
// Use the same region as specified above.
success = CkRestW_Connect(rest,L"devops-guru.us-west-2.amazonaws.com",443,TRUE,TRUE);
if (success != TRUE) {
wprintf(L"ConnectFailReason: %d\n",CkRestW_getConnectFailReason(rest));
wprintf(L"%s\n",CkRestW_lastErrorText(rest));
CkRestW_Dispose(rest);
CkAuthAwsW_Dispose(authAws);
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
json = CkJsonObjectW_Create();
CkJsonObjectW_UpdateString(json,L"AccountId",L"string");
CkJsonObjectW_UpdateInt(json,L"MaxResults",123);
CkJsonObjectW_UpdateString(json,L"NextToken",L"string");
CkJsonObjectW_UpdateInt(json,L"StartTimeRange.FromTime",123);
CkJsonObjectW_UpdateInt(json,L"StartTimeRange.ToTime",123);
// The JSON request body created by the above code:
// {
// "AccountId": "string",
// "MaxResults": number,
// "NextToken": "string",
// "StartTimeRange": {
// "FromTime": number,
// "ToTime": number
// }
// }
CkRestW_AddHeader(rest,L"Content-Type",L"application/x-amz-json-1.1");
CkRestW_AddHeader(rest,L"X-Amz-Target",L"ListAnomaliesForInsight");
sbRequestBody = CkStringBuilderW_Create();
CkJsonObjectW_EmitSb(json,sbRequestBody);
sbResponseBody = CkStringBuilderW_Create();
success = CkRestW_FullRequestSb(rest,L"POST",L"/anomalies/insight/{InsightId}",sbRequestBody,sbResponseBody);
if (success != TRUE) {
wprintf(L"%s\n",CkRestW_lastErrorText(rest));
CkRestW_Dispose(rest);
CkAuthAwsW_Dispose(authAws);
CkJsonObjectW_Dispose(json);
CkStringBuilderW_Dispose(sbRequestBody);
CkStringBuilderW_Dispose(sbResponseBody);
return;
}
respStatusCode = CkRestW_getResponseStatusCode(rest);
wprintf(L"response status code = %d\n",respStatusCode);
if (respStatusCode != 200) {
wprintf(L"Response Header:\n");
wprintf(L"%s\n",CkRestW_responseHeader(rest));
wprintf(L"Response Body:\n");
wprintf(L"%s\n",CkStringBuilderW_getAsString(sbResponseBody));
CkRestW_Dispose(rest);
CkAuthAwsW_Dispose(authAws);
CkJsonObjectW_Dispose(json);
CkStringBuilderW_Dispose(sbRequestBody);
CkStringBuilderW_Dispose(sbResponseBody);
return;
}
jResp = CkJsonObjectW_Create();
CkJsonObjectW_LoadSb(jResp,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.
NextToken = CkJsonObjectW_stringOf(jResp,L"NextToken");
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
CloseTime = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].AnomalyReportedTimeRange.CloseTime");
OpenTime = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].AnomalyReportedTimeRange.OpenTime");
EndTime = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].AnomalyTimeRange.EndTime");
StartTime = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].AnomalyTimeRange.StartTime");
AssociatedInsightId = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].AssociatedInsightId");
Id = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].Id");
Limit = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].Limit");
PredictionTimeRangeEndTime = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].PredictionTimeRange.EndTime");
PredictionTimeRangeStartTime = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].PredictionTimeRange.StartTime");
Severity = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].Severity");
Source = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceMetadata.Source");
SourceResourceName = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceMetadata.SourceResourceName");
SourceResourceType = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceMetadata.SourceResourceType");
Status = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].Status");
UpdateTime = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].UpdateTime");
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].AnomalyResources");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
Name = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].AnomalyResources[j].Name");
v_Type = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].AnomalyResources[j].Type");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames[j]");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].ResourceCollection.Tags");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
AppBoundaryKey = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].ResourceCollection.Tags[j].AppBoundaryKey");
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].ResourceCollection.Tags[j].TagValues");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
strVal = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].ResourceCollection.Tags[j].TagValues[k]");
k = k + 1;
}
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
StatusCode = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.StatusCode");
MetricName = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricName");
Namespace = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Namespace");
Period = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Period");
Stat = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Stat");
Unit = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Unit");
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
Name = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Name");
Value = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Value");
k = k + 1;
}
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
MetricValue = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].MetricValue");
Timestamp = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].Timestamp");
k = k + 1;
}
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
MetricDisplayName = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricDisplayName");
v_String = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Filter.string");
Group = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Group");
GroupByLimit = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Limit");
Metric = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Metric");
Unit = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].Unit");
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
strVal = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions[k]");
k = k + 1;
}
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
FilterString = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Filter.string");
GroupByGroup = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Group");
GroupByLimit = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Limit");
MetricQueryMetric = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Metric");
ReferenceScalarValue = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceScalar.Value");
Name = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].Name");
json1 = CkJsonObjectW_ObjectOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k]");
i1 = 0;
count_i1 = CkJsonObjectW_SizeOfArray(json1,L"ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions");
while (i1 < count_i1) {
CkJsonObjectW_putI(json1,i1);
strVal = CkJsonObjectW_stringOf(json1,L"ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[i]");
i1 = i1 + 1;
}
CkJsonObjectW_Dispose(json1);
k = k + 1;
}
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
v_Type = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Type");
Value_int = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Value");
k = k + 1;
}
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
v_Type = CkJsonObjectW_stringOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline[k].Type");
Value_int = CkJsonObjectW_IntOf(jResp,L"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline[k].Value");
k = k + 1;
}
j = j + 1;
}
i = i + 1;
}
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
AnomalyReportedTimeRangeCloseTime = CkJsonObjectW_IntOf(jResp,L"ReactiveAnomalies[i].AnomalyReportedTimeRange.CloseTime");
AnomalyReportedTimeRangeOpenTime = CkJsonObjectW_IntOf(jResp,L"ReactiveAnomalies[i].AnomalyReportedTimeRange.OpenTime");
AnomalyTimeRangeEndTime = CkJsonObjectW_IntOf(jResp,L"ReactiveAnomalies[i].AnomalyTimeRange.EndTime");
AnomalyTimeRangeStartTime = CkJsonObjectW_IntOf(jResp,L"ReactiveAnomalies[i].AnomalyTimeRange.StartTime");
AssociatedInsightId = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].AssociatedInsightId");
CausalAnomalyId = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].CausalAnomalyId");
Description = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].Description");
Id = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].Id");
Name = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].Name");
Severity = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].Severity");
Status = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].Status");
v_Type = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].Type");
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].AnomalyResources");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
Name = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].AnomalyResources[j].Name");
v_Type = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].AnomalyResources[j].Type");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames[j]");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].ResourceCollection.Tags");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
AppBoundaryKey = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].ResourceCollection.Tags[j].AppBoundaryKey");
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].ResourceCollection.Tags[j].TagValues");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
strVal = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].ResourceCollection.Tags[j].TagValues[k]");
k = k + 1;
}
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
MetricDataSummaryStatusCode = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.StatusCode");
MetricName = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricName");
Namespace = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Namespace");
Period = CkJsonObjectW_IntOf(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Period");
Stat = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Stat");
Unit = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Unit");
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
Name = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Name");
Value = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].Dimensions[k].Value");
k = k + 1;
}
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
MetricValue = CkJsonObjectW_IntOf(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].MetricValue");
Timestamp = CkJsonObjectW_IntOf(jResp,L"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].Timestamp");
k = k + 1;
}
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
MetricDisplayName = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricDisplayName");
FilterString = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Filter.string");
GroupByGroup = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Group");
GroupByLimit = CkJsonObjectW_IntOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Limit");
MetricQueryMetric = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.Metric");
Unit = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].Unit");
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
strVal = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].MetricQuery.GroupBy.Dimensions[k]");
k = k + 1;
}
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
FilterString = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Filter.string");
GroupByGroup = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Group");
GroupByLimit = CkJsonObjectW_IntOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Limit");
MetricQueryMetric = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceMetric.MetricQuery.Metric");
ReferenceScalarValue = CkJsonObjectW_IntOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].ComparisonValues.ReferenceScalar.Value");
Name = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k].Name");
json1 = CkJsonObjectW_ObjectOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].ReferenceData[k]");
i1 = 0;
count_i1 = CkJsonObjectW_SizeOfArray(json1,L"ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions");
while (i1 < count_i1) {
CkJsonObjectW_putI(json1,i1);
strVal = CkJsonObjectW_stringOf(json1,L"ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[i]");
i1 = i1 + 1;
}
CkJsonObjectW_Dispose(json1);
k = k + 1;
}
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
v_Type = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Type");
Value_int = CkJsonObjectW_IntOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly[k].Value");
k = k + 1;
}
k = 0;
count_k = CkJsonObjectW_SizeOfArray(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline");
while (k < count_k) {
CkJsonObjectW_putK(jResp,k);
v_Type = CkJsonObjectW_stringOf(jResp,L"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline[k].Type");
Value_int = CkJsonObjectW_IntOf(jResp,L"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"
// }
// ]
// }
CkRestW_Dispose(rest);
CkAuthAwsW_Dispose(authAws);
CkJsonObjectW_Dispose(json);
CkStringBuilderW_Dispose(sbRequestBody);
CkStringBuilderW_Dispose(sbResponseBody);
CkJsonObjectW_Dispose(jResp);
}