Skip to main content

Interaction with Storages in DMS via NBI

General Information​

All storages in DMS support interaction through NBI (Northbound Interface). This allows managing stored objects using the REST API. Each storage service is represented as a table in the database.

List of Storages:​

AuthStorage

A service for storing user accounts in RDBMS. It interacts with authservice and is used by the administrative portal for user management.

CampaignResultStorage

A service for storing campaign execution results. The history processor writes data to it, and the administrative portal uses it for display.

CampaignStorage

This is a storage service that stores Campaign objects in the RDBMS. It is accessed by Admin Portal to manage campaigns and by Campaign services to get the current list of campaigns.

ConfigTemplateStorage

Configuration File Storage Service.

CpeDbService

A service for storing CPE objects. It is used by most services for searching, updating, and storing information about CPE devices registered in the DMS system.

FirmwareResultStorage

A service for storing firmware update results.

FirmwareStorage

A service for storing firmware update rules in an embedded RDBMS.

ScenarioHistoryStorage

A service for storing scenario result objects initiated by DMS and completed on a CPE device.

Important Note: The list of available storage services depends on the installed configuration, so there may be differences from the documentation.

Interaction Methods​

For all storages, the interaction methods are identical:

nbi_methods

Retrieve Object Count

GET /count.* Returns the number of objects in the storage.

Delete a Group of Objects by Criteria

POST /delete_objects Deletes a group of objects based on flexible criteria.

Delete a Group of Objects by Primary Key

POST /delete_objects_by_id Deletes a group of objects based on primary key values.

Note: This method only supports working with primary parameters.

Delete an Object by Identifier

DELETE / Deletes an object from storage.

Retrieve an Object from Storage

GET / Returns an object from storage.

Retrieve Object Deletion History

GET /history Returns deletion history records with optional filtering. The method is available only when history tracking is enabled for the storage.

Retrieve Selected Object Fields

POST /partial Returns only the requested fields of objects that match the specified search criteria. The request body can also define sorting, pagination, and the streaming export format.

Update Selected Object Fields

PATCH /partial Updates only the specified fields of an object selected by a key.

Search Objects Using Advanced Criteria

POST /search Returns objects matching nested AND/OR conditions and supports streaming export of all matching records.

Modify an Object by Primary Key

PUT / Modifies an object in the database by identifier.

Add/Modify an Object

POST / Adds or modifies an object in the database.

Add Multiple Objects

POST /bulk_insert Allows multiple objects to be added to the database in a single request.

Streaming Table Export​

The GET /, POST /partial, and POST /search methods support streaming table export in JSON or CSV format. During streaming export, rows are read from the database and immediately written to the response without loading the complete result set into the storage service memory. This mode is intended for exporting large tables.

Set the response_content_type query parameter to select the export format:

  • response_content_type=json — returns {"status":"success","data":[...]};
  • response_content_type=csv — returns a CSV file with a header row and ; as the field delimiter.

For CSV export, the Accept: text/csv header can be used instead of the query parameter. The response includes a Content-Disposition header with a generated filename.

If an export format is not explicitly selected, the method returns the regular NBI response.

To view them, click on the method tab, and a window will open displaying the available parameters for this method and this storage:

nbi_params

Restricting Access to a Storage​

By default, any authenticated user can interact with a storage through the dynamic NBI (/v1/dyn/<StorageName>). Access to a whole storage — or to specific methods of it — can be limited to selected user roles by configuring URL rules on the authservice, the service that handles authentication and authorization for the NBI API and GUI.

Access rules are defined on the authservice through the indexed RX.url_rules environment variable. Each rule consists of two fields:

  • prefix — a matcher for the request URL. A value that starts with ~ is treated as a regular expression; otherwise it is matched as a plain URL prefix.
  • filter — a JSON array of role names that are allowed to reach the matching URL. A request whose user does not have at least one of the listed roles is rejected.

Rules are numbered (.0, .1, .2, …). The number only groups the prefix and filter of the same rule together, so both lines of one rule must share the same index.

Example. The following rule, added to the authservice configuration, restricts every request to UserStorage (GET /, POST /, PUT /, DELETE /, GET /count.*, POST /delete_objects, etc.) so that only users with the Admin role may access it:

- 'RX.url_rules.4.prefix=json:"~(.*/)?v1/dyn/UserStorage(/.*)?$"'
- 'RX.url_rules.4.filter=json:["Admin"]'

