DescribeAnomaly PureBasic Example
IncludeFile "CkJsonObject.pb"
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkRest.pb"
IncludeFile "CkAuthAws.pb"
Procedure ChilkatExample()
; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
rest.i = CkRest::ckCreate()
If rest.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success.i
authAws.i = CkAuthAws::ckCreate()
If authAws.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkAuthAws::setCkAccessKey(authAws, "AWS_ACCESS_KEY")
CkAuthAws::setCkSecretKey(authAws, "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.)
CkAuthAws::setCkRegion(authAws, "us-west-2")
CkAuthAws::setCkServiceName(authAws, "devops-guru")
; SetAuthAws causes Chilkat to automatically add the following headers: Authorization, X-Amz-Date
CkRest::ckSetAuthAws(rest,authAws)
; URL: https://devops-guru.us-west-2.amazonaws.com/
; Use the same region as specified above.
success = CkRest::ckConnect(rest,"devops-guru.us-west-2.amazonaws.com",443,1,1)
If success <> 1
Debug "ConnectFailReason: " + Str(CkRest::ckConnectFailReason(rest))
Debug CkRest::ckLastErrorText(rest)
CkRest::ckDispose(rest)
CkAuthAws::ckDispose(authAws)
ProcedureReturn
EndIf
CkRest::ckAddHeader(rest,"Content-Type","application/x-amz-json-1.1")
CkRest::ckAddHeader(rest,"X-Amz-Target","DescribeAnomaly")
sbResponseBody.i = CkStringBuilder::ckCreate()
If sbResponseBody.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success = CkRest::ckFullRequestNoBodySb(rest,"GET","/anomalies/{Id}",sbResponseBody)
If success <> 1
Debug CkRest::ckLastErrorText(rest)
CkRest::ckDispose(rest)
CkAuthAws::ckDispose(authAws)
CkStringBuilder::ckDispose(sbResponseBody)
ProcedureReturn
EndIf
respStatusCode.i = CkRest::ckResponseStatusCode(rest)
Debug "response status code = " + Str(respStatusCode)
If respStatusCode <> 200
Debug "Response Header:"
Debug CkRest::ckResponseHeader(rest)
Debug "Response Body:"
Debug CkStringBuilder::ckGetAsString(sbResponseBody)
CkRest::ckDispose(rest)
CkAuthAws::ckDispose(authAws)
CkStringBuilder::ckDispose(sbResponseBody)
ProcedureReturn
EndIf
jResp.i = CkJsonObject::ckCreate()
If jResp.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckLoadSb(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
strVal.s
AppBoundaryKey.s
j.i
count_j.i
StatusCode.s
MetricName.s
Namespace.s
Period.i
Stat.s
Unit.s
Value.s
MetricValue.i
Timestamp.i
MetricDisplayName.s
v_String.s
Group.s
GroupByLimit.i
Metric.s
FilterString.s
GroupByGroup.s
MetricQueryMetric.s
ReferenceScalarValue.i
k.i
count_k.i
Value_int.i
MetricDataSummaryStatusCode.s
CloseTime.i = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.AnomalyReportedTimeRange.CloseTime")
OpenTime.i = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.AnomalyReportedTimeRange.OpenTime")
EndTime.i = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.AnomalyTimeRange.EndTime")
StartTime.i = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.AnomalyTimeRange.StartTime")
AssociatedInsightId.s = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.AssociatedInsightId")
Id.s = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.Id")
Limit.i = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.Limit")
PredictionTimeRangeEndTime.i = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.PredictionTimeRange.EndTime")
PredictionTimeRangeStartTime.i = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.PredictionTimeRange.StartTime")
Severity.s = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.Severity")
Source.s = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceMetadata.Source")
SourceResourceName.s = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceMetadata.SourceResourceName")
SourceResourceType.s = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceMetadata.SourceResourceType")
Status.s = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.Status")
UpdateTime.i = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.UpdateTime")
AnomalyReportedTimeRangeCloseTime.i = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.AnomalyReportedTimeRange.CloseTime")
AnomalyReportedTimeRangeOpenTime.i = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.AnomalyReportedTimeRange.OpenTime")
AnomalyTimeRangeEndTime.i = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.AnomalyTimeRange.EndTime")
AnomalyTimeRangeStartTime.i = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.AnomalyTimeRange.StartTime")
ReactiveAnomalyAssociatedInsightId.s = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.AssociatedInsightId")
CausalAnomalyId.s = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.CausalAnomalyId")
Description.s = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.Description")
ReactiveAnomalyId.s = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.Id")
Name.s = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.Name")
ReactiveAnomalySeverity.s = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.Severity")
ReactiveAnomalyStatus.s = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.Status")
v_Type.s = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.Type")
i.i = 0
count_i.i = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.AnomalyResources")
While i < count_i
CkJsonObject::setCkI(jResp, i)
Name = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.AnomalyResources[i].Name")
v_Type = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.AnomalyResources[i].Type")
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.ResourceCollection.CloudFormation.StackNames")
While i < count_i
CkJsonObject::setCkI(jResp, i)
strVal = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.ResourceCollection.CloudFormation.StackNames[i]")
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.ResourceCollection.Tags")
While i < count_i
CkJsonObject::setCkI(jResp, i)
AppBoundaryKey = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.ResourceCollection.Tags[i].AppBoundaryKey")
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.ResourceCollection.Tags[i].TagValues")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
strVal = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.ResourceCollection.Tags[i].TagValues[j]")
j = j + 1
Wend
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics")
While i < count_i
CkJsonObject::setCkI(jResp, i)
StatusCode = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.StatusCode")
MetricName = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricName")
Namespace = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Namespace")
Period = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Period")
Stat = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Stat")
Unit = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Unit")
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
Name = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Name")
Value = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Value")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
MetricValue = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].MetricValue")
Timestamp = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].Timestamp")
j = j + 1
Wend
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics")
While i < count_i
CkJsonObject::setCkI(jResp, i)
MetricDisplayName = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricDisplayName")
v_String = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Filter.string")
Group = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Group")
GroupByLimit = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Limit")
Metric = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Metric")
Unit = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].Unit")
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
strVal = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions[j]")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
FilterString = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.Filter.string")
GroupByGroup = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Group")
GroupByLimit = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Limit")
MetricQueryMetric = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.Metric")
ReferenceScalarValue = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceScalar.Value")
Name = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].Name")
k = 0
count_k = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions")
While k < count_k
CkJsonObject::setCkK(jResp, k)
strVal = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[k]")
k = k + 1
Wend
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
v_Type = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Type")
Value_int = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Value")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
v_Type = CkJsonObject::ckStringOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Type")
Value_int = CkJsonObject::ckIntOf(jResp,"ProactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Value")
j = j + 1
Wend
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.AnomalyResources")
While i < count_i
CkJsonObject::setCkI(jResp, i)
Name = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.AnomalyResources[i].Name")
v_Type = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.AnomalyResources[i].Type")
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.ResourceCollection.CloudFormation.StackNames")
While i < count_i
CkJsonObject::setCkI(jResp, i)
strVal = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.ResourceCollection.CloudFormation.StackNames[i]")
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.ResourceCollection.Tags")
While i < count_i
CkJsonObject::setCkI(jResp, i)
AppBoundaryKey = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.ResourceCollection.Tags[i].AppBoundaryKey")
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.ResourceCollection.Tags[i].TagValues")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
strVal = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.ResourceCollection.Tags[i].TagValues[j]")
j = j + 1
Wend
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics")
While i < count_i
CkJsonObject::setCkI(jResp, i)
MetricDataSummaryStatusCode = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.StatusCode")
MetricName = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricName")
Namespace = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Namespace")
Period = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Period")
Stat = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Stat")
Unit = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Unit")
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
Name = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Name")
Value = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].Dimensions[j].Value")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
MetricValue = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].MetricValue")
Timestamp = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.SourceDetails.CloudWatchMetrics[i].MetricDataSummary.TimestampMetricValuePairList[j].Timestamp")
j = j + 1
Wend
i = i + 1
Wend
i = 0
count_i = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics")
While i < count_i
CkJsonObject::setCkI(jResp, i)
MetricDisplayName = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricDisplayName")
FilterString = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Filter.string")
GroupByGroup = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Group")
GroupByLimit = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Limit")
MetricQueryMetric = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.Metric")
Unit = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].Unit")
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
strVal = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].MetricQuery.GroupBy.Dimensions[j]")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
FilterString = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.Filter.string")
GroupByGroup = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Group")
GroupByLimit = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Limit")
MetricQueryMetric = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.Metric")
ReferenceScalarValue = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceScalar.Value")
Name = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].Name")
k = 0
count_k = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions")
While k < count_k
CkJsonObject::setCkK(jResp, k)
strVal = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].ReferenceData[j].ComparisonValues.ReferenceMetric.MetricQuery.GroupBy.Dimensions[k]")
k = k + 1
Wend
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
v_Type = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Type")
Value_int = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtAnomaly[j].Value")
j = j + 1
Wend
j = 0
count_j = CkJsonObject::ckSizeOfArray(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline")
While j < count_j
CkJsonObject::setCkJ(jResp, j)
v_Type = CkJsonObject::ckStringOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Type")
Value_int = CkJsonObject::ckIntOf(jResp,"ReactiveAnomaly.SourceDetails.PerformanceInsightsMetrics[i].StatsAtBaseline[j].Value")
j = j + 1
Wend
i = i + 1
Wend
; A sample JSON response body parsed by the above code:
; {
; "ProactiveAnomaly": {
; "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
; },
; "ReactiveAnomaly": {
; "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"
; }
; }
CkRest::ckDispose(rest)
CkAuthAws::ckDispose(authAws)
CkStringBuilder::ckDispose(sbResponseBody)
CkJsonObject::ckDispose(jResp)
ProcedureReturn
EndProcedure