@@ -90,6 +90,42 @@ curl -s "${API_BASE}/apps/lidar-sim/configurations" | jq '.items[] | {name: .nam
9090echo_step " 9. Checking Current Faults"
9191curl -s " ${API_BASE} /faults" | jq ' .'
9292
93+ # If there are faults, demonstrate snapshot / bulk-data endpoints
94+ FAULT_COUNT=$( curl -s " ${API_BASE} /faults" | jq ' .items | length' )
95+ if [ " $FAULT_COUNT " -gt 0 ]; then
96+ FIRST_FAULT=$( curl -s " ${API_BASE} /faults" | jq -r ' .items[0].code' )
97+ FIRST_ENTITY=$( curl -s " ${API_BASE} /faults" | jq -r ' .items[0].entity_id' )
98+
99+ echo_step " 10. Fault Detail with Environment Data (Snapshots)"
100+ echo " Fetching fault ${FIRST_FAULT} on entity ${FIRST_ENTITY} ..."
101+ curl -s " ${API_BASE} /${FIRST_ENTITY} /faults/${FIRST_FAULT} " | jq ' {
102+ code: .item.code,
103+ status: .item.status,
104+ environment_data: {
105+ extended_data_records: .environment_data.extended_data_records,
106+ snapshot_count: (.environment_data.snapshots | length)
107+ }
108+ }'
109+
110+ echo_step " 11. Bulk-Data Categories (Rosbag Recordings)"
111+ echo " Checking available bulk-data categories..."
112+ curl -s " ${API_BASE} /${FIRST_ENTITY} /bulk-data" | jq ' .'
113+
114+ echo_step " 12. Bulk-Data Descriptors (Rosbag Files)"
115+ echo " Listing available rosbag recordings..."
116+ curl -s " ${API_BASE} /${FIRST_ENTITY} /bulk-data/rosbags" | jq ' .items[] | {
117+ id: .id,
118+ name: .name,
119+ size: .size,
120+ mimetype: .mimetype,
121+ "x-medkit": ."x-medkit"
122+ }'
123+ else
124+ echo " "
125+ echo " No active faults. Inject a fault first to see snapshot/bulk-data features:"
126+ echo " ./inject-noise.sh && sleep 5 && bash $0 "
127+ fi
128+
93129echo " "
94130echo_success " API demonstration complete!"
95131echo " "
@@ -100,9 +136,10 @@ echo " ./inject-nan.sh # Inject NaN values"
100136echo " ./inject-drift.sh # Inject sensor drift"
101137echo " ./restore-normal.sh # Restore normal operation"
102138echo " "
139+ echo " 📸 After injecting a fault, check snapshots and rosbags:"
140+ echo " curl ${API_BASE} /faults | jq # List faults"
141+ echo " curl ${API_BASE} /components/lidar-unit/faults/<CODE> | jq # Fault detail + snapshots"
142+ echo " curl ${API_BASE} /components/lidar-unit/bulk-data/rosbags | jq # List rosbag recordings"
143+ echo " "
103144echo " 🌐 Web UI: http://localhost:3000"
104145echo " 🌐 REST API: http://localhost:8080/api/v1/"
105- echo " "
106- echo " 📖 More examples:"
107- echo " curl ${API_BASE} /apps/imu-sim/configurations | jq # IMU parameters"
108- echo " curl ${API_BASE} /apps/gps-sim/data/fix | jq # GPS data"
0 commit comments