The regular expression (.*/)?v1/dyn/UserStorage(/.*)?$ matches the storage root and any of its sub-paths, so all interaction methods of the storage are covered by a single rule. Replace UserStorage with the name of the storage you want to protect, and ["Admin"] with the list of roles that should keep access. To restrict only one method instead of the whole storage, narrow the regular expression accordingly (for example, .../UserStorage/delete_objects$).

Note: A user's roles are taken from the roles field of the corresponding AuthStorage record (see AuthStorage). A request made by a user that has none of the permitted roles receives a 403 Forbidden response.

Storage-Specific Parameters​

AuthStorage​

ParameterPrimary parameterTypeDescription
id✅stringUnique identifier of the user
usernamestringName of the user
passwordstringPassword of the user
claimsjsonReserved field for user description
rolesstringPermission identifiers that define access to different parts of the platform
access_pathstringUser group name to restrict interaction to specific CPEs, if the corresponding CPE object has the field set
create_record_tsintegerTime of user creation
tsintegerTime of the last update to the user record
authorstringName of the author who created the user record
editorstringName of the last user who edited the user record

Interaction with this table is also possible through the UI in the Admin Portal (Refer to the Users).

CampaignResultStorage​

ParameterPrimary parameterTypeDescription
id✅stringUnique identifier of the campaign result record
exit_codeintegerCampaign exit code
campaignidstringUnique campaign identifier
tsintegerCampaign execution time
cpeidstringUnique CPE identifier
resultjsonCampaign execution result

Interaction with this table is also possible through the UI in the Admin Portal (Refer to the Campaigns Results).

CampaignStorage​

ParameterPrimary parameterTypeDescription
enabledbooleanCampaign status (Enabled/Disabled) (True/False)
activebooleanWhether to initiate a CPE session by sending a connection request (True/False)
id✅stringUnique campaign identifier
namestringCampaign name
conditionjsonSelection criteria for CPE devices to which the campaign applies
eventslistCPE filter for the campaign based on session event. An empty value means "all"
methodstringScenario that will be called as part of the campaign
argsjsonList of parameters to be passed as input arguments for the scenario executing
executionsintegerNumber of executions on each CPE device
cronstringCron expression describing the campaign execution schedule (see example below)
periodintegerCampaign activation interval in seconds
batchintegerNumber of CPE devices executed in parallel per activation period
priorityintegerPriority determines the execution order of the campaign on CPE. A lower value means a higher priority
create_record_tsintegerTime of campaign creation
tsintegerTime of the last update to the campaign
authorstringName of the campaign author
editorstringName of the last user who edited the campaign
start_timedatetimeCampaign start time. If not specified, the campaign starts at the current time
end_timedatetimeCampaign end time. An empty value means that the campaign runs indefinitely

Interaction with this table is also possible through the UI in the Admin Portal (Refer to the Campaigns).

ConfigTemplateStorage​

ParameterPrimary parameterTypeDescription
id✅stringUnique configuration template identifier
namestringConfiguration template name
pathstringConfiguration location
parentstringTemplate location hierarchy
versionstringConfiguration version
enablebooleanConfiguration template status
vendorstringCPE device manufacturer
modelstringCPE device model
hvstringCPE device hardware version
svstringCPE device software version
content_typestringConfiguration type (Text/Binary)
contentblobConfiguration content
createdintegerConfiguration template creation time
editedintegerLast configuration template update time
authorstringConfiguration template author
editorstringLast person who edited the configuration template

CpeDbService​

ParameterPrimary parameterTypeDescription
stateintegerCPE device status (see the table below)
cpeid✅stringUnique identifier for the CPE device
typestringCPE device protocol version
locationstringCPE device location (see the section Setting Set up CPE location)
access_pathstringIdentifier that restricts access to the CPE for users not part of the allowed group
datamodelstringData model of the CPE device (TR098/TR181)
vendorstringCPE device manufacturer
modelstringCPE device model
macstringMAC address of the CPE device
pcstringProduct class of the CPE device
hwstringHardware version of the CPE device
swstringSoftware version of the CPE device
ipstringIP address of the CPE device
ip2stringSecondary IP address of the CPE device
ip3stringTertiary IP address of the CPE device
upstreamstringSerial number of the device at a higher hierarchy level in the network structure
protocolstringProtocol of the CPE device
firstseenintegerTime of the first interaction of the CPE device with the ACS
lastseenintegerTime of the last interaction of the CPE device with the ACS
tsintegerTime of the last record update
paramsjsonCached "name-value" pairs of parameters from the CPE device data model
customparamsjsonCustom parameters associated with the CPE device
eventsjsonList of protocol and system events from the last CPE device session
infostringReserved field for user information about the CPE device
tagslistReserved field for tagging the CPE device
customtagslistReserved field for custom tagging of the CPE device
cpe_classeslistReserved field for CPE device classes
cidstringCustom identifier for the CPE device
cid2stringSecondary custom identifier for the CPE device
cid3stringTertiary custom identifier for the CPE device
imsistringIMSI identifier for the CPE device
imeistringIMEI identifier for the CPE device
msisdnstringMSISDN identifier for the CPE device

