Commit 1cbca8c0 by Adi Amir

support grouped cameras

parent 4d2d253f
{
"config": {
"metaDataConfig": "logic.adapter.HttpAdapter.model.HttpAdapterConfig",
"configHttpRequestParams": {
"baseUrl": "ie-parking.run.aws-usw02-pr.ice.predix.io/",
"basePath": "v1/",
"headers": [{
"name": "predix-zone-id",
"value": "c54e3e63-8dc6-425e-a533-64e061f64023"
}]
},
"authentication": {
"type": "oauth2",
"credential": {
"uaa": "9deacc64-7c53-4790-9a6c-c9de0fdebcdf.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token",
"clientId": "ipgallery",
"clientSecret": "1PGall3ry"
}
}
},
"flows": [{
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.SimpleHttpAction",
"params": {
"id": "GetAllParkingSpots",
"httpMethod": "GET",
"path": "locations/search",
"queryParams": [{
"name": "bbox",
"value": "32.123:-117,32.723179:-117.172655"
}, {
"name": "q",
"value": "location-type:PARKING_SPOT"
}, {
"name": "size",
"value": "30"
}],
"headers": [],
"content": null
}
},
"onResponse": {
"onSuccess": {
"actionsInput": "CONTENT",
"actions": [
{
"metaDataActionClass": "logic.adapter.action.ExtractValueAction",
"params": {
"path": "/_embedded/locations",
"valueType": "ARRAY-NODE"
}
}, {
"metaDataActionClass": "logic.adapter.action.JsonConvertAction",
"params": {
"intermediateOperations": [{
"metaDataOperationClass": "logic.adapter.HttpAdapter.model.MapStringToJsonOperation",
"operationParams": {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.SimpleHttpAction",
"params": {
"variables": {
"id": {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.ExtractSubStringAction",
"extract": {
"path": "/_links/self/href",
"valueType": "STRING"
},
"subString": {
"from": {
"str": "/",
"location": "LAST",
"index": null
},
"to": null
}
}
}},
"id": "getLocationDetails",
"httpMethod": "GET",
"path": "locations/$id",
"queryParams": null,
"headers": [],
"content": null
}
}
}
}, {
"metaDataOperationClass": "logic.adapter.HttpAdapter.model.MapJsonToJsonOperation",
"operationParams": {
"action": {
"metaDataActionClass": "logic.adapter.action.JsonPatchAction",
"params": {
"variables": {
"mdeKey": {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.ExtractSubStringAction",
"extract": {
"path": "/_embedded/assets/0/_links/self/href",
"valueType": "STRING"
},
"subString": {
"from": {
"str": "/",
"location": "LAST",
"index": null
},
"to": null
}
}
}
},
"fileInput": null,
"filePatch": "parkingSpotJsonPatch.json"
}
}
}
}],
"terminateOperation": null
}
}]
},
"onError": null
}
}, {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.SimpleHttpAction",
"params": {
"id": "getLocationDetails",
"httpMethod": "GET",
"path": "locations/$id",
"queryParams": [],
"headers": [],
"content": null
}
},
"onResponse": {
"onSuccess": {
"actionsInput": "CONTENT",
"actions": []
},
"onError": {
"actionsInput": "CONTENT",
"actions": []
}
}
}, {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.SimpleHttpAction",
"params": {
"id": "subscribe",
"httpMethod": "GET",
"path": "assets/$mdeKey/live-events",
"queryParams": [{
"name": "event-types",
"value": "PKIN,PKOUT"
}],
"headers": [],
"content": null
}
},
"onResponse": {
"onSuccess": {
"actionsInput": "CONTENT",
"actions": [{
"metaDataActionClass": "logic.adapter.HttpAdapter.action.WebSocketAction",
"params": {
"variables": {
"webSocket": {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.ExtractSubStringAction",
"extract": {
"path": "/url",
"valueType": "STRING"
},
"subString": {
"from": null,
"to": null
}
}
}
},
"headers": [{
"name": "predix-zone-id",
"value": "c54e3e63-8dc6-425e-a533-64e061f64023"
}],
"webSocket": "$webSocket",
"mdeKey": "$mdeKey",
"uid": "$uid"
}
}]
},
"onError": {
"actionsInput": "CONTENT",
"actions": []
}
}
}
]
}
\ No newline at end of file
{
"config": {
"metaDataConfig": "logic.adapter.HttpAdapter.model.HttpAdapterConfig",
"configHttpRequestParams": {
"baseUrl": "ie-parking.run.aws-usw02-pr.ice.predix.io/",
"basePath": "v1/",
"headers": [{
"name": "predix-zone-id",
"value": "c54e3e63-8dc6-425e-a533-64e061f64023"
}]
},
"authentication": {
"type": "oauth2",
"credential": {
"uaa": "9deacc64-7c53-4790-9a6c-c9de0fdebcdf.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token",
"clientId": "ipgallery",
"clientSecret": "1PGall3ry"
}
}
},
"flows": [{
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.SimpleHttpAction",
"params": {
"id": "GetAllParkingSpots",
"httpMethod": "GET",
"path": "locations/search",
"queryParams": [{
"name": "bbox",
"value": "32.123:-117,32.723179:-117.172655"
}, {
"name": "q",
"value": "location-type:PARKING_SPOT"
}, {
"name": "size",
"value": "30"
}],
"headers": [],
"content": null
}
},
"onResponse": {
"onSuccess": {
"actionsInput": "CONTENT",
"actions": [
{
"metaDataActionClass": "logic.adapter.action.ExtractValueAction",
"params": {
"path": "/_embedded/locations",
"valueType": "ARRAY-NODE"
}
}, {
"metaDataActionClass": "logic.adapter.action.JsonConvertAction",
"params": {
"intermediateOperations": [{
"metaDataOperationClass": "logic.adapter.HttpAdapter.model.MapStringToJsonOperation",
"operationParams": {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.SimpleHttpAction",
"params": {
"variables": {
"id": {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.ExtractSubStringAction",
"extract": {
"path": "/_links/self/href",
"valueType": "STRING"
},
"subString": {
"from": {
"str": "/",
"location": "LAST",
"index": null
},
"to": null
}
}
}},
"id": "getLocationDetails",
"httpMethod": "GET",
"path": "locations/$id",
"queryParams": null,
"headers": [],
"content": null
}
}
}
}, {
"metaDataOperationClass": "logic.adapter.HttpAdapter.model.MapJsonToJsonOperation",
"operationParams": {
"action": {
"metaDataActionClass": "logic.adapter.action.JsonPatchAction",
"params": {
"variables": {
"mdeKey": {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.ExtractSubStringAction",
"extract": {
"path": "/_embedded/assets/0/_links/self/href",
"valueType": "STRING"
},
"subString": {
"from": {
"str": "/",
"location": "LAST",
"index": null
},
"to": null
}
}
}
},
"fileInput": null,
"filePatch": "parkingSpotJsonPatch.json"
}
}
}
}],
"terminateOperation": null
}
}]
},
"onError": null
}
}, {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.SimpleHttpAction",
"params": {
"id": "getLocationDetails",
"httpMethod": "GET",
"path": "locations/$id",
"queryParams": [],
"headers": [],
"content": null
}
},
"onResponse": {
"onSuccess": {
"actionsInput": "CONTENT",
"actions": []
},
"onError": {
"actionsInput": "CONTENT",
"actions": []
}
}
}, {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.SimpleHttpAction",
"params": {
"id": "subscribe",
"httpMethod": "GET",
"path": "assets/$mdeKey/live-events",
"queryParams": [{
"name": "event-types",
"value": "PKIN,PKOUT"
}],
"headers": [],
"content": null
}
},
"onResponse": {
"onSuccess": {
"actionsInput": "CONTENT",
"actions": [{
"metaDataActionClass": "logic.adapter.HttpAdapter.action.WebSocketAction",
"params": {
"variables": {
"webSocket": {
"action": {
"metaDataActionClass": "logic.adapter.HttpAdapter.action.ExtractSubStringAction",
"extract": {
"path": "/url",
"valueType": "STRING"
},
"subString": {
"from": null,
"to": null
}
}
}
},
"headers": [{
"name": "predix-zone-id",
"value": "c54e3e63-8dc6-425e-a533-64e061f64023"
}],
"webSocket": "$webSocket",
"mdeKey": "$mdeKey",
"uid": "$uid"
}
}]
},
"onError": {
"actionsInput": "CONTENT",
"actions": []
}
}
}
]
}
\ No newline at end of file
{
"api": [{
"id": "getCameraList",
"request": {
"method": "GET",
"path": "v2/ge/media/cameras",
"params": [{
"bbox": "{quuery.bbox}[GEO]/mandatory"
}]
},
"actions": [{
"type": "CALL_ADAPTER",
"adapterId": "ge-v1",
"apiId": "getCameraList",
"params": [{
"bbox": "${request.query.bbox}[GEO]"
}],
"OnResponse": {
"$CAMERA_ARRAY": "response.content.content[JSON_ARRAY]"
}
}, {
"type": "CALL_ADAPTER",
"rule": {
"callEachEntryInArray": "${CAMERA_ARRAY}"
}
},
"adapterId": "ge-v1",
"apiId": "getCameraDetails",
"params": [{
"cameraId": "${CAMERA_ARRAY}.assetUid}}"
}]
}, {
"type": "CONVERT",
"converterId": "J2J/parking-spot",
"input": "$content/spot"
}]
}]
}
\ No newline at end of file
...@@ -31,7 +31,7 @@ response: ...@@ -31,7 +31,7 @@ response:
getLatestImage getLatestImage
************** **************
public-safety ==> GET 172.16.1.72:50005/public-safety/media/api/v2/san-diego/camera/CAMERA-STG-HYP1052-CAM-L/latestImage public-safety ==> GET 172.16.1.72:50005/public-safety/media/api/v2/san-diego/camera/CAMERA-STG-HYP1052-CAM-L/latestImage?views=CAMERA-STG-HYP1017-CAM-L,CAMERA-STG-HYP1017-CAM-R,CAMERA-STG-HYP1017-CAM-F
response: response:
{ {
"success": true, "success": true,
......
...@@ -78,7 +78,7 @@ public class MdeManager { ...@@ -78,7 +78,7 @@ public class MdeManager {
String ver = serviceId.split("\\.")[0]; String ver = serviceId.split("\\.")[0];
if (ver.equals("v2")) if (ver.equals("v2"))
brr = geManager.executeRequest(serviceId,apiIdAsParams,requestContext,null, isMaintenanceRequest); brr = geManager.executeRequest(serviceId,apiIdAsParams,requestContext);
else else
brr = executeRequest(serviceId,apiIdAsParams,requestContext,null,isMaintenanceRequest); brr = executeRequest(serviceId,apiIdAsParams,requestContext,null,isMaintenanceRequest);
return brr; return brr;
...@@ -104,7 +104,7 @@ public class MdeManager { ...@@ -104,7 +104,7 @@ public class MdeManager {
String ver = serviceId.split("\\.")[0]; String ver = serviceId.split("\\.")[0];
if (ver.equals("v2")) if (ver.equals("v2"))
brr = geManager.executeRequest(serviceId,apiIdAsParams,requestContext,content, isMaintenanceRequest); brr = geManager.executeRequest(serviceId,apiIdAsParams,requestContext);
else else
brr = executeRequest(serviceId,apiIdAsParams,requestContext,content, isMaintenanceRequest); brr = executeRequest(serviceId,apiIdAsParams,requestContext,content, isMaintenanceRequest);
return brr; return brr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment