ListAnomaliesForInsight Objective-C Example
#import <CkoRest.h>
#import <CkoAuthAws.h>
#import <CkoJsonObject.h>
#import <CkoStringBuilder.h>
#import <NSString.h>
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkoRest *rest = [[CkoRest alloc] init];
BOOL success;
CkoAuthAws *authAws = [[CkoAuthAws alloc] init];
authAws.AccessKey = @"AWS_ACCESS_KEY";
authAws.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.Region = @"us-west-2";
authAws.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" port: [NSNumber numberWithInt: 443] tls: YES autoReconnect: YES];
if (success != YES) {
NSLog(@"%@%d",@"ConnectFailReason: ",[rest.ConnectFailReason intValue]);
NSLog(@"%@",rest.LastErrorText);
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
CkoJsonObject *json = [[CkoJsonObject alloc] init];
[json UpdateString: @"AccountId" value: @"string"];
[json UpdateInt: @"MaxResults" value: [NSNumber numberWithInt: 123]];
[json UpdateString: @"NextToken" value: @"string"];
[json UpdateInt: @"StartTimeRange.FromTime" value: [NSNumber numberWithInt: 123]];
[json UpdateInt: @"StartTimeRange.ToTime" value: [NSNumber numberWithInt: 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" value: @"application/x-amz-json-1.1"];
[rest AddHeader: @"X-Amz-Target" value: @"ListAnomaliesForInsight"];
CkoStringBuilder *sbRequestBody = [[CkoStringBuilder alloc] init];
[json EmitSb: sbRequestBody];
CkoStringBuilder *sbResponseBody = [[CkoStringBuilder alloc] init];
success = [rest FullRequestSb: @"POST" uriPath: @"/anomalies/insight/{InsightId}" requestBody: sbRequestBody responseBody: sbResponseBody];
if (success != YES) {
NSLog(@"%@",rest.LastErrorText);
return;
}
int respStatusCode = [rest.ResponseStatusCode intValue];
NSLog(@"%@%d",@"response status code = ",respStatusCode);
if (respStatusCode != 200) {
NSLog(@"%@",@"Response Header:");
NSLog(@"%@",rest.ResponseHeader);
NSLog(@"%@",@"Response Body:");
NSLog(@"%@",[sbResponseBody GetAsString]);
return;
}
CkoJsonObject *jResp = [[CkoJsonObject alloc] init];
[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
int CloseTime;
int OpenTime;
int EndTime;
int StartTime;
NSString *AssociatedInsightId = 0;
NSString *Id = 0;
int Limit;
int PredictionTimeRangeEndTime;
int PredictionTimeRangeStartTime;
NSString *Severity = 0;
NSString *Source = 0;
NSString *SourceResourceName = 0;
NSString *SourceResourceType = 0;
NSString *Status = 0;
int UpdateTime;
int j;
int count_j;
NSString *Name = 0;
NSString *v_Type = 0;
NSString *strVal = 0;
NSString *AppBoundaryKey = 0;
int k;
int count_k;
NSString *StatusCode = 0;
NSString *MetricName = 0;
NSString *Namespace = 0;
int Period;
NSString *Stat = 0;
NSString *Unit = 0;
NSString *Value = 0;
int MetricValue;
int Timestamp;
NSString *MetricDisplayName = 0;
NSString *v_String = 0;
NSString *Group = 0;
int GroupByLimit;
NSString *Metric = 0;
NSString *FilterString = 0;
NSString *GroupByGroup = 0;
NSString *MetricQueryMetric = 0;
int ReferenceScalarValue;
CkoJsonObject *json1 = 0;
int i1;
int count_i1;
int Value_int;
int AnomalyReportedTimeRangeCloseTime;
int AnomalyReportedTimeRangeOpenTime;
int AnomalyTimeRangeEndTime;
int AnomalyTimeRangeStartTime;
NSString *CausalAnomalyId = 0;
NSString *Description = 0;
NSString *MetricDataSummaryStatusCode = 0;
NSString *NextToken = [jResp StringOf: @"NextToken"];
int i = 0;
int count_i = [[jResp SizeOfArray: @"ProactiveAnomalies"] intValue];
while (i < count_i) {
jResp.I = [NSNumber numberWithInt: i];
CloseTime = [[jResp IntOf: @"ProactiveAnomalies[i].AnomalyReportedTimeRange.CloseTime"] intValue];
OpenTime = [[jResp IntOf: @"ProactiveAnomalies[i].AnomalyReportedTimeRange.OpenTime"] intValue];
EndTime = [[jResp IntOf: @"ProactiveAnomalies[i].AnomalyTimeRange.EndTime"] intValue];
StartTime = [[jResp IntOf: @"ProactiveAnomalies[i].AnomalyTimeRange.StartTime"] intValue];
AssociatedInsightId = [jResp StringOf: @"ProactiveAnomalies[i].AssociatedInsightId"];
Id = [jResp StringOf: @"ProactiveAnomalies[i].Id"];
Limit = [[jResp IntOf: @"ProactiveAnomalies[i].Limit"] intValue];
PredictionTimeRangeEndTime = [[jResp IntOf: @"ProactiveAnomalies[i].PredictionTimeRange.EndTime"] intValue];
PredictionTimeRangeStartTime = [[jResp IntOf: @"ProactiveAnomalies[i].PredictionTimeRange.StartTime"] intValue];
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"] intValue];
j = 0;
count_j = [[jResp SizeOfArray: @"ProactiveAnomalies[i].AnomalyResources"] intValue];
while (j < count_j) {
jResp.J = [NSNumber numberWithInt: 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"] intValue];
while (j < count_j) {
jResp.J = [NSNumber numberWithInt: j];
strVal = [jResp StringOf: @"ProactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames[j]"];
j = j + 1;
}
j = 0;
count_j = [[jResp SizeOfArray: @"ProactiveAnomalies[i].ResourceCollection.Tags"] intValue];
while (j < count_j) {
jResp.J = [NSNumber numberWithInt: j];
AppBoundaryKey = [jResp StringOf: @"ProactiveAnomalies[i].ResourceCollection.Tags[j].AppBoundaryKey"];
k = 0;
count_k = [[jResp SizeOfArray: @"ProactiveAnomalies[i].ResourceCollection.Tags[j].TagValues"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
while (j < count_j) {
jResp.J = [NSNumber numberWithInt: 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"] intValue];
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"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: k];
MetricValue = [[jResp IntOf: @"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].MetricValue"] intValue];
Timestamp = [[jResp IntOf: @"ProactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].Timestamp"] intValue];
k = k + 1;
}
j = j + 1;
}
j = 0;
count_j = [[jResp SizeOfArray: @"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics"] intValue];
while (j < count_j) {
jResp.J = [NSNumber numberWithInt: 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"] intValue];
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"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
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"] intValue];
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"] intValue];
while (i1 < count_i1) {
json1.I = [NSNumber numberWithInt: i1];
strVal = [json1 StringOf: @"ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[i]"];
i1 = i1 + 1;
}
k = k + 1;
}
k = 0;
count_k = [[jResp SizeOfArray: @"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
k = k + 1;
}
k = 0;
count_k = [[jResp SizeOfArray: @"ProactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
k = k + 1;
}
j = j + 1;
}
i = i + 1;
}
i = 0;
count_i = [[jResp SizeOfArray: @"ReactiveAnomalies"] intValue];
while (i < count_i) {
jResp.I = [NSNumber numberWithInt: i];
AnomalyReportedTimeRangeCloseTime = [[jResp IntOf: @"ReactiveAnomalies[i].AnomalyReportedTimeRange.CloseTime"] intValue];
AnomalyReportedTimeRangeOpenTime = [[jResp IntOf: @"ReactiveAnomalies[i].AnomalyReportedTimeRange.OpenTime"] intValue];
AnomalyTimeRangeEndTime = [[jResp IntOf: @"ReactiveAnomalies[i].AnomalyTimeRange.EndTime"] intValue];
AnomalyTimeRangeStartTime = [[jResp IntOf: @"ReactiveAnomalies[i].AnomalyTimeRange.StartTime"] intValue];
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"] intValue];
while (j < count_j) {
jResp.J = [NSNumber numberWithInt: 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"] intValue];
while (j < count_j) {
jResp.J = [NSNumber numberWithInt: j];
strVal = [jResp StringOf: @"ReactiveAnomalies[i].ResourceCollection.CloudFormation.StackNames[j]"];
j = j + 1;
}
j = 0;
count_j = [[jResp SizeOfArray: @"ReactiveAnomalies[i].ResourceCollection.Tags"] intValue];
while (j < count_j) {
jResp.J = [NSNumber numberWithInt: j];
AppBoundaryKey = [jResp StringOf: @"ReactiveAnomalies[i].ResourceCollection.Tags[j].AppBoundaryKey"];
k = 0;
count_k = [[jResp SizeOfArray: @"ReactiveAnomalies[i].ResourceCollection.Tags[j].TagValues"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
while (j < count_j) {
jResp.J = [NSNumber numberWithInt: 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"] intValue];
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"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: k];
MetricValue = [[jResp IntOf: @"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].MetricValue"] intValue];
Timestamp = [[jResp IntOf: @"ReactiveAnomalies[i].SourceDetails.CloudWatchMetrics[j].MetricDataSummary.TimestampMetricValuePairList[k].Timestamp"] intValue];
k = k + 1;
}
j = j + 1;
}
j = 0;
count_j = [[jResp SizeOfArray: @"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics"] intValue];
while (j < count_j) {
jResp.J = [NSNumber numberWithInt: 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"] intValue];
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"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
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"] intValue];
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"] intValue];
while (i1 < count_i1) {
json1.I = [NSNumber numberWithInt: i1];
strVal = [json1 StringOf: @"ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[i]"];
i1 = i1 + 1;
}
k = k + 1;
}
k = 0;
count_k = [[jResp SizeOfArray: @"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtAnomaly"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
k = k + 1;
}
k = 0;
count_k = [[jResp SizeOfArray: @"ReactiveAnomalies[i].SourceDetails.PerformanceInsightsMetrics[j].StatsAtBaseline"] intValue];
while (k < count_k) {
jResp.K = [NSNumber numberWithInt: 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"] intValue];
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"
// }
// ]
// }