Interaction with this table is also possible through the UI in the Admin Portal (Refer to the CPE Device).

CPE Device Status Table​

ValueDescription
0Information received
1Connection request sent
2CPE initialization
3New CPE
4Waiting for CPE session
5CPE unavailable (missed periodic inform interval)
6CPE unavailable (CNR timeout)
7CPE error
8Software update
9CPE reboot
10Unauthenticated request

FirmwareResultStorage​

ParameterPrimary parameterTypeDescription
id✅stringUnique identifier of the firmware update result record
statusbooleanStatus of the firmware update procedure
tsintegerTime of the firmware update procedure execution
cpeidstringUnique identifier of the CPE device
rule_descriptionstringDescription of the firmware update rule
campaignidstringUnique identifier of the firmware update rule
resultjsonResult of the firmware update procedure

Interaction with this table is also possible through the UI in the Admin Portal (Refer to the Upgrade Results).

FirmwareStorage​

ParameterPrimary parameterTypeDescription
id✅stringUnique identifier of the firmware update rule record
enabledbooleanStatus of the firmware update rule (Enabled/Disabled)
automaticbooleanTo activate the firmware update rule, enable this option. If enabled, any CPE device that connects to the ACS and matches the update rule will be updated
descriptionstringDescription of the firmware update rule
filestringLink to the firmware (only the file name for firmware files uploaded to the ACS file server, or the full URL for software files hosted on an external file server)
create_record_tsintegerRecord creation time
tsintegerTime of the last update
conditionjsonCPE criteria (condition for applying the firmware rule)
executionsintegerNumber of executions on each CPE device
priorityintegerPriority of the rule (a higher number indicates a higher priority)
authorstringName of the author of the firmware record
editorstringName of the last editor of the firmware record

Interaction with this table is also possible through the UI in the Admin Portal (Refer to the Firmwares).

ScenarioHistoryStorage​

ParameterPrimary parameterTypeDescription
id✅stringUnique identifier of the scenario execution record
exit_codeintegerExit code of the scenario execution
tsintegerRecord creation time
start_tsintegerTime when the scenario execution was initiated
end_tsintegerTime when the scenario execution was completed
cpeidstringUnique identifier of the CPE device
scenariostringName of the scenario
initargsjsonList of parameters passed as input arguments for scenario execution
resultjsonScenario execution result
authorstringUser or service that initiated the scenario execution

Interaction with this table is also possible through the UI in the Admin Portal (Refer to the Scenario History).

Campaign Storage Usage Example​

Examples of interaction are provided for the Campaign Storage service; for other storage services, the interaction is carried out in the same manner.

GET /count.*​

Request:

curl -X 'GET' \
'http://127.0.0.1/v1/dyn/CampaignStorage/count.*?author=admin' \
-H 'accept: application/json'

Response:

{
"code": 200,
"message": "response from CampaignStorage",
"details": 2
}

POST /delete_objects​

Request:

curl -X 'POST' \
'http://127.0.0.1/v1/dyn/CampaignStorage/delete_objects' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"conditions": {
"period": "120"
},
"batch_size": 10000,
"return_deleted_records": true,
"return_fields_of_deleted_records": []
}'

Response:

{
"code": 200,
"message": "response from CampaignStorage",
"details": {
"data": {
"deleted_objects_number": 2,
"deleted_records": [
{
"id": "",
"enabled": false,
"active": true,
"name": "Get GPV",
"condition": {
"cpeid": "DMS*"
},
"events": [
"2 PERIODIC"
],
"method": "CWMP.GetParameterValues",
"args": [
"InternetGatewayDevice.ManagementServer."
],
"executions": 1,
"cron": "",
"period": 120,
"batch": 100,
"priority": 2,
"create_record_ts": 0,
"ts": 0,
"author": "operator",
"editor": ""
},
{
"id": "30ca067a-0126-47cf-884b-3796b6eed02c",
"enabled": false,
"active": false,
"name": "GET GPN",
"condition": {
"cpeid": "DMS*"
},
"events": [
"0 BOOTSTRAP"
],
"method": "CWMP.GetParameterValues",
"args": [
"InternetGatewayDevice.ManagementServer."
],
"executions": 1,
"cron": "* * * * *",
"period": 120,
"batch": 100,
"priority": 2,
"create_record_ts": 1742377312,
"ts": 1742378123,
"author": "operator",
"editor": "operator"
}
]
},
"detail": "objects deleted successfully",
"code": 200
}
}

