Pipelines (Edge Server)¶
Create Edge Server Pipeline¶
- POST /_config/pipelines/edge-server/¶
Description This is used for creating a new edge pipeline.
HTTP Method POST
Endpoint:
/_config/pipelines/edge-server/
Request Header
Authorization
Basic <token>Request Parameters
Body Parameters
function_id
(string, conditionally required): ID of the function to which pipeline will be associated.plant_id
(string, conditionally required): ID of the plant to which pipeline will be associated.
Note
At least one of the above IDs must be provided.
pipeline_name
(string, required): The name of the pipeline.data_type
(string, required): The type of data the pipeline handles (Values: Condition, Process, Energy, Production, Others).data_source
(string, required): The source of the data (Values: Edge IOT Gateway, Third-Party-Apps, Cloud).data_source_subtype
(string, required): The subtype of the data source (Values: File, SQL, Modbus RTU, OPC-UA).settings
(object, required): Configuration settings for the pipeline.site_id
(string, optional): ID of the site to which pipeline will be associated.mac_address
(string, required): The MAC address of the device.gateway_firmware
(array of objects, required): Firmware versions associated with the pipeline.current_version
(string, optional): Current firmware version of the pipelineprevious_version
(string, optional): Previous firmware version of the pipeline
Additional parameters based on data_source_subtype:
If data_source_subtype is OPC-UA:
server_url
(string, required): The URL of the OPC UA server.user_name
(string, required): The username for authentication.user_password
(string, required): The password for authentication.
If data_source_subtype is File:
separator
(string, required): The separator used to delimit fields in the file(eg: CSV).rows_skipped
(string, required): The number of rows to skip at the beginning of the file.time_format
(string, required): The format of the timestamp in the file.ignore_fields
(array of strings, required): Fields to be ignored during processing.input_file
(string, required): Stores the input file along with its complete content for use and processing.file_name
(string, required): The name of the file to be monitored.file_path
(string, required): The path to the file.time_field
(string, required): The field containing timestamp information.
If data_source_subtype is Modbus RTU:
port
(string, required): The port used for data communication.stopbit
(integer, required): The number of stop bits.bytesize
(integer, required): The size of data bytes.parity
(string, required): The type of parity used for communication.baudrate
(integer, required): The baud rate for data transfer.sampling_rate
(integer, required): The rate at which data is sampled.collect_fft
(boolean, optional): Indicates whether the gateway collects the FFT data or not(Values: true,false).fft_intervel
(integer, optional): Specifies the time interval for collecting FFT data.fft_intervel_type
(string, optional): Specifies the time interval type for collecting FFT data(values : minutes or hours).
If data_source_subtype is SQL:
server_address
(string, required): The address of the SQL serverport
(integer, required): The port used for data communication.username
(string, required): Username to be used for server connection.password
(integer, required): Password of the user used for server connection.config
(object, required): Schema details for data collection.database
(string, required): Database to use for data collection.table
(string, required): Table to use for data collection.time_field
(string, required): Name of the column to be used as timestamp.time_field_format
(string, optional): Format of timestamp in data.last_collected
(string, required): Timestamp last collected (Should be None while creating a new gateway).ignore_type
(list, optional): Data types to ignore while data collection (Can be an empty list).ignore_columns
(list, optional): Columns to ignore while data collection (Can be an empty list).conditions
(list of objects, optional): Conditions for filtering data while collectionoperator
(string, optional): Operator to join the condtions (Values: OR, AND).
tags
(array of objects, required): Tags associated with the pipeline.tag_name
(string, required): The name of the tag.tag_desc
(string, required): Description of the tag.tag_unit
(string, required): The unit of measurement for the tag.If data_source_subtype is OPC-UA:
monitor_id
(string, required): The ID of the monitor associated with the tag.address
(string, required): The address of the tag.tag_id
(string, required): An identifier for the tag.
If data_source_subtype is File:
field_name
(string, required): The name of the field in the production data file.tag_id
(string, required): An identifier for the tag.moniter_id
(string, optional): The ID of the monitor associated with the tag.registered_by_asset
(boolean, optional): Indicates whether the tag is registered by an asset(value: true, false).asset_id
(string, optional): The ID of the asset associated with the tag.is_production
(boolean, optional): Indicates whether the tag is in production or not(value: true, false).This option appears in case data type is production.
If data_source_subtype is Modbus RTU:
address
(string, required): The address of the tag.decode_bits
(string, required): The number of bits used in the data decoding process(Values: 8, 16, 32, 64).decode_type
(string, required): The format of the data after decoding (Values: unsign_int, float, int).scale
(integer, required): The factor by which the decoded data value is multiplied for accurate representation.
If data_source_subtype is SQL:
column_name
(string, required): Name of the table column to use for mapping that tag.monitor_id
(string, required): Monitor_id to which the tag is attached
registration
(array of objects, optional): Registration details for monitors. Other attributes are:monitor_id
(string, required): The ID of the monitor associated with the tag.asset_id
(string, optional): The ID of the asset associated with the tag.asset_name
(string, optional): The name of the asset associated with the tag.slave_id
(string, required): The slave ID.address
(string, optional): The address for registration.registered_by_asset
(boolean, required): Indicates whether the tag is registered by an asset(Values: true, false).
function_enabled_in_registration
(boolean, optional): Indicates whetheror not to override gateway’s function so that we can assign slaves to different functions.
Sample Request
If data_source_subtype is Modbus RTU
curl --location 'https://app.4pointx.com/_config/pipelines/edge-server/' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <token>' \ --data '{ "pipeline_name":"test gateway 4sep", "site_id":"4230adcb-f349-4780-bf79-4a8c94a3b13b", "plant_id":"7a45d8e5-92d2-46a7-92d3-85aa4bd57bba", "function_id":"2136f450-1ab0-45ed-96fa-fec9c32da324", "data_type":"Condition","data_source":"Edge IoT Gateway", "data_source_subtype":"Modbus RTU", "gateway_firmware":{ "current_version": "1.0.43", "previous_version": "1.0.3" }, "settings":{"port":"/dev/ttymxc5", "stopbit":1, "bytesize":8, "parity":"N", "baudrate":9600, "mac_address":"asdaskj", "sampling_rate":1}, "tags":[ {"tag_name":"displacement_x","address":"a","tag_unit":"w","tag_desc":"",decode_bits:32,…}, {"tag_name":"displacement_y","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"displacement_z","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"velocity_x","address":"s","tag_unit":"w","tag_desc":"",decode_bits:32,…}, {"tag_name":"velocity_y","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"velocity_z","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"acceleration_x","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"acceleration_y","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"acceleration_z","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"total_acceleration","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"audio","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"temperature","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}], "registration":[ {"slave_id":"14", "function_id":"2136f450-1ab0-45ed-96fa-fec9c32da324", "function_name":"test_latest", "registered_by_asset":true, "asset_id":"129a22cb-7006-4260-a2d7-0d17d78e41bf", "asset_name":"trial2", "asset_options":[{"value":"129a22cb-7006-4260-a2d7-0d17d78e41bf","inputDisplay":"trial2"},{"value":"42039075-bc51-4153-b61a-8dfd9b22e4ee","inputDisplay":"trial3"},{"value":"eefbbde6-0ede-4117-b266-4af8640a4eff","inputDisplay":"trial3"},{"value":"ac1c9638-0633-445a-bb3b-5d292508528c","inputDisplay":"test_4"}],"monitor_id":"977db698-de2e-4094-b812-9767ee8089ca","monitor_name":"new_mon_2","monitor_options":[{"value":"977db698-de2e-4094-b812-9767ee8089ca","inputDisplay":"new_mon_2"}]}], "function_enabled_in_registration":false}'
If data_source_subtype is SQL (Only supports production data)
curl --location 'https://app.4pointx.com/_config/pipelines/edge-server/' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <token>' \ --data '{ "pipeline_name":"SQL Gateway", "site_id":"4230adcb-f349-4780-bf79-4a8c94a3b13b", "plant_id":"7a45d8e5-92d2-46a7-92d3-85aa4bd57bba", "function_id":"2136f450-1ab0-45ed-96fa-fec9c32da324", "data_type":"Production", "data_source":"Edge IoT Gateway", "data_source_subtype":"SQL", "gateway_firmware":{ "current_version": "1.0.43", "previous_version": "1.0.3" }, "settings": { "server_address": "127.0.0.1", "port": 3306, "username": "iot_gateway_user", "password": "S3cureP@ssw0rd!", "mac_address": "AA:BB:CC:DD:EE:FF", "config": { "database": "production_db", "table": "machine_metrics", "time_field": "event_timestamp", "time_field_format": "%Y-%m-%d %H:%M:%S", "last_collected": None, "ignore_type": ["varchar"], "ignore_columns": ["internal_id", "debug_flag"], "operator": "OR", "conditions": [ { "column_name": "temperature", "comparison": ">", "threshold": 75 }, { "column_name": "rpm", "comparison": ">=", "threshold": 1500 } ], "frequency": 6, "frequency_unit": "hours" } }, "tags": [ { "column_name": "temperature", "tag_name": "temp_c", "tag_unit": "°C", "tag_desc": "Equipment surface temperature", "monitor_id": "d78e9f0a-12b3-4c5d-8e6f-7g8h9i0j1k2l" }, { "column_name": "pressure", "tag_name": "press_bar", "tag_unit": "bar", "tag_desc": "Hydraulic system pressure", "monitor_id": "e90f1a2b-34c5-6d7e-8f9g-0h1i2j3k4l5m" }, { "column_name": "rpm", "tag_name": "rotational_speed", "tag_unit": "RPM", "tag_desc": "Motor rotational speed", "monitor_id": "f01a2b3c-45d6-7e8f-9g0h-1i2j3k4l5m6n" }, { "column_name": "machine_status", "tag_name": "status", "tag_unit": null, "tag_desc": "Operational status of the machine", "monitor_id": "g12b3c4d-56e7-8f9g-0h1i-2j3k4l5m6n7o" } ], "registration": [] }'
Sample Response
Success
{ "id": "e894a4da-469d-4261-954b-5a9151c096ad" }
Error
{ "error": { "status": 401, "message": "You do not have access to this module" } }
{ "error": { "status": 400, "message": "Invalid content type" } }
{ "error": { "status": 400, "message": "Insufficient inputs" } }
{ "error": { "status": 400, "message": "This MAC address is already registered with another gateway (ID: 4f08df91-d170-4dbb-8051-1b4487c26ace)" } }
{ "error": { "status": 400, "message": "Monitor already registered in another gateway" } }
{ "error": { "status": 400, "message": "Invalid input key" } }
{ "error": { "status": 400, "message": "Insufficient input: <key>" } }
{ "error": { "status": 400, "message": "Error creating gateway" } }
{ "error": { "status": 404, "message": "Invalid input registration" } }
{ "error": { "status": 400, "message": "SQL gateway only supports Production data type" } }
Delete Pipeline¶
- DELETE /_config/pipelines/edge-server/<pipeline_id>¶
Description Delete an edge pipeline.
HTTP Method DELETE
Endpoint
/_config/pipelines/edge-server/<pipeline_id>
Request Header
Authorization
Basic <token>Request Parameters
URL Parameters
pipeline_id
(string, required) The ID of the pipeline to be deleted.
Sample Request
curl --location --request DELETE 'https://app.4pointx.com/_config/pipelines/edge-server/e894a4da-469d-4261-954b-5a9151c096ad' \ --header 'Authorization: Basic <token>' \ --data ''
Sample Response
Success
"Gateway deleted successfully"
Error
{ "error": { "status": 401, "message": "You do not have access to this module" } }
{ "error": { "status": 400, "message": "Invalid Gateway ID: 12839-129837-4837-1289" } }
Update Pipeline¶
- PUT /_config/pipelines/edge-server/<pipeline_id>¶
Description Update an existing edge pipeline.
HTTP Method PUT
Endpoint
/_config/pipelines/edge-server/<pipeline_id>
Request Header
Authorization
Basic <token>Request Parameters
Body Parameters
function_id
(string, optional): ID of the function to which pipeline will be associated.plant_id
(string, optional): ID of the plant to which pipeline will be associated.pipeline_name
(string, required): The updated name of the pipeline.settings
(object, required): Configuration settings for the pipeline.mac_address
(string, required): The MAC address of the device.Additional parameters based on data_source_subtype:
If data_source_subtype is OPC-UA:
server_url
(string, required): The URL of the OPC UA server.user_name
(string, required): The username for authentication.user_password
(string, required): The password for authentication.
If data_source_subtype is File:
separator
(string, required): The separator used to delimit fields in the file(eg: CSV).rows_skipped
(string, required): The number of rows to skip at the beginning of the file.time_format
(string, required): The format of the timestamp in the file.ignore_fields
(array of strings, required): Fields to be ignored during processing.input_file
(string, required): Stores the input file along with its complete content for use and processing.file_name
(string, required): The name of the file to be monitored.file_path
(string, required): The path to the file.time_field
(string, required): The field containing timestamp information.
If data_source_subtype is Modbus RTU:
port
(string, required): The port used for data communication.stopbit
(integer, required): The number of stop bits.bytesize
(integer, required): The size of data bytes.parity
(string, required): The type of parity used for communication.baudrate
(integer, required): The baud rate for data transfer.sampling_rate
(integer, required): The rate at which data is sampled.collect_fft
(boolean, optional): Indicates whether the gateway collects the FFT data or not.(Values: true, false)fft_intervel
(integer, optional): Specifies the time interval for collecting FFT data .fft_intervel_type
(string, optional): Specifies the time interval type for collecting FFT data.(Values: minutes or hours)
If data_source_subtype is SQL:
server_address
(string, required): The address of the SQL serverport
(integer, required): The port used for data communication.username
(string, required): Username to be used for server connection.password
(integer, required): Password of the user used for server connection.config
(object, required): Schema details for data collection.database
(string, required): Database to use for data collection.table
(string, required): Table to use for data collection.time_field
(string, required): Name of the column to be used as timestamp.time_field_format
(string, optional): Format of timestamp in data.last_collected
(string, required): Timestamp last collected.ignore_type
(list, optional): Data types to ignore while data collection (Can be an empty list).ignore_columns
(list, optional): Columns to ignore while data collection (Can be an empty list).conditions
(list of objects, optional): Conditions for filtering data while collectionoperator
(string, optional): Operator to join the condtions (Values: OR, AND).
tags
(array of objects, required): Tags associated with the pipeline.tag_name
(string, required): The name of the tag.tag_desc
(string, required): Description of the tag.tag_unit
(string, required): The unit of measurement for the tag.If data_source_subtype is OPC-UA:
monitor_id
(string, required): The ID of the monitor associated with the tag.address
(string, required): The address of the tag.tag_id
(string, required): An identifier for the tag.
If data_source_subtype is File:
field_name
(string, required): The name of the field in the production data file.tag_id
(string, required): An identifier for the tag.moniter_id
(string, optional): The ID of the monitor associated with the tag.registered_by_asset
(boolean, optional): Indicates whether the tag is registered by an asset.(Values: true,false).asset_id
(string, optional): The ID of the asset associated with the tag.is_production
(boolean, optional): Indicates whether the tag is in production or not(value: true,false).This option appears in case data type is production.
If data_source_subtype is Modbus RTU:
address
(string, required): The address of the tag.decode_bits
(string, required): The number of bits used in the data decoding process(Values: 8, 16, 32, 64).decode_type
(string, required): The format of the data after decoding (Values: unsign_int, float, int).scale
(integer, required): The factor by which the decoded data value is multiplied for accurate representation.
If data_source_subtype is SQL:
registration
(array of objects, optional): Registration details for monitors. Other attributes are:monitor_id
(string, required): The ID of the monitor associated with the tag.asset_id
(string, optional): The ID of the asset associated with the tag.asset_name
(string, optional): The name of the asset associated with the tag.slave_id
(string, required): The slave ID.address
(string, optional): The address for registration.registered_by_asset
(boolean, required): Indicates whether the tag is registered by an asset.(Values: true, false)
Sample Request
If data_source_subtype is Modbus RTU
curl --location --request PUT 'https://app.4pointx.com/_config/pipelines/edge-server/e894a4da-469d-4261-954b-5a9151c096ad' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <token>' \ --data '{"pipeline_name":"mod test gateway 4sep", "site_id":"4230adcb-f349-4780-bf79-4a8c94a3b13b", "settings":{"port":"/dev/ttymxc5","stopbit":1,"bytesize":8,"parity":"N","baudrate":9600,"mac_address":"asdaskj","sampling_rate":1}, "tags":[{"tag_name":"displacement_x","address":"a","tag_unit":"w","tag_desc":"",decode_bits:32,…}, {"tag_name":"displacement_y","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"displacement_z","address":"a","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"velocity_x","address":"s","tag_unit":"w","tag_desc":"",decode_bits:32,…}, {"tag_name":"velocity_y","address":"s","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"velocity_z","address":"s","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"acceleration_x","address":"y","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"acceleration_y","address":"y","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"acceleration_z","address":"y","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"total_acceleration","address":"y","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"audio","address":"t","tag_unit":"","tag_desc":"",decode_bits:32,…}, {"tag_name":"temperature","address":"t","tag_unit":"","tag_desc":"",decode_bits:32,…}], "registration":[{"slave_id":"14","function_id":"2136f450-1ab0-45ed-96fa-fec9c32da324","registered_by_asset":true,"asset_id":"129a22cb-7006-4260-a2d7-0d17d78e41bf", "asset_options":[{"value":"129a22cb-7006-4260-a2d7-0d17d78e41bf","inputDisplay":"trial2"},{"value":"42039075-bc51-4153-b61a-8dfd9b22e4ee","inputDisplay":"trial3"},{"value":"eefbbde6-0ede-4117-b266-4af8640a4eff","inputDisplay":"trial3"},{"value":"ac1c9638-0633-445a-bb3b-5d292508528c","inputDisplay":"test_4"}], "monitor_id":"977db698-de2e-4094-b812-9767ee8089ca","monitor_name":"new_mon_2","monitor_options":[{"value":"977db698-de2e-4094-b812-9767ee8089ca","inputDisplay":"new_mon_2"}]}]}'
If data_source_subtype is SQL
curl --location --request PUT 'https://app.4pointx.com/_config/pipelines/edge-server/e894a4da-469d-4261-954b-5a9151c096ad' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <token>' \ --data '{"pipeline_name":"SQL Gateway", "site_id":"4230adcb-f349-4780-bf79-4a8c94a3b13b", "settings": { "server_address": "127.0.0.1", "port": 3306, "username": "iot_gateway_user", "password": "S3cureP@ssw0rd!", "mac_address": "AA:BB:CC:DD:EE:FF", "config": { "database": "production_db", "table": "machine_metrics", "time_field": "event_timestamp", "time_field_format": "%Y-%m-%d %H:%M:%S", "last_collected": "2025-06-10T10:00:00.000000", "ignore_type": ["str"], "ignore_columns": ["internal_id", "debug_flag"], "operator": "OR", "conditions": [ { "column_name": "temperature", "comparison": ">", "threshold": 75 }, { "column_name": "rpm", "comparison": ">=", "threshold": 1500 } ], "frequency": 6, "frequency_unit": "hours" } }, "tags": [ { "column_name": "temperature", "tag_name": "temp_c", "tag_unit": "°C", "tag_desc": "Equipment surface temperature", "monitor_id": "d78e9f0a-12b3-4c5d-8e6f-7g8h9i0j1k2l" }, { "column_name": "pressure", "tag_name": "press_bar", "tag_unit": "bar", "tag_desc": "Hydraulic system pressure", "monitor_id": "e90f1a2b-34c5-6d7e-8f9g-0h1i2j3k4l5m" }, { "column_name": "rpm", "tag_name": "rotational_speed", "tag_unit": "RPM", "tag_desc": "Motor rotational speed", "monitor_id": "f01a2b3c-45d6-7e8f-9g0h-1i2j3k4l5m6n" }, { "column_name": "machine_status", "tag_name": "status", "tag_unit": null, "tag_desc": "Operational status of the machine", "monitor_id": "g12b3c4d-56e7-8f9g-0h1i-2j3k4l5m6n7o" } ], "registration": []}'
Sample Response
Success
"Gateway updated successfully"
Error
{ "error": { "status": 401, "message": "You do not have access to this module" } }
{ "error": { "status": 400, "message": "Invalid content type" } }
{ "error": { "status": 400, "message": "Insufficient inputs" } }
{ "error": { "status": 400, "message": "This MAC address is already registered with another gateway(ID: 128937-2189379-12839-1928)" } }
{ "error": { "status": 400, "message": "Insufficient input: <key>" } }
{ "error": { "status": 400, "message": "Invalid input: {'port': '/dev/ttymxc5', 'stopbit': 1, 'bytesize': 22, 'parity': 'N', 'baudrate': 9600, 'mac_address': ''}" } }
{ "error": { "status": 400, "message": "Monitor already registered in another gateway" } }
Fetch Pipeline¶
- GET /_config/pipelines/edge-server/<pipeline_id>¶
Description Retrieve details of a specific edge pipeline.
HTTP Method GET
Endpoint
/_config/pipelines/edge-server/<pipeline_id>
Request Header
Authorization
Basic <token>Request Parameters
URL Parameters
pipeline_id
(string, required): The ID of the pipeline for which you want to retrieve details.
Sample Request
curl --location 'https://app.4pointx.com/_config/pipelines/edge-server/f944e82b-2c2d-4de7-b57d-1d293eabd785' \ --header 'Authorization: Basic <token>'
Sample Response
Success
{ "function_id": "e6f205ca-89a1-40dd-891e-3adc4d0f80d5", "plant_id": "55297f65-06a2-490e-bd34-464611ac10b0", "pipeline_id": "f944e82b-2c2d-4de7-b57d-1d293eabd785", "created_at": 1705904884634, "data_type": "Condition", "data_source": "Edge IoT Gateway", "pipeline_name": "a_demo", "gateway_firmware": { "current_version": "1.0.43", "previous_version": "1.0.9", "latest_version": "1.0.43" }, "status": "starting", "total_event_count": 0, "data_source_subtype": "Modbus RTU", "data_directory": "/home/debian/data", "site_id": "d2e66edd-f13f-4d00-a7b5-8cab9ef4488d", "settings": { "port": "/dev/ttymxc5", "stopbit": 1, "bytesize": 16, "parity": "N", "baudrate": 9600, "mac_address": "asdfkga", "sampling_rate": 4, "ip": "" }, "tags": [ { "address": "address1", "tag_name": "displacement_y", "tag_desc": "", "tag_unit": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 }, { "address": "address2", "tag_name": "displacement_z", "tag_desc": "", "tag_unit": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 }, { "address": "address3", "tag_name": "velocity_x", "tag_desc": "", "tag_unit": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 }, { "tag_unit": "", "address": "sadf", "tag_name": "velocity_x", "tag_desc": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 }, { "tag_unit": "", "address": "address4", "tag_name": "velocity_y", "tag_desc": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 }, { "tag_unit": "", "address": "address5", "tag_name": "velocity_z", "tag_desc": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 }, { "tag_unit": "", "address": "address6", "tag_name": "acceleration_x", "tag_desc": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 }, { "tag_unit": "", "address": "address7", "tag_name": "acceleration_y", "tag_desc": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 }, { "tag_unit": "", "address": "address8", "tag_name": "acceleration_z", "tag_desc": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 }, { "tag_unit": "", "address": "address9", "tag_name": "total_acceleration", "tag_desc": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 }, { "tag_unit": "", "address": "address10", "tag_name": "audio", "tag_desc": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 }, { "tag_unit": "", "address": "address11", "tag_name": "temperature", "tag_desc": "", "decode_bits": 32, "decode_type": "unsign_int", "scale": 1 } ], "registration": [ { "monitor_id": "5477c2a2-2ed3-459c-9a7b-8a14d623d41f", "slave_id": 14 } ], "watcher_id": "71fa5359-bbad-42db-816d-47a94d366461", "last_action": { "action_id": "555f645e-6152-44ff-b1f5-fa2b00627c96", "action": "start", "status": "in_progress", "issued_at": 1705911449386, "completed_at": null, "pipeline_id": "f944e82b-2c2d-4de7-b57d-1d293eabd785" } }
Error
{ "error": { "status": 401, "message": "You do not have access to this module" } }
{ "error": { "status": 400, "message": "Invalid Gateway ID: 128937-32948-217360-3476" } }
Handshake¶
- POST /_config/pipelines/edge-server/handshake/¶
Description Perform a handshake with the edge server to get connection information.
HTTP Method POST
Endpoint
/_config/pipelines/edge-server/handshake/
Request Header
Authorization
Basic <token>Request Parameters
Body Parameters
mac_ids
(string, required): A comma-separated list of MAC addresses for the devices. This is used to identify the pipelines associated with these devices.
Sample Request
curl --location 'https://app.4pointx.com/_config/pipelines/edge-server/handshake' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <token>' \ --data '{"mac_ids": ["00:11:22:33:44:55"]}'
Sample Response
Success
{ "kafka_username": "client", "kafka_password": "oLu7IjSPKaZrdbl1L2T89n6oaoHEfXk7", "pipeline_id": "b01eb8a0-1630-475d-9a47-1aa42c37748d", "nginx_token": "Basic Z2F0ZXdheTpablZlc1l6bXlHejJXcENVM2FkaHVDbkZPMmxnakVhZw==", "ca-certs": "-----BEGIN CERTIFICATE-----\nMIIE+........r3A=\n-----END CERTIFICATE-----\n", "timezone": "Asia/Kolkata" }
Error
{ "error": { "status": 400, "message": "No gateways found for MAC address: 00:11:22:33:44:55" } }
{ "error": { "status": 400, "message": "Invalid inputs" } }
Fetch Firmware¶
- GET /_config/pipelines/edge-server/_firmware¶
Description pipelines/edge-server/_firmware of assets based on various criteria such as function, asset category, and criticality.
HTTP Method GET
Endpoint
/_config/pipelines/edge-server/_firmware
Request Header
Authorization
Basic <token>Request Parameters
Query Parameters
pipeline_id
( string, required): The ID of the pipeline for which to retrieve firmware.version
(string, optional): The specific version of the firmware to retrieve.
Sample Request
curl --location 'https://app.4pointx.com/_config/pipelines/edge-server/_firmware?pipeline_id=4230adcb-f349-4780-bf79-4a8c94a3b13b' \ --header 'Authorization: Basic <token>'
Sample Response
Success
A downloadable firmware file.
Error
{ "error": { "status": 401, "message": "You do not have access to this module" } }
{ "error": { "status": 400, "message": "Excess inputs" } }
{ "error": { "status": 400, "message": "Insufficient inputs" } }
{ "error": { "status": 400, "message": "File <local_filename> not found. Please try again." } }
Update Pipeline Firmware Version¶
- PUT /_config/pipelines/edge-server/_firmware/¶
Description Updates gateway firmware of existing pipelines by modifying the version fields.
HTTP Method PUT
Endpoint
/_config/pipelines/edge-server/_firmware/
Request Header
Authorization
Basic <token>Request Parameters
Body Parameters
pipeline_ids
(list, required): List of pipeline ids to update firmware for.
Sample Request
Case 1: Updating firmware for a single pipeline
curl --location --request PUT 'https://app.4pointx.com/_config/pipelines/edge-server/_firmware/' \ --header 'Authorization: Basic <token>' \ --header 'Content-Type: application/json' \ --data '{ "pipeline_ids": [ "4230adcb-f349-4780-bf79-4a8c94a3b13b" ] }'
Case 2: Updating firmware for multiple pipelines
curl --location --request PUT 'https://app.4pointx.com/_config/pipelines/edge-server/_firmware/' \ --header 'Authorization: Basic <token>' \ --header 'Content-Type: application/json' \ --data '{ "pipeline_ids": [ "4230adcb-f349-4780-bf79-4a8c94a3b13b", "5e175ff8-6d1b-4092-ace1-e6eeb8535065", "33181bd7-f962-4a5b-9048-bb571cf8dc79" ] }'
Sample Response
Success
Case 1: Updating firmware for a single pipeline
"Gateway <gateway_name> updated successfully."
"Gateway <gateway_name> is already up to date."
Case 2: Updating firmware for multiple pipelines
{ "total_pipelines": 10, "updated": 9, "up_to_date": 1, "failed": 0 }
Error
Case 1: Updating firmware for a single pipeline
{ "error": { "status": 401, "message": "Unauthorized access to module by general-user" } }
{ "error": { "status": 400, "message": "Invalid content type" } }
{ "error": { "status": 404, "message": "File 4px_edge_firmware.tar.gz not found. Please try again." } }
{ "error": { "status": 400, "message": "Gateway <gateway_name> not found" } }
{ "error": { "status": 400, "message": "Error in bulk update" } }
Case 2: Updating firmware for multiple pipelines
{ "error": { "status": 401, "message": "Unauthorized access to module by general-user" } }
{ "error": { "status": 400, "message": "Invalid content type" } }
{ "error": { "status": 400, "message": "Invalid or missing pipeline_ids list" } }
{ "error": { "status": 400, "message": { "total_pipelines": 2, "updated": 0, "up_to_date": 0, "failed": 2, "error_message": [ "Gateway <gateway_name> not found", "Gateway <gateway_name> not found" ] } } }
{ "error": { "status": 400, "message": { "total_pipelines": 10, "updated": 0, "up_to_date": 0, "failed": 10, "error_message": [ "Error in bulk update" ] } } }