Problem Statement
Currently, if I would like my user message to include information stored in an Array, there is no way to traverse the objects of the array and extract the field I am looking for to send back to the end user. I want my user message to include information stored in an Array, and there is no way to traverse the array's objects in that context
Solution Description
Lets say we have the following Reference JSON, I want to be able to grab tasks[*].taskArn or tasks[*].containers[*].containerArn and provide it in my message block as proper identification for my end users:
{
"failures": [],
"tasks": [
{
"taskArn": "arn:aws:ecs:us-east-1:012345678910:task/1dc5c17a-422b-4dc4-b493-371970c6c4d6",
"overrides": {
"containerOverrides": [
{
"name": "simple-app"
},
{
"name": "busybox"
}
]
},
"lastStatus": "RUNNING",
"containerInstanceArn": "arn:aws:ecs:us-east-1:012345678910:container-instance/default/5991d8da-1d59-49d2-a31f-4230f9e73140",
"createdAt": 1476822811.295,
"version": 0,
"clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default",
"startedAt": 1476822833.998,
"desiredStatus": "RUNNING",
"taskDefinitionArn": "arn:aws:ecs:us-east-1:012345678910:task-definition/console-sample-app-dynamic-ports:1",
"startedBy": "ecs-svc/9223370560032507596",
"containers": [
{
"containerArn": "arn:aws:ecs:us-east-1:012345678910:container/4df26bb4-f057-467b-a079-961675296e64",
"taskArn": "arn:aws:ecs:us-east-1:012345678910:task/default/1dc5c17a-422b-4dc4-b493-371970c6c4d6",
"lastStatus": "RUNNING",
"name": "simple-app",
"networkBindings": [
{
"protocol": "tcp",
"bindIP": "0.0.0.0",
"containerPort": 80,
"hostPort": 32774
}
]
},
{
"containerArn": "arn:aws:ecs:us-east-1:012345678910:container/e09064f7-7361-4c87-8ab9-8d073bbdbcb9",
"taskArn": "arn:aws:ecs:us-east-1:012345678910:task/default/1dc5c17a-422b-4dc4-b493-371970c6c4d6",
"lastStatus": "RUNNING",
"name": "busybox",
"networkBindings": []
}
]
}
]
}
Alternatives
No response
Additional Context
No response
Slack discussion
No response
Research
Problem Statement
Currently, if I would like my user message to include information stored in an Array, there is no way to traverse the objects of the array and extract the field I am looking for to send back to the end user. I want my user message to include information stored in an Array, and there is no way to traverse the array's objects in that context
Solution Description
Lets say we have the following Reference JSON, I want to be able to grab
tasks[*].taskArnortasks[*].containers[*].containerArnand provide it in mymessageblock as proper identification for my end users:{ "failures": [], "tasks": [ { "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/1dc5c17a-422b-4dc4-b493-371970c6c4d6", "overrides": { "containerOverrides": [ { "name": "simple-app" }, { "name": "busybox" } ] }, "lastStatus": "RUNNING", "containerInstanceArn": "arn:aws:ecs:us-east-1:012345678910:container-instance/default/5991d8da-1d59-49d2-a31f-4230f9e73140", "createdAt": 1476822811.295, "version": 0, "clusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/default", "startedAt": 1476822833.998, "desiredStatus": "RUNNING", "taskDefinitionArn": "arn:aws:ecs:us-east-1:012345678910:task-definition/console-sample-app-dynamic-ports:1", "startedBy": "ecs-svc/9223370560032507596", "containers": [ { "containerArn": "arn:aws:ecs:us-east-1:012345678910:container/4df26bb4-f057-467b-a079-961675296e64", "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/default/1dc5c17a-422b-4dc4-b493-371970c6c4d6", "lastStatus": "RUNNING", "name": "simple-app", "networkBindings": [ { "protocol": "tcp", "bindIP": "0.0.0.0", "containerPort": 80, "hostPort": 32774 } ] }, { "containerArn": "arn:aws:ecs:us-east-1:012345678910:container/e09064f7-7361-4c87-8ab9-8d073bbdbcb9", "taskArn": "arn:aws:ecs:us-east-1:012345678910:task/default/1dc5c17a-422b-4dc4-b493-371970c6c4d6", "lastStatus": "RUNNING", "name": "busybox", "networkBindings": [] } ] } ] }Alternatives
No response
Additional Context
No response
Slack discussion
No response
Research