POST /delete_objects_by_id​

Request:

curl -X 'POST' \
'http://127.0.0.1/v1/dyn/CampaignStorage/delete_objects_by_id' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"pr_key_column": "id",
"pr_key_values": [
"54ab83b7-185c-48e7-ab9c-b63b101712c4",
"9d7aee15-7a27-46af-8c0d-fde567f41b09",
"f2be7d50-84c4-4ff4-95d9-695c7b4c8a49"
],
"batch_size": 10000,
"return_deleted_records": true,
"return_fields_of_deleted_records": []
}'

Response:

{
"code": 200,
"message": "response from CampaignStorage",
"details": {
"data": {
"deleted_objects_number": 3,
"failed_delete_objects_number": 0,
"deleted_records": [
{
"enabled": false,
"active": true,
"id": "f2be7d50-84c4-4ff4-95d9-695c7b4c8a49",
"name": "Get GPV4",
"condition": {
"cpeid": "DMS*"
},
"events": [
"2 PERIODIC"
],
"method": "CWMP.GetParameterValues",
"args": [
"InternetGatewayDevice.ManagementServer."
],
"executions": 1,
"cron": "",
"period": 120,
"batch": 100,
"priority": 2,
"create_record_ts": 1742381747,
"ts": 1742381747,
"author": "operator",
"editor": ""
},
{
"enabled": false,
"active": true,
"id": "54ab83b7-185c-48e7-ab9c-b63b101712c4",
"name": "Get GPV6",
"condition": {
"cpeid": "DMS*"
},
"events": [
"2 PERIODIC"
],
"method": "CWMP.GetParameterValues",
"args": [
"InternetGatewayDevice.ManagementServer."
],
"executions": 1,
"cron": "",
"period": 120,
"batch": 100,
"priority": 2,
"create_record_ts": 1742381753,
"ts": 1742381753,
"author": "operator",
"editor": ""
},
{
"enabled": false,
"active": true,
"id": "9d7aee15-7a27-46af-8c0d-fde567f41b09",
"name": "Get GPV7",
"condition": {
"cpeid": "DMS*"
},
"events": [
"2 PERIODIC"
],
"method": "CWMP.GetParameterValues",
"args": [
"InternetGatewayDevice.ManagementServer."
],
"executions": 1,
"cron": "",
"period": 120,
"batch": 100,
"priority": 2,
"create_record_ts": 1742381757,
"ts": 1742381757,
"author": "operator",
"editor": ""
}
]
},
"message": "objects deleted successfully",
"code": 200
}
}

DELETE /​

Request:

curl -X 'DELETE' \
'http://127.0.0.1/v1/dyn/CampaignStorage/?id=a715cc01-4679-4e6e-9146-71eeee0713f2' \
-H 'accept: application/json'

Response:

{
"code": 204,
"message": "response from CampaignStorage",
"details": ""
}

GET /​

Request:

curl -X 'GET' \
'http://127.0.0.1/v1/dyn/CampaignStorage/?limit=10000&author=admin' \
-H 'accept: application/json'

Response:

{
"code": 200,
"message": "response from CampaignStorage",
"details": [
{
"enabled": true,
"active": true,
"id": "de352cab-068b-4632-a4ec-4d2752ec2ea4",
"name": "Get GPV",
"condition": {},
"events": [],
"method": "CWMP.GetParameterNames",
"args": {
"NextLevel": true,
"ParameterPath": "InternetGatewayDevice."
},
"executions": 1,
"cron": "* * * * *",
"period": 60,
"batch": 100,
"priority": 5,
"create_record_ts": 1742374787,
"ts": 1742374787,
"author": "admin",
"editor": ""
},
{
"enabled": false,
"active": true,
"id": "8409b4f2-e818-4053-8e6b-8c75f82ef299",
"name": "Activate WIFI",
"condition": {},
"events": [
"2 PERIODIC"
],
"method": "Campaigns.ActivateWiFi",
"args": {},
"executions": 1,
"cron": "* * * * *",
"period": 60,
"batch": 100,
"priority": 5,
"create_record_ts": 1742374680,
"ts": 1742374805,
"author": "admin",
"editor": "admin"
}
]
}

