258 lines
8.4 KiB
JSON
258 lines
8.4 KiB
JSON
///////////////event from $connect
|
|
|
|
{
|
|
"headers": {
|
|
"Host": "3fseaywb8b.execute-api.us-east-1.amazonaws.com",
|
|
"x-api-key": "",
|
|
"X-Forwarded-For": "",
|
|
"x-restapi": ""
|
|
},
|
|
"multiValueHeaders": {
|
|
"Host": [
|
|
"3fseaywb8b.execute-api.us-east-1.amazonaws.com"
|
|
],
|
|
"x-api-key": [
|
|
""
|
|
],
|
|
"X-Forwarded-For": [
|
|
""
|
|
],
|
|
"x-restapi": [
|
|
""
|
|
]
|
|
},
|
|
"requestContext": {
|
|
"routeKey": "$disconnect",
|
|
"messageId": null,
|
|
"eventType": "DISCONNECT",
|
|
"extendedRequestId": "BP2ynHbkoAMF6PA=",
|
|
"requestTime": "08/Oct/2019:14:34:31 +0000",
|
|
"messageDirection": "IN",
|
|
"stage": "prototype",
|
|
"connectedAt": 1570544607717,
|
|
"requestTimeEpoch": 1570545271055,
|
|
"identity": {
|
|
"cognitoIdentityPoolId": null,
|
|
"cognitoIdentityId": null,
|
|
"principalOrgId": null,
|
|
"cognitoAuthenticationType": null,
|
|
"userArn": null,
|
|
"userAgent": null,
|
|
"accountId": null,
|
|
"caller": null,
|
|
"sourceIp": "172.85.171.82",
|
|
"accessKey": null,
|
|
"cognitoAuthenticationProvider": null,
|
|
"user": null
|
|
},
|
|
"requestId": "BP2ynHbkoAMF6PA=",
|
|
"domainName": "3fseaywb8b.execute-api.us-east-1.amazonaws.com",
|
|
"connectionId": "BP1K-fcGIAMCK_w=",
|
|
"apiId": "3fseaywb8b"
|
|
},
|
|
"isBase64Encoded": false
|
|
}
|
|
|
|
{
|
|
"headers": {
|
|
"Host": "3fseaywb8b.execute-api.us-east-1.amazonaws.com",
|
|
"Sec-WebSocket-Extensions": "permessage-deflate; client_max_window_bits",
|
|
"Sec-WebSocket-Key": "f+6+XKW6s9NvhAudLgT0jg==",
|
|
"Sec-WebSocket-Version": "13",
|
|
"X-Amzn-Trace-Id": "Root=1-5d9c9e78-4525cf6933d7050d38564f07",
|
|
"X-Forwarded-For": "172.85.171.82",
|
|
"X-Forwarded-Port": "443",
|
|
"X-Forwarded-Proto": "https"
|
|
},
|
|
"multiValueHeaders": {
|
|
"Host": [
|
|
"3fseaywb8b.execute-api.us-east-1.amazonaws.com"
|
|
],
|
|
"Sec-WebSocket-Extensions": [
|
|
"permessage-deflate; client_max_window_bits"
|
|
],
|
|
"Sec-WebSocket-Key": [
|
|
"f+6+XKW6s9NvhAudLgT0jg=="
|
|
],
|
|
"Sec-WebSocket-Version": [
|
|
"13"
|
|
],
|
|
"X-Amzn-Trace-Id": [
|
|
"Root=1-5d9c9e78-4525cf6933d7050d38564f07"
|
|
],
|
|
"X-Forwarded-For": [
|
|
"172.85.171.82"
|
|
],
|
|
"X-Forwarded-Port": [
|
|
"443"
|
|
],
|
|
"X-Forwarded-Proto": [
|
|
"https"
|
|
]
|
|
},
|
|
"requestContext": {
|
|
"routeKey": "$connect",
|
|
"messageId": null,
|
|
"eventType": "CONNECT",
|
|
"extendedRequestId": "BP2y0FsqoAMFQTA=",
|
|
"requestTime": "08/Oct/2019:14:34:32 +0000",
|
|
"messageDirection": "IN",
|
|
"stage": "prototype",
|
|
"connectedAt": 1570545272386,
|
|
"requestTimeEpoch": 1570545272387,
|
|
"identity": {
|
|
"cognitoIdentityPoolId": null,
|
|
"cognitoIdentityId": null,
|
|
"principalOrgId": null,
|
|
"cognitoAuthenticationType": null,
|
|
"userArn": null,
|
|
"userAgent": null,
|
|
"accountId": null,
|
|
"caller": null,
|
|
"sourceIp": "172.85.171.82",
|
|
"accessKey": null,
|
|
"cognitoAuthenticationProvider": null,
|
|
"user": null
|
|
},
|
|
"requestId": "BP2y0FsqoAMFQTA=",
|
|
"domainName": "3fseaywb8b.execute-api.us-east-1.amazonaws.com",
|
|
"connectionId": "BP2y0c3bIAMCEmA=",
|
|
"apiId": "3fseaywb8b"
|
|
},
|
|
"isBase64Encoded": false
|
|
}
|
|
|
|
|
|
|
|
////////////////////response from scan DynamoDB with 1 connection
|
|
{"Items": [
|
|
{"connectionId": {
|
|
"S": "BQMAveEHIAMCESQ="}
|
|
}
|
|
],
|
|
"Count": 1,
|
|
"ScannedCount": 1,
|
|
"ResponseMetadata": {
|
|
"RequestId": "T1L5LCRC3MS9VGA9IA3CKO0I03VV4KQNSO5AEMVJF66Q9ASUAAJG",
|
|
"HTTPStatusCode": 200,
|
|
"HTTPHeaders": {
|
|
"server": "Server",
|
|
"date": "Tue, 08 Oct 2019 17:14:35 GMT",
|
|
"content-type": "application/x-amz-json-1.0",
|
|
"content-length": "80",
|
|
"connection": "keep-alive",
|
|
"x-amzn-requestid": "T1L5LCRC3MS9VGA9IA3CKO0I03VV4KQNSO5AEMVJF66Q9ASUAAJG",
|
|
"x-amz-crc32": "3660802099"
|
|
},
|
|
"RetryAttempts": 0}
|
|
}
|
|
|
|
//////////response from scan DynamoDB with multiple connections
|
|
{
|
|
"Items": [
|
|
{"connectionId": {"S": "BQMAveEHIAMCESQ="}},
|
|
{"connectionId": {"S": "BQOzHfRAIAMCKtQ="}}
|
|
],
|
|
"Count": 2,
|
|
"ScannedCount": 2,
|
|
"ResponseMetadata": {
|
|
"RequestId": "RE2LR2J9GRFP3KVBN7B0T494UJVV4KQNSO5AEMVJF66Q9ASUAAJG",
|
|
"HTTPStatusCode": 200,
|
|
"HTTPHeaders": {
|
|
"server": "Server",
|
|
"date": "Tue, 08 Oct 2019 17:18:58 GMT",
|
|
"content-type": "application/x-amz-json-1.0",
|
|
"content-length": "122",
|
|
"connection": "keep-alive",
|
|
"x-amzn-requestid": "RE2LR2J9GRFP3KVBN7B0T494UJVV4KQNSO5AEMVJF66Q9ASUAAJG",
|
|
"x-amz-crc32": "3681010755"
|
|
},
|
|
"RetryAttempts": 0
|
|
}
|
|
}
|
|
|
|
///////event in HPIoTgetData////////////
|
|
|
|
{
|
|
"requestContext": {
|
|
"routeKey": "getDataByLocation",
|
|
"messageId": "BUIA2fR9IAMCIUQ=",
|
|
"eventType": "MESSAGE",
|
|
"extendedRequestId": "BUIA2HtzIAMFtpA=",
|
|
"requestTime": "09/Oct/2019:21:39:42 +0000",
|
|
"messageDirection": "IN",
|
|
"stage": "prototype",
|
|
"connectedAt": 1570657015368,
|
|
"requestTimeEpoch": 1570657182924,
|
|
"identity": {
|
|
"cognitoIdentityPoolId": None,
|
|
"cognitoIdentityId": None,
|
|
"principalOrgId": None,
|
|
"cognitoAuthenticationType": None,
|
|
"userArn": None,
|
|
"userAgent": None,
|
|
"accountId": None,
|
|
"caller": None,
|
|
"sourceIp": "172.85.171.82",
|
|
"accessKey": None,
|
|
"cognitoAuthenticationProvider": None,
|
|
"user": None
|
|
},
|
|
"requestId": "BUIA2HtzIAMFtpA=",
|
|
"domainName": "3fseaywb8b.execute-api.us-east-1.amazonaws.com",
|
|
"connectionId": "BUHmqe6GIAMCIUQ=",
|
|
"apiId": "3fseaywb8b"
|
|
},
|
|
"body": "{
|
|
"action": "getDataByLocation"
|
|
}",
|
|
"isBase64Encoded": False
|
|
}
|
|
|
|
|
|
////////////////////Triggered DynamoDB Event
|
|
{
|
|
"Records": [
|
|
{
|
|
"eventID": "14ce94dd485ff5bfccb0c9207f2f76eb",
|
|
"eventName": "MODIFY",
|
|
"eventVersion": "1.1",
|
|
"eventSource": "aws:dynamodb",
|
|
"awsRegion": "us-east-1",
|
|
"dynamodb": {
|
|
"ApproximateCreationDateTime": 1570727665.0,
|
|
"Keys": {
|
|
"company": {"S": "Henry Resource"},
|
|
"location": {"S": "Bits Prospect 1"}
|
|
},
|
|
"NewImage": {
|
|
"current": {"N": "45.16485502585185"},
|
|
"field": {"S": "Bits Prospect"},
|
|
"plugin": {"S": "advvfdipp"},
|
|
"intake_pressure": {"N": "18.29554873573639"},
|
|
"volume_flow": {"N": "93.11446243262526"},
|
|
"company": {"S": "Henry Resource"},
|
|
"location": {"S": "Bits Prospect 1"},
|
|
"frequency": {"N": "31.970980161939234"},
|
|
"timestamp": {"S": "2019-10-10T12:14:25.633636"}
|
|
},
|
|
"OldImage": {
|
|
"current": {"N": "1.169778266486432"},
|
|
"field": {"S": "Bits Prospect"},
|
|
"plugin": {"S": "advvfdipp"},
|
|
"intake_pressure": {"N": "84.61898713772457"},
|
|
"volume_flow": {"N": "83.99508013885942"},
|
|
"company": {"S": "Henry Resource"},
|
|
"location": {"S": "Bits Prospect 1"},
|
|
"frequency": {"N": "79.86823770952265"},
|
|
"timestamp": {"S": "2019-09-27T10:02:15.795247"}
|
|
},
|
|
"SequenceNumber": "60024900000000034271005325",
|
|
"SizeBytes": 426,
|
|
"StreamViewType": "NEW_AND_OLD_IMAGES"
|
|
},
|
|
"eventSourceARN": "arn:aws:dynamodb:us-east-1:860246592755:table/HPIoTData/stream/2019-10-10T17:09:17.797"
|
|
}
|
|
]
|
|
}
|