Сейчас еще раз обсудили вопрос с разработчиками. Действительно предложенный выше способ не работает, так как подключения можно только запросить с Сервера, но их изменение невозможно. Поэтому через LersFramework изменение подключений не предусмотрено.
В закрытой части REST API присутствует POST-запрос “/api/v0.1/Core/Equipment/{id}/Connections”, который задает экземпляру оборудования новый список подключений. Он имеет следующий формат:
формат запроса
{
"connections": [
{
"id": 0,
"commLinkType": "None",
"dialNumber": "string",
"connectionTimeout": 0,
"imitateModem": true,
"portSpeed": 0,
"flowControl": "None",
"protocol": 0,
"gprsCallType": "None",
"gprsAutoDisconnect": true,
"commDeviceEquipmentId": 0,
"commDevice": {
"id": 0,
"equipmentModelId": 0,
"serialNumber": "string",
"sealNumber": "string",
"lastCalibrationDate": "2025-08-25T00:09:05.525Z",
"scheduledCalibrationDate": "2025-08-25T00:09:05.525Z",
"calibrationResultId": "string",
"calibrationOrganization": "string",
"calibrationStateRegisterNumber": "string",
"calibrationResult": 0,
"calibrationSyncDate": "2025-08-25T00:09:05.525Z",
"noSyncCalibration": true,
"ignoreCalibrationNotification": true,
"equipmentModificationId": 0,
"password": "string",
"secondLevelPassword": "string",
"comment": "string",
"networkAddress": "string",
"pollSettings": {
"responseDelay": 0,
"protocolId": 0,
"adapterId": 0,
"adapterAddress": 0,
"connections": [
"string"
]
},
"modem": {
"identifier": "string",
"pollPortId": 0,
"imei": "string",
"isOnline": true,
"enableKeepAlive": true
},
"lastReadParameters": {
"hardwareVersion": "string",
"firmwareVersion": "string",
"timeDifference": 0,
"batteryLevel": 0,
"electricLoadState": "None",
"lastClockCorrectionDate": "2025-08-25T00:09:05.525Z",
"batteryLow": true,
"configDbReadDate": "2025-08-25T00:09:05.525Z"
},
"isShared": true,
"divisionId": 0,
"stateRegisterNumber": "string",
"signalDescriptions": [
{
"contactNumber": 31,
"title": "string",
"description": "string"
}
]
},
"commDeviceModel": {
"id": 0,
"customId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"isSystem": true,
"title": "string",
"reportTitle": "string",
"longTitle": "string",
"comment": "string",
"capabilities": "Other",
"serialNumberFormat": "string",
"serialNumberComment": "string",
"stateRegisterTypeTitle": "string",
"calibrationInterval": 0,
"isTemperatureSensor": true,
"isPressureSensor": true,
"isPressureDropSensor": true,
"isFlowSensor": true,
"isElectricMeter": true,
"phases": "None",
"isCurrentTransformer": true,
"isVoltageTransformer": true,
"supportedSystemTypes": "None",
"supportedCommLinks": "None",
"supportedCallTypes": "None",
"modemFeatures": "None",
"dryContactCount": 0,
"dataInterface": {
"equipmentModelId": 0,
"portSettings": "string",
"supportedPortSpeeds": "None",
"supportedFlowControls": "None",
"defaultPassword": "string",
"passwordRegEx": "string",
"passwordComment": "string",
"secondLevelPasswordComment": "string",
"maxNetworkSize": 0,
"networkAddressDefault": "string",
"networkAddressUsage": "None",
"networkAddressComment": "string",
"networkAddressRegEx": "string",
"networkAddressRangeMin": 0,
"networkAddressRangeMax": 0,
"features": "None",
"driver": {
"equipmentModelId": 0,
"driverName": "string",
"driverStatus": "InDevelopment",
"channelCount": 0,
"heatSystemCount": 0,
"minMemoryAddress": 0,
"maxMemoryAddress": 0,
"features": "None",
"supportedDataTypes": "None",
"totalsResetThresholdM": 0,
"totalsResetThresholdQ": 0,
"cells": [
{
"id": 0,
"name": "string",
"dataType": "None",
"equipmentModelId": 0,
"driverCode": "string"
}
],
"adapters": [
{
"id": 0,
"equipmentModelId": 0,
"title": "string",
"isAddressRequired": true
}
],
"protocols": [
{
"id": 0,
"number": 0,
"title": "string",
"equipmentModelId": 0
}
],
"configParams": [
{
"id": 0,
"title": "string",
"comment": "string",
"dataType": "string",
"generalParamType": "None",
"heatLeadInNum": 0,
"channelNum": 0,
"equipmentModelId": 0,
"readAddress": 0,
"readDataType": 0,
"driverCode": "string"
}
]
},
"supportedParity": "None",
"supportedStopBits": "None",
"supportedDataBits": "None"
},
"modifications": [
{
"id": 0,
"equipmentModelId": 0,
"isSystem": true,
"comment": "string",
"precisionClass": "stri",
"nominalDiameter": 0,
"relativeError": 0,
"tempSensorMin": 0,
"tempSensorMax": 0,
"pressSensorMin": 0,
"pressSensorMax": 0,
"flowSensorMin": 0,
"flowSensorMax": 0,
"measureLength": 0,
"nominalStaticCharacteristic": "string",
"transformationRatio": 0,
"pressDropSensorMin": 0,
"pressDropSensorMax": 0,
"title": "string"
}
],
"ports": [
{
"id": 0,
"title": "string",
"settings": [
{
"id": 0,
"title": "string"
}
]
}
],
"stateRegisterNumbers": [
{
"number": "string",
"calibrationInterval": 0
}
],
"customAttributeValues": [
{
"id": 0,
"customAttributeId": 0,
"equipmentModelId": 0,
"value": "string"
}
],
"universalDriver": "None"
},
"commDevicePortId": 0,
"commDevicePortSettingsId": 0,
"pollPortId": 0,
"pollPortGroupId": 0,
"pollPortGroupTitle": "string",
"isNetwork": true,
"title": "string",
"internetHost": "string",
"internetPort": 0,
"equipmentIdList": [
0
],
"parity": "None",
"stopBits": "None",
"dataBits": "None",
"gprsCallSmsText": "string",
"integrationParametersId": 0,
"integrationParameters": {
"id": 0,
"integrationTypeId": 2147483647,
"integrationType": {
"id": 0,
"customId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"pluginId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"requiresPort": true,
"isWebhook": true,
"requireEquipmentModelInUrl": true,
"docsUrl": "string",
"features": {
"supportsTestConnection": true
},
"configForm": {
"fields": [
{
"name": "string",
"title": "string",
"hint": "string",
"editor": {
"type": "Text",
"regex": "string"
},
"required": true,
"visible": true,
"defaultValue": "string"
}
]
},
"connectionConfigForm": {
"fields": [
{
"name": "string",
"title": "string",
"hint": "string",
"editor": {
"type": "Text",
"regex": "string"
},
"required": true,
"visible": true,
"defaultValue": "string"
}
]
}
},
"title": "string",
"address": "string",
"login": "string",
"accessToken": "string"
}
}
],
"movedConnections": [
{
"sourceNodeId": 0,
"connectionId": 0
}
]
}
Вы можете через запрос “/api/v1/Core/Equipment/{id}” открытой части REST API получить весь список подключений оборудования, изменить/задать в нужных GSM-подключений этого списка идентификатор группы, после чего через вышеописанный запрос закрытой части API задать этому оборудованию весь этот список еще раз.