CSV streaming export:

curl -OJ -X 'GET' \
'http://127.0.0.1/v1/dyn/CampaignStorage/?limit=10000&author=admin&response_content_type=csv' \
-H 'accept: */*'

JSON streaming export:

curl -OJ -X 'GET' \
'http://127.0.0.1/v1/dyn/CampaignStorage/?limit=10000&author=admin&response_content_type=json' \
-H 'accept: */*'

GET /history​

The method retrieves deleted-object history records. It is available only when HISTORY_ENABLED is set for the storage. Records can be filtered by the primary key (id for CampaignStorage), author, action, and the ts_from/ts_to Unix timestamp range. The action parameter currently supports only DELETE. Use limit and offset for pagination.

Request:

curl -X 'GET' \
'http://127.0.0.1/v1/dyn/CampaignStorage/history?author=admin&action=DELETE&limit=10&offset=0' \
-H 'accept: */*'

Response:

{
"code": 200,
"message": "response from CampaignStorage",
"details": [
{
"action": "DELETE",
"author": "admin",
"data": {
"active": false,
"args": {},
"author": "admin",
"batch": 100,
"condition": {},
"create_record_ts": "2026-11-09T09:25:35.425455Z",
"cron": "",
"editor": "",
"enabled": false,
"end_time": null,
"events": [],
"executions": 0,
"id": "f98236d9-f5c4-40d8-85ae-33cc8104ce8a",
"method": "RPC.CWMP.AddObject",
"name": "Create management object",
"period": 60,
"priority": 5,
"start_time": "2026-11-09T09:25:35.338654Z",
"ts": "2026-11-09T09:25:35.425455Z"
},
"id": "f98236d9-f5c4-40d8-85ae-33cc8104ce8a",
"ts": 1794216339
},
{
"action": "DELETE",
"author": "admin",
"data": {
"active": false,
"args": {},
"author": "admin",
"batch": 100,
"condition": {
"cpeid": "DMS_DEVICE"
},
"create_record_ts": "2026-11-02T18:36:05.144488Z",
"cron": "",
"editor": "",
"enabled": true,
"end_time": null,
"events": [],
"executions": 0,
"id": "64e203a1-e505-4b46-82ca-7ad6fd16d453",
"method": "RPC.CWMP.GetRPCMethods",
"name": "Collect supported RPC methods",
"period": 60,
"priority": 5,
"start_time": "2026-11-02T18:36:05.089698Z",
"ts": "2026-11-02T18:36:05.144488Z"
},
"id": "64e203a1-e505-4b46-82ca-7ad6fd16d453",
"ts": 1794216265
}
]
}

PUT /​

Request:

curl -X 'PUT' \
'http://127.0.0.1/v1/dyn/CampaignStorage/?id=30ca067a-0126-47cf-884b-3796b6eed02c' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"enabled": false,
"active": false,
"id": "30ca067a-0126-47cf-884b-3796b6eed02c",
"name": "GET GPN",
"condition": {
"cpeid": "DMS*"
},
"events": [
"0 BOOTSTRAP"
],
"method": "CWMP.GetParameterValues",
"args": [
"InternetGatewayDevice.ManagementServer."
],
"executions": 1,
"cron": "* * * * *",
"period": 120,
"batch": 100,
"priority": 2,
"author": "operator",
"editor": "operator"
}'

Response:

{
"code": 204,
"message": "response from CampaignStorage",
"details": ""
}

POST /​

Request:

url -X 'POST' \
'http://127.0.0.1/v1/dyn/CampaignStorage/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"enabled": false,
"active": true,
"id": "1560ed5c-172e-4b93-91cf-ba0d4708d997",
"name": "Get GPV",
"condition": {
"cpeid": "DMS*"
},
"events": [
"2 PERIODIC"
],
"method": "CWMP.GetParameterValues",
"args": [
"InternetGatewayDevice.ManagementServer."
],
"executions": 1,
"cron": "",
"period": 120,
"batch": 100,
"priority": 2,
"create_record_ts": 1742374680,
"ts": 1742374680,
"author": "operator",
"editor": ""
}'


Note: If the request does not contain the fields "id", "create_record_ts", and "ts", their values will be generated automatically.

Response:

{
"code": 204,
"message": "response from CampaignStorage",
"details": ""
}

