Data Event Formats - Pumps
Summary
CWMS needs a message structure to notify clients of pump-related events.
Opinions
Opinion 1
Summary: Use the structures described below for pump-related events.
All messages will be published to the appropriate REALTIME_OPS topic. Subscribers can set up appropriate filters to receive the desired messages.
Author: Mike Perryman
Pumps
Only values necessary to uniquely identify a pump (“type”, “pump_id”) are required for PumpCreated, PumpUpdated, and PumpDeleted messages.
PumpCreated Message Structure
Message Type |
Structure |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PumpCreated |
|
Example PumpCreated Message
{
"type": "pump_created",
"pump_id": {
"office_id": "SWT",
"name": "Jonesboro-MI-1"
},
"description": "M+I Pump 1 for City of Jonesboro"
}
PumpUpdated Message Structure
Message Type |
Structure |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PumpUpdated |
|
Example PumpUpdated Message
{
"type": "pump_updated",
"pump_id": {
"office_id": "SWT",
"name": "Jonesboro-MI-1"
},
"description": "M+I Pump 1 for City of Jonesboro"
}
PumpDeleted Message Structure
Message Type |
Structure |
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
PumpDeleted |
|
Example PumpDeleted Message
{
"type": "pump_deleted",
"pump_id": {
"office_id": "SWT",
"name": "Jonesboro-MI-1"
}
}
Pumpages
Only values necessary to uniquely identify a pumpage (“type”, “pump_id”, “date_time”), and values required to mininimally describe a pumpuage (“flow”) are required for PumpageCreated and PumpageUpdated messages.
PumpageCreated Message Structure
Message Type |
Structure |
||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PumpageCreated |
|
Example PumpageCreated Message
{
"type": "pumpage_created",
"pump_id": {
"office_id": "SWT",
"name": "Jonesboro-MI-1"
},
"date_time": 1788971820000,
"flow": 64.3,
"flow_unit": "mgd",
"water_user": "City of Jonesboro",
"water_user_contract": "City of Jonesboro M & I",
"pumpage_type": "Pipeline",
"remarks": "Jonesboro M & I"
}
PumpageUpdated Message Structure
Message Type |
Structure |
||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PumpageUpdated |
|
Example PumpageUpdated Message
{
"type": "pumpage_updated",
"pump_id": {
"office_id": "SWT",
"name": "Jonesboro-MI-1"
},
"date_time": 1788971820000,
"flow": 64.3,
"flow_unit": "mgd",
"water_user": "City of Jonesboro",
"water_user_contract": "City of Jonesboro M & I",
"pumpage_type": "Pipeline",
"remarks": "Jonesboro M & I"
}
Only values necessary to uniquely identify a pumpage (“type”, “pump_id”, “date_time”) are required for PumpageDeleted messages.
PumpageDeleted Message Structure
Message Type |
Structure |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PumpageDeleted |
|
Example PumpageDeleted Message
{
"type": "pumpage_deleted",
"pump_id": {
"office_id": "SWT",
"name": "Jonesboro-MI-1"
},
"date_time": 1788971820000
}
Decision Status
Status: request for comments