POST /bulk_insert​

The method allows multiple objects to be added to the database in a single request. The data array contains the objects to insert. The optional timeout parameter defines the operation timeout in seconds and defaults to 600. If an object does not contain the field used as the primary key by the selected storage, the service automatically generates a UUID.

Request:

curl -X 'POST' \
'http://127.0.0.1/v1/dyn/CampaignStorage/bulk_insert' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"data": [
{
"id": "88242bad-e095-49be-a94c-000000000003",
"enabled": true,
"active": false,
"name": "Collect device information",
"condition": {"cpeid": "DMS*"},
"events": ["2 PERIODIC"],
"method": "RPC.CWMP.GetParameterValues",
"args": ["Device.DeviceInfo."],
"executions": 1,
"period": 3600,
"batch": 100,
"priority": 5
},
{
"id": "88242bad-e095-49be-a94c-000000000004",
"enabled": true,
"active": false,
"name": "Collect supported RPC methods",
"condition": {"cpeid": "DMS*"},
"events": ["0 BOOTSTRAP"],
"method": "RPC.CWMP.GetRPCMethods",
"args": {},
"executions": 1,
"period": 3600,
"batch": 100,
"priority": 5
}
],
"timeout": 600
}'

Response:

{
"code": 204,
"message": "response from CampaignStorage"
}

If the same request is repeated, the objects are not modified and are returned in already_existing_rows:

{
"code": 202,
"message": "response from CampaignStorage",
"details": {
"data": {
"already_existing_rows": [
{
"active": 0,
"args": "[\"Device.DeviceInfo.\"]",
"batch": 100,
"condition": "{\"cpeid\":\"DMS*\"}",
"enabled": 1,
"events": "2 PERIODIC",
"executions": 1,
"id": "88242bad-e095-49be-a94c-000000000003",
"method": "RPC.CWMP.GetParameterValues",
"name": "Collect device information",
"period": 3600,
"priority": 5,
"start_time": "2026-11-09T11:09:08.786902504Z"
},
{
"active": 0,
"args": "{}",
"batch": 100,
"condition": "{\"cpeid\":\"DMS*\"}",
"enabled": 1,
"events": "0 BOOTSTRAP",
"executions": 1,
"id": "88242bad-e095-49be-a94c-000000000004",
"method": "RPC.CWMP.GetRPCMethods",
"name": "Collect supported RPC methods",
"period": 3600,
"priority": 5,
"start_time": "2026-11-09T11:09:08.786984665Z"
}
],
"unprocessed_elements": null
}
}
}

If some objects cannot be inserted or already exist, the response identifies them in unprocessed_elements or already_existing_rows.

POST / with return_fields parameter​

The optional query parameter return_fields allows you to retrieve the specified fields of the created object directly in the POST response. Instead of the standard 204 response, the service will return 200 with the requested fields in details.

Note: The return_fields parameter is supported for POST only. PUT requests always return 204.

Request:

curl -X 'POST' \
'http://127.0.0.1/v1/dyn/CampaignStorage/?return_fields=id,name,author' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"enabled": false,
"active": true,
"name": "Get GPV",
"condition": {
"cpeid": "DMS*"
},
"events": [
"2 PERIODIC"
],
"method": "CWMP.GetParameterValues",
"args": [
"InternetGatewayDevice.ManagementServer."
],
"executions": 1,
"period": 120,
"batch": 100,
"priority": 2,
"author": "operator"
}'

Response:

{
"code": 200,
"message": "response from CampaignStorage",
"details": {
"id": "1560ed5c-172e-4b93-91cf-ba0d4708d997",
"name": "Get GPV",
"author": "operator"
}
}

If return_fields contains a non-existent field, the service will return 400:

{
"code": 400,
"message": "response from CampaignStorage",
"details": {
"code": 400,
"message": "Invalid fields in return_fields: nonexistent_field"
}
}

POST /partial​

The method retrieves only selected fields from storage objects. It is useful when a client does not need complete objects or when a table must be exported with a limited set of columns.

Request:

curl -X 'POST' \
'http://127.0.0.1/v1/dyn/CampaignStorage/partial' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"columns": ["enabled", "active", "id"],
"search_params": {},
"sort": ["!id"],
"limit": 10000,
"offset": 0
}'

Response:

{
"code": 200,
"message": "response from CampaignStorage",
"details": [
{
"active": false,
"enabled": true,
"id": "d8cad319-825b-4e8c-a21d-12adf24a0047"
},
{
"active": false,
"enabled": false,
"id": "13a08df0-86fa-43b1-a992-55a8d7436802"
}
]
}

The response contains only the enabled, active, and id fields of the matching objects.

To download the same selection using streaming export, add "response_content_type": "json" or "response_content_type": "csv" to the request body. For CSV, the Accept: text/csv header can be used instead. See Streaming Table Export.

PATCH /partial​

The method updates only the fields specified in update. The key object identifies the campaign and contains the field name in name and its value in value.

Request:

curl -X 'PATCH' \
'http://127.0.0.1/v1/dyn/CampaignStorage/partial' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"key": {
"name": "id",
"value": "88242bad-e095-49be-a94c-000000000001"
},
"update": {
"enabled": false,
"priority": 10
}
}'

If the update is successful, the method returns 204 No Content.

POST /search​

The method searches for objects using nested AND/OR conditions.

The advanced_query parameter defines a tree consisting of groups and conditions:

  • A group has the form {"kind":"group","connector":"AND|OR","children":[...]}. Each group can contain up to 10 child nodes, and the maximum nesting depth is 10.
  • A condition has the form {"kind":"cond","field":"<name>","op":"<operator>","value":...}. A query can contain up to 100 conditions.
  • Nested JSON fields are addressed using the field$$key$$subkey syntax.

The optional search_params object adds equality filters in the same way as POST /partial. The pagination_size and pagination_index parameters define the page size and page number for a regular response. The sort_column value must be a data-model field; nested JSON fields can use the field$$key syntax. The sort_direction parameter accepts asc or desc and defaults to asc.

Supported values of op:

opOperation
equalsEqual
not equalsNot equal
containsContains a value
starts withStarts with a value
ends withEnds with a value
matches regexMatches a regular expression
is emptyIs empty or null
is not emptyIs neither empty nor null
before, before or equalLess than, less than or equal
after, after or equalGreater than, greater than or equal

Request:

curl -X 'POST' \
'http://127.0.0.1/v1/dyn/CampaignStorage/search' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"advanced_query": {
"kind": "group",
"connector": "AND",
"children": [
{"kind": "cond", "field": "enabled", "op": "equals", "value": true},
{"kind": "cond", "field": "priority", "op": "before or equal", "value": 10},
{
"kind": "group",
"connector": "OR",
"children": [
{"kind": "cond", "field": "method", "op": "equals", "value": "RPC.CWMP.GetParameterValues"},
{
"kind": "group",
"connector": "AND",
"children": [
{"kind": "cond", "field": "active", "op": "equals", "value": false},
{"kind": "cond", "field": "name", "op": "contains", "value": "Collect"}
]
}
]
},
{
"kind": "group",
"connector": "OR",
"children": [
{"kind": "cond", "field": "id", "op": "equals", "value": "88242bad-e095-49be-a94c-000000000101"},
{"kind": "cond", "field": "id", "op": "equals", "value": "88242bad-e095-49be-a94c-000000000102"}
]
}
]
},
"pagination_index": 0,
"pagination_size": 10,
"search_params": {},
"sort_column": "priority",
"sort_direction": "asc"
}'

Response:

{
"code": 200,
"message": "response from CampaignStorage",
"details": {
"totalCount": 2,
"entities": [
{
"enabled": true,
"active": false,
"id": "88242bad-e095-49be-a94c-000000000101",
"name": "Collect device parameters",
"condition": {},
"events": ["2 PERIODIC"],
"method": "RPC.CWMP.GetParameterValues",
"args": {},
"executions": 1,
"cron": "",
"period": 3600,
"batch": 100,
"priority": 5,
"create_record_ts": 1794223699,
"ts": 1794223699,
"author": "",
"editor": "",
"start_time": 1794223699,
"end_time": null
},
{
"enabled": true,
"active": false,
"id": "88242bad-e095-49be-a94c-000000000102",
"name": "Collect device status",
"condition": {},
"events": ["2 PERIODIC"],
"method": "RPC.CWMP.GetParameterValues",
"args": {},
"executions": 1,
"cron": "",
"period": 3600,
"batch": 100,
"priority": 10,
"create_record_ts": 1794223699,
"ts": 1794223699,
"author": "",
"editor": "",
"start_time": 1794223699,
"end_time": null
}
]
}
}

To stream all records matching the same search criteria, repeat the request with the response_content_type query parameter set to json or csv. Pagination parameters are ignored during export.

Multiple RPC: POST /​

Example of requesting multiple RPC methods

Request:

url -X 'POST' \
'http://localhost/v1/dyn/CampaignStorage/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"enabled": false,
"active": true,
"id": "fdabb9a9-cde6-4f0c-95d3-b5f00c5750ad",
"name": " Get RPC and GPV",
"condition": {
"cpeid": "DMS_DEVICE"
},
"events": [],
"method": "Custom",
"args": [
{
"args": {},
"method": "CWMP.GetRPCMethods"
},
{
"args": [
"InternetGatewayDevice.ManagementServer.URL"
],
"method": "CWMP.GetParameterValues"
}
],
"executions": 0,
"cron": "",
"period": 60,
"batch": 100,
"priority": 5,
"create_record_ts": 1752744400,
"ts": 1752744400,
"author": "admin",
"editor": ""
}'

Response:

{
"code": 204,
"message": "response from CampaignStorage",
"details": ""
}

Campaign Result Storage Usage Example​

The interaction examples are provided for the Campaign Result Storage service; for other Result services, the interaction is carried out in a similar manner.

GET /count.*​

Request:

curl -X 'GET' \
'http://localhost/v1/dyn/CampaignResultStorage/count.*' \
-H 'accept: application/json'

Response:

{
"code": 200,
"message": "response from CampaignResultStorage",
"details": 2
}

GET /​

Example of retrieving data about sessions (campaigns) processed on a CPE with cpeid=DMS"

Request:

curl -X 'GET' \
'http://localhost/v1/dyn/CampaignResultStorage/?limit=10000&cpeid=DMS%2A' \
-H 'accept: application/json'

Response:

{
"code": 200,
"message": "response from CampaignResultStorage",
"details": [
{
"id": "4ba932d6-6d23-45ec-8529-04b390a00386",
"exit_code": 0,
"campaignid": "389b799a-5cb3-4e6f-9310-50cc716cb65d",
"ts": 1752665900,
"cpeid": "DMS_DEVICE",
"result": {}
},
{
"id": "824567c9-b68c-417f-b6aa-6aadf61d4bf1",
"exit_code": 0,
"campaignid": "aa92a9af-94d4-4f25-bdc9-0b9c5dc53dbf",
"ts": 1752667951,
"cpeid": "DMS_DEVICE",
"result": [
"GetRPCMethods",
"SetParameterValues",
"GetParameterValues",
"GetParameterNames",
"SetParameterAttributes",
"GetParameterAttributes",
"AddObject",
"DeleteObject",
"Reboot",
"Download"
]
}
]
}

POST /delete_objects_by_id​

Request:

curl -X 'POST' \
'http://127.0.0.1/v1/dyn/CampaignResultStorage/delete_objects_by_id' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"pr_key_column": "id",
"pr_key_values": [
"result_001",
"result_002",
"result_003"
],
"batch_size": 1000,
"return_deleted_records": true,
"return_fields_of_deleted_records": ["id", "campaignid", "cpeid", "exit_code"]
}'

Response:

{
"code": 200,
"message": "response from CampaignResultStorage",
"details": {
"data": {
"deleted_objects_number": 3,
"failed_delete_objects_number": 0,
"deleted_records": [
{
"id": "result_001",
"campaignid": "campaign_123",
"cpeid": "DMS_001",
"exit_code": 0
},
{
"id": "result_002",
"campaignid": "campaign_123",
"cpeid": "DMS_002",
"exit_code": 1
},
{
"id": "result_003",
"campaignid": "campaign_456",
"cpeid": "DMS_003",
"exit_code": 0
}
]
},
"message": "objects deleted successfully",
"code": 200
}
}

POST /delete_objects​

Request:

curl -X 'POST' \
'http://localhost/v1/dyn/CampaignResultStorage/delete_objects' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"conditions": {
"exit_code": 1
},
"batch_size": 1000,
"return_deleted_records": true,
"return_fields_of_deleted_records": ["id", "exit_code", "campaignid", "cpeid", "ts"]
}'

Response:

{
"code": 200,
"message": "response from CampaignResultStorage",
"details": {
"data": {
"deleted_objects_number": 2,
"deleted_records": [
{
"id": "result_old_001",
"exit_code": 1,
"campaignid": "old_campaign_001",
"cpeid": "DMS_001",
"ts": 1741999800
},
{
"id": "result_old_002",
"exit_code": 1,
"campaignid": "old_campaign_002",
"cpeid": "DMS_002",
"ts": 1741999500
}
]
},
"detail": "objects deleted successfully",
"code": 200
}
}