diff --git a/README.md b/README.md index d9dee16610826e591bf971fe43445e2c423f9ea8..06c76313e4c6056628e0810121ed42a532738449 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ For more info on the `uspd` UCI configuration see [link](./docs/api/uci.uspd.md) objects over `ubus`. By default(when granularity is not set in `uci`), `uspd` registers below two namespaces with `ubus`. -```bash +```console root@iopsys:~# ubus list |grep usp usp usp.raw @@ -67,7 +67,7 @@ whereas `usp.raw` has more features/methods to provide more customization option Default namespace with functionalities: -```bash +```console root@iopsys:~# ubus -v list usp 'usp' @78f3eaca "list_operate":{} @@ -88,7 +88,6 @@ root@iopsys:~# ubus -v list usp.raw "get":{"path":"String","proto":"String","maxdepth":"Integer","next-level":"Boolean","instance_mode":"Integer"} "getm_values":{"paths":"Array","proto":"String","next-level":"Boolean","instance_mode":"Integer"} "getm_names":{"paths":"Array","proto":"String","next-level":"Boolean","instance_mode":"Integer"} - "getm_attributes":{"paths":"Array","proto":"String","next-level":"Boolean","instance_mode":"Integer"} "object_names":{"path":"String","proto":"String","maxdepth":"Integer","next-level":"Boolean","instance_mode":"Integer"} "instances":{"path":"String","proto":"String","maxdepth":"Integer","next-level":"Boolean","instance_mode":"Integer"} "validate":{"path":"String","proto":"String","maxdepth":"Integer","next-level":"Boolean","instance_mode":"Integer"} @@ -98,11 +97,9 @@ root@iopsys:~# ubus -v list usp.raw "add_object":{"path":"String","proto":"String","key":"String","instance_mode":"Integer","transaction_id":"Integer"} "del_object":{"path":"String","proto":"String","key":"String","instance_mode":"Integer","transaction_id":"Integer"} "setm_values":{"pv_tuple":"Array","proto":"String","instance_mode":"Integer","key":"String","transaction_id":"Integer"} - "setm_attributes":{"paths":"Array","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} "transaction_commit":{"transaction_id":"Integer"} "transaction_abort":{"transaction_id":"Integer"} "transaction_status":{"transaction_id":"Integer"} - "list_notify":{"instance_mode":"Integer"} "notify_event":{"name":"String","input":"Table"} root@iopsys:~# ``` @@ -129,7 +126,7 @@ It is the number of levels(Dots) up to which we want to shorten the length. Ex: - When Granularity is set to 1, exposed ubus namespaces are -```bash +```console root@iopsys:~# ubus list|grep usp usp usp.Device. @@ -138,7 +135,7 @@ usp.raw - When Granularity is set to 2, exposed ubus namespaces are -```bash +```console root@iopsys:~# ubus list|grep usp usp usp.Device. @@ -158,7 +155,7 @@ root@iopsys:~# These granular ubus objects provides the same functionality as of `usp` ubus namespace -```bash +```console root@iopsys:~# ubus -v list usp.Device.WiFi. 'usp.Device.WiFi.' @6fd43aca "list_operate":{} @@ -175,7 +172,7 @@ root@iopsys:~# Registered method can be called with appropriate parameters, like: -```bash +```console root@iopsys:~# ubus call usp.Device. get '{"path":"Users."}' { "Users": { @@ -215,35 +212,32 @@ root@iopsys:~# `uspd` provides below commands in pretty(usp) or raw(usp.raw) formats, some methods only available for API integration in usp.raw namespace: - 1. Get - 2. Get multiple values - 3. Get multiple attributes - 4. Get multiple names - 5. Set - 6. Set multiple attributes - 7. Operate - 8. Add object - 9. Delete object - 10. Object names - 11. Instances - 12. Validate - 13. List operate - 14. Dump schema - 15. Set multiple values - 15. Transaction start - 16. Transaction status - 17. Transaction commit - 18. Transaction abort - 19. List notification objects - 20. List supported usp events - 21. Send notification for an event + - Get + - Get multiple values + - Get multiple names + - Set + - Operate + - Add object + - Delete object + - Object names + - Instances + - Validate + - List operate + - Dump schema + - Set multiple values + - Transaction start + - Transaction status + - Transaction commit + - Transaction abort + - List supported usp events + - Send notification for an event It also provide a granularity layer which can be configured using uci parameter and provide additional ubus objects. -### 1. Get +### Get API to query the value of a specific object. -```bash +```console root@iopsys:~# ubus call usp get '{"path":"Device.IP.Diagnostics.", "proto":"usp"}' { "Diagnostics": { @@ -354,12 +348,12 @@ root@iopsys:~# ubus call usp.raw get '{"path":"Device.Users."}' - For more info on the `usp` ubus API see [link](./docs/api/usp.md#get) - For more info on the `usp.raw` ubus API see [link](./docs/api/usp.raw.md#get) -### 2. Get multiple values +### Get multiple values API to get values of multiple objects at once, object name must be provided in `paths` parameter array as below. > Note: This method is only available in `usp.raw` namespace. -```bash +```console root@iopsys:~# ubus call usp.raw getm_values '{"paths":["Device.Users.User.1.Username","Device.DeviceInfo.SerialNumber"]}' { "parameters": [ @@ -377,35 +371,12 @@ root@iopsys:~# ubus call usp.raw getm_values '{"paths":["Device.Users.User.1.Use } ``` -### 3. Get multiple attributes -API to get attributes to specific object, object name must be provided in `paths` parameter array. - -> Note: This method only available in `usp.raw` namespace - -```bash -root@iopsys:~# ubus call usp.raw getm_attributes '{"paths":["Device.Users.User.1.Username","Device.DeviceInfo.SerialNumber"]}' -{ - "parameters": [ - { - "parameter": "Device.Users.User.1.Username", - "value": "0", - "type": "xsd:string" - }, - { - "parameter": "Device.DeviceInfo.SerialNumber", - "value": "0", - "type": "xsd:string" - } - ] -} -``` - -### 4. Get multiple objects +### Get multiple objects API to get multiple objects from multiple paths at once. > Note: This method only available in `usp.raw` namespace -```bash +```console root@iopsys:~# ubus call usp.raw getm_names '{"paths":["Device.Users.User.1.","Device.DeviceInfo.SerialNumber"]}' { "parameters": [ @@ -454,14 +425,14 @@ root@iopsys:~# ubus call usp.raw getm_names '{"paths":["Device.Users.User.1.","D root@iopsys:~# ``` -### 5. Set +### Set API to set value to specific object, object name must be provided in `path` parameter and value to be set in `value` option. > Note 1: In usp namespace, set method creates a internal transaction before actually setting the value. After set operation it automatically commits the transaction. > Note 2: In usp.raw namespace, set method requires a transaction to be created before calling the set method. Please refer to transaction APIs for more details. -```bash +```console root@iopsys:/tmp# ubus call usp set '{"path":"Device.WiFi.SSID.[BSSID==\"00:22:07:ae:ee:03\"].SSID", "value":"test-2g"}' { "status": true @@ -482,24 +453,10 @@ root@iopsys:~# ubus call usp get '{"path":"Device.WiFi.SSID.[BSSID==\"00:22:07:a - For more info on the `usp` ubus API see [link](./docs/api/usp.md#set) - For more info on the `usp.raw` ubus API see [link](./docs/api/usp.raw.md#set) -### 6. Set multiple attributes -API to set multiple attributes to specific object, object name must be provided in `paths` parameter array. - -```bash -root@iopsys:~# ubus call usp.raw setm_attributes '{"paths":[{"path":"Device.DeviceInfo.SerialNumber","notify-type":"1","notify":"1"}], "transaction_id": 12345}' -{ - "parameters": [ - { - "path": "Device.DeviceInfo.SerialNumber" - } - ] -} -``` - -### 7. Operate +### Operate API to run operate/diagnostics commands as defined in TR-369 -```bash +```console root@iopsys:~# ubus call usp operate '{"path":"Device.IP.Diagnostics.", "action":"IPPing()","input":{"Host":"iopsys.eu"}}' { "Results": [ @@ -576,13 +533,13 @@ root@iopsys:~# ubus call usp.raw operate '{"path":"Device.IP.Interface.[Name==\" - For more info on the `usp` ubus API see [link](./docs/api/usp.md#operate) - For more info on the `usp.raw` ubus API see [link](./docs/api/usp.raw.md#operate) -### 8. Add object +### Add object API to add new objects in multi-instance object > Note 1: In usp namespace, `add_object` method creates a internal transaction before actually setting the value. After set operation it automatically commits the transaction. > Note 2: In usp.raw namespace, `add_object` method requires a transaction to be created before calling the set method. Please refer to transaction APIs for more details. -```bash +```console root@iopsys:~# ubus call usp add_object '{"path":"Device.Users.User."}' { "parameters": [ @@ -607,13 +564,13 @@ root@iopsys:~# ubus call usp.raw add_object '{"path":"Device.Users.User.", "tran - For more info on the `usp` ubus API see [link](./docs/api/usp.md#add_object) - For more info on the `usp.raw` ubus API see [link](./docs/api/usp.raw.md#add_object) -### 9. Delete object +### Delete object API to delete an existing object from multi-instance object > Note 1: In usp namespace, `del_object` method creates a internal transaction before actually setting the value. After set operation it automatically commits the transaction. > Note 2: In usp.raw namespace, `del_object` method requires a transaction to be created before calling the set method. Please refer to transaction APIs for more details. -```bash +```console root@iopsys:/tmp# ubus call usp del_object '{"path":"Device.Users.User.4"}' { "parameters": [ @@ -636,10 +593,10 @@ root@iopsys:/tmp# ubus call usp.raw del_object '{"path":"Device.Users.User.3", " - For more info on the `usp` ubus API see [link](./docs/api/usp.md#del_object) - For more info on the `usp.raw` ubus API see [link](./docs/api/usp.raw.md#del_object) -### 10. Object names +### Object names API to get the available list of object names. -```bash +```console root@iopsys:~# ubus call usp object_names '{"path":"Device.DeviceInfo.SerialNumber"}' { "parameters": [ @@ -697,10 +654,10 @@ root@iopsys:~# - For more info on the `usp` ubus API see [link](./docs/api/usp.md) - For more info on the `usp.raw` ubus API see [link](./docs/api/usp.raw.md) -### 11. Instances +### Instances API to get the available instances of an multi-instance object. USP Instances method returns the registered instances. -```bash +```console root@iopsys:~# ubus call usp instances '{"path":"Device.IP.Interface.", "proto":"usp"}' { "parameters": [ @@ -732,12 +689,12 @@ root@iopsys:~# ubus call usp instances '{"path":"Device.IP.Interface.", "proto": - For more info on the `usp` ubus API see [link](./docs/api/usp.md#instances) - For more info on the `usp.raw` ubus API see [link](./docs/api/usp.raw.md#instances) -### 12. Validate +### Validate API to validate a object in data-model. This api shall simply return the object name if present in data-model objects or generates a fault if object not available in data-model. -```bash +```console root@iopsys:~# ubus call usp validate '{"path":"Device.DeviceInfo."}' { "parameter": "Device.DeviceInfo" @@ -748,11 +705,11 @@ root@iopsys:~# ubus call usp.raw validate '{"path":"invalid.object"}' } ``` -### 13. List Operate +### List Operate API to list all available operate commands with supported input and output parameters -```bash +```console root@iopsys:~# ubus call usp list_operate { "parameters": [ @@ -811,10 +768,10 @@ root@iopsys:~# ubus call usp list_operate { ``` -### 14. Dump schema +### Dump schema API to dump all registered schema paths, -```bash +```console root@iopsys:~# ubus call usp dump_schema { "parameters": [ @@ -841,12 +798,12 @@ root@iopsys:~# ubus call usp dump_schema { ``` -### 15. Set multiple values +### Set multiple values API to set value of multiple parameters at once. > Note: This method only available in usp.raw namespace -```bash +```console root@iopsys:~# ubus call usp.raw setm_values '{"pv_tuple":[{"path":"Device.Users.User.2.Username", "value":"xzzz"}, {"path":"Device.Users.User.2.RemoteAccessCapable", "value":"true"}, {"path":"Device.Users.User.2.Password", "value":"zzzzzzz"}], "proto":"usp", "transaction_id":1249743667}' { "status": true @@ -865,14 +822,14 @@ root@iopsys:~# ubus call usp.raw setm_values '{"pv_tuple":[{"path":"Device.Users } ``` -### 15. Transaction start +### Transaction start To support the `allow_partial` and `required` parameters in Add/Del/Set operation as defined in TR-369, transaction_* APIs introduced. It basically works around data-model objects which has dependent uci config files for each CUD operation. API to start a transaction in usp.raw namespace for add/del/set operations in usp.raw namespace > Note: This API only available in usp.raw namespace -```bash +```console root@iopsys:~# ubus call usp.raw transaction_start '{"app":"test"}' { "status": true, @@ -880,10 +837,10 @@ root@iopsys:~# ubus call usp.raw transaction_start '{"app":"test"}' } ``` -### 16. Get status of a transaction +### Get status of a transaction API to get details and check status of a transaction id in usp.raw namespace -```bash +```console root@iopsys:~# ubus call usp.raw transaction_status '{"transaction_id":955001092}' { "app": "test", @@ -898,11 +855,11 @@ root@iopsys:~# ubus call usp.raw transaction_status '{"transaction_id":869066287 root@iopsys:~# ``` -### 17. Transaction commit +### Transaction commit API to commit an on-going transaction, on calling this api, uci changes shall be committed and required services shall be restarted. -```bash +```console root@iopsys:~# ubus call usp.raw transaction_commit '{"transaction_id":955001092}' { "status": true @@ -910,11 +867,11 @@ root@iopsys:~# ubus call usp.raw transaction_commit '{"transaction_id":955001092 root@iopsys:~# ``` -### 18. Transaction abort +### Transaction abort API to abort an on-going transaction, on calling this api, staged changes in uci shall be reverted to earlier values. -```bash +```console root@iopsys:~# ubus call usp.raw transaction_abort '{"transaction_id":955001092}' { "status": true @@ -922,45 +879,10 @@ root@iopsys:~# ubus call usp.raw transaction_abort '{"transaction_id":955001092} root@iopsys:~# ``` -### 19. List notification objects -API to list down the data-model objects for which cwmp notification has been enabled. +### List supported usp events +API to list down the data-model events for usp notification supported by uspd. -```bash -root@iopsys:~# ubus call usp.raw list_notify -{ - "parameters": [ - { - "parameter": "Device.DeviceInfo.ProvisioningCode", - "value": "", - "notification": "2", - "type": "xsd:string" - }, - { - "parameter": "Device.DeviceInfo.SoftwareVersion", - "value": "IOPSYS-CODE-ANALYSIS", - "notification": "2", - "type": "xsd:string" - }, - { - "parameter": "Device.ManagementServer.ConnReqJabberID", - "value": "", - "notification": "2", - "type": "xsd:string" - }, - { - "parameter": "Device.ManagementServer.ConnectionRequestURL", - "value": "", - "notification": "2", - "type": "xsd:string" - } - ] -} -``` - -### 20. List supported events -API to list down the data-model events for usp notification. - -```bash +```console root@iopsys:~# ubus call usp.raw list_events { "parameters": [ @@ -988,7 +910,7 @@ Please note some error scenerios with the uspd. 1. The path parameter value must start with 'Device.'. The command below doesn't have Device before path "Users.User." -```bash +```console root@iopsys:~# ubus call usp.raw get '{"path":"Users.User."}' { "fault": 7026 @@ -999,7 +921,7 @@ root@iopsys:~# ubus call usp.raw get '{"path":"Users.User."}' Note that first two commands doesn't end with a '.' while the command with Alias is correct, due to Alias being the leaf element. To find correct schema path user can check with dump_schema option. -```bash +```console root@iopsys:~# root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.4"}' { @@ -1024,7 +946,7 @@ root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.4.Alias"}' 3. In path parameter value below, note that, the first search expression 'Type==Normal' is string which should be used as : Type==\"Normal\" -```bash +```console root@iopsys:~# ubus call usp get '{"path":"Device.IP.Interface.[Type==Normal].IPv4Address.[AddressingType==\"Static\"].IPAddress"}' { "fault": 7008 @@ -1046,7 +968,7 @@ root@iopsys:~# ubus call usp get '{"path":"Device.IP.Interface.[Type==\"Normal\" 4. The path parameter value must not have an empty search expression -```bash +```console root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.[]."}' { "fault": 9005 @@ -1055,7 +977,7 @@ root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.[]."}' 5. The path parameter value must use proper '.' separated path search expression. Note that a '.' is missing between User and * -```bash +```console root@iopsys:~# ubus call usp get '{"path":"Device.Users.User*."}' { "fault": 7026 @@ -1064,7 +986,7 @@ root@iopsys:~# ubus call usp get '{"path":"Device.Users.User*."}' 6. The path parameter value must be a valid path schema, in example below SSID is used which is invalid schema element for Device.Users.User.{i}. -```bash +```console root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.1.SSID"}' { "fault": 7026 @@ -1073,7 +995,7 @@ root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.1.SSID"}' 7. Please note that in search expression, string comparison only work with "==" or "!=". Whereas in command below its = -```bash +```console root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.[Username=\"user\"].Alias"}' { "fault": 7008 @@ -1099,7 +1021,7 @@ root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.[Username=\"user\"] All `operate` operation and `get` operation with a depth up to 'USP_SUBPROCESS_DEPTH(2)' runs in a parallel subprocess to avoid blocking the next call. -```bash +```console root@iopsys:~# time ubus call usp.raw get '{"path":"Device."}' >/dev/null & root@iopsys:~# time ubus call usp.raw get '{"path":"Device.Users."}' >/dev/null real 0m 0.07s @@ -1116,7 +1038,7 @@ root@iopsys:~# ## More example(s) -```bash +```console root@iopsys:~# ubus call usp get '{"path":"Device.WiFi.SSID.*.SSID"}' { diff --git a/docs/api/usp.md b/docs/api/usp.md index 2f004f00ad981b04fe0028884ee6cbbd4b98f084..1556f13219d6b74b6c0bb85020cf6121a21fa9fe 100644 --- a/docs/api/usp.md +++ b/docs/api/usp.md @@ -116,7 +116,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp add_object {"path":"magna aliqu","proto":"usp"} +ubus call usp add_object {"path":"ea Excepteur Lorem in in","proto":"usp"} ``` ### JSONRPC Example @@ -126,7 +126,7 @@ ubus call usp add_object {"path":"magna aliqu","proto":"usp"} "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp", "add_object", { "path": "magna aliqu", "proto": "usp" }] + "params": ["<SID>", "usp", "add_object", { "path": "ea Excepteur Lorem in in", "proto": "usp" }] } ``` @@ -188,7 +188,7 @@ ubus call usp add_object {"path":"magna aliqu","proto":"usp"} ### Output Example ```json -{ "status": false, "instance": 94637763, "fault": 7263 } +{ "status": true, "instance": 63518717, "fault": 8921 } ``` ## del_object @@ -293,7 +293,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp del_object {"path":"consectetur sint","proto":"usp"} +ubus call usp del_object {"path":"magna adip","proto":"both"} ``` ### JSONRPC Example @@ -303,7 +303,7 @@ ubus call usp del_object {"path":"consectetur sint","proto":"usp"} "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp", "del_object", { "path": "consectetur sint", "proto": "usp" }] + "params": ["<SID>", "usp", "del_object", { "path": "magna adip", "proto": "both" }] } ``` @@ -351,7 +351,7 @@ ubus call usp del_object {"path":"consectetur sint","proto":"usp"} ### Output Example ```json -{ "status": false, "fault": 9012 } +{ "status": false, "fault": 8468 } ``` ## get @@ -456,7 +456,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp get {"path":"tempor","proto":"usp"} +ubus call usp get {"path":"aute Duis esse nostrud sunt","proto":"both"} ``` ### JSONRPC Example @@ -466,7 +466,7 @@ ubus call usp get {"path":"tempor","proto":"usp"} "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp", "get", { "path": "tempor", "proto": "usp" }] + "params": ["<SID>", "usp", "get", { "path": "aute Duis esse nostrud sunt", "proto": "both" }] } ``` @@ -638,7 +638,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp instances {"path":"quis velit eiusmod Excepteur ullamco","proto":"usp"} +ubus call usp instances {"path":"velitut ad tempor dolore ut","proto":"usp"} ``` ### JSONRPC Example @@ -648,7 +648,7 @@ ubus call usp instances {"path":"quis velit eiusmod Excepteur ullamco","proto":" "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp", "instances", { "path": "quis velit eiusmod Excepteur ullamco", "proto": "usp" }] + "params": ["<SID>", "usp", "instances", { "path": "velitut ad tempor dolore ut", "proto": "usp" }] } ``` @@ -703,14 +703,7 @@ Multi object instances ### Output Example ```json -{ - "parameters": [ - { "parameter": "sunt esse tempor eu" }, - { "parameter": "nonet ipsum veniam dolore ex" }, - { "parameter": "sint esse Lorem " }, - { "parameter": "cupidatat off" } - ] -} +{ "parameters": [{ "parameter": "esteu sed Lorem enim" }, { "parameter": "consectetur voluptat" }] } ``` ## list_operate @@ -872,10 +865,10 @@ The value of this property **must** be equal to one of the [known values below]( { "parameters": [ { - "parameter": "ea adipisicing dolor", + "parameter": "cupidatat Excepteur magna qui voluptate", "type": "async", - "in": ["in occaecat dolor consequat elit", "ullamc", "anim dol", "elit"], - "out": ["dolor aute esse", "aute proident in", "ad in velit dolore tempor", "dolor in Lorem fugiat dolore"] + "in": ["eu", "ipsum", "ipsum labore consequat in"], + "out": ["id esse magna"] } ] } @@ -983,7 +976,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp object_names {"path":"essecillum amet in Excepteur","proto":"usp"} +ubus call usp object_names {"path":"consequat non","proto":"both"} ``` ### JSONRPC Example @@ -993,7 +986,7 @@ ubus call usp object_names {"path":"essecillum amet in Excepteur","proto":"usp"} "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp", "object_names", { "path": "essecillum amet in Excepteur", "proto": "usp" }] + "params": ["<SID>", "usp", "object_names", { "path": "consequat non", "proto": "both" }] } ``` @@ -1068,10 +1061,10 @@ Device.WiFi. ```json { "parameters": [ - { "parameter": "consectetur Lorem aute" }, - { "parameter": "eiusmod sint ipsum id" }, - { "parameter": "fugiat" }, - { "parameter": "ex dolor proident in" } + { "parameter": "ea proident irure vo" }, + { "parameter": "aute Excepteur" }, + { "parameter": "sintlaboris cupidatat deserunt eu" }, + { "parameter": "est Duis ut" } ] } ``` @@ -1231,7 +1224,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp operate {"path":"occaecat minim do cu","action":"omfwcViWIfl()","proto":"both","input":{}} +ubus call usp operate {"path":"veniam ad consequat","action":"abrfa()","proto":"both","input":{}} ``` ### JSONRPC Example @@ -1245,7 +1238,7 @@ ubus call usp operate {"path":"occaecat minim do cu","action":"omfwcViWIfl()","p "<SID>", "usp", "operate", - { "path": "occaecat minim do cu", "action": "omfwcViWIfl()", "proto": "both", "input": {} } + { "path": "veniam ad consequat", "action": "abrfa()", "proto": "both", "input": {} } ] } ``` @@ -1479,7 +1472,7 @@ To set multiple values at once, path should be relative to object elements ### Ubus CLI Example ``` -ubus call usp set {"path":"aliqua sit velit","value":"aliquip in","proto":"cwmp","values":{},"key":"nostrud eu","instance_mode":0} +ubus call usp set {"path":"consequat","value":"est fugiat non in","proto":"usp","values":{},"key":"labore ex veniam adipisicing id","instance_mode":1} ``` ### JSONRPC Example @@ -1494,12 +1487,12 @@ ubus call usp set {"path":"aliqua sit velit","value":"aliquip in","proto":"cwmp" "usp", "set", { - "path": "aliqua sit velit", - "value": "aliquip in", - "proto": "cwmp", + "path": "consequat", + "value": "est fugiat non in", + "proto": "usp", "values": {}, - "key": "nostrud eu", - "instance_mode": 0 + "key": "labore ex veniam adipisicing id", + "instance_mode": 1 } ] } @@ -1570,11 +1563,6 @@ Unknown type ``. "type": "string", "enum": ["0", "1"] }, - "notify_type_t": { - "type": "string", - "description": "Notification type as per libbbf", - "enum": ["0", "1", "2", "3", "4", "5", "6"] - }, "operate_path_t": { "description": "Datamodel object schema path", "type": "string", @@ -1631,7 +1619,7 @@ Unknown type ``. "maximum": 9050 } }, - "out": "{\"oneof\":[{\"status\":\"1\"},{\"parameters\":[{\"path\":\"adipisicing\",\"status\":\"0\",\"fault\":8493},{\"path\":\"officia\",\"status\":\"0\",\"fault\":7762},{\"path\":\"laboris cillum dolore\",\"status\":\"0\",\"fault\":7359},{\"path\":\"exercitation Duis\",\"status\":\"0\",\"fault\":7188}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.Bridging.Bridge.{i}.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.{i}.SSID\"]},\"boolean_t\":{\"type\":\"string\",\"enum\":[\"0\",\"1\"]},\"notify_type_t\":{\"type\":\"string\",\"description\":\"Notification type as per libbbf\",\"enum\":[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"]},\"operate_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.DHCPv4.Client.{i}.Renew()\",\"Device.FactoryReset()\"]},\"operate_type_t\":{\"type\":\"string\",\"enum\":[\"async\",\"sync\"]},\"query_path_t\":{\"description\":\"DM object path with search queries\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.[SSID==\\\"test_ssid\\\"].BSSID\",\"Device.WiFi.SSID.*.BSSID\",\"Device.WiFi.SSID.[SSID!=\\\"test_ssid\\\"&&Enable==1].BSSID\",\"Device.WiFi.\"]},\"instance_t\":{\"description\":\"Multi object instances\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256},\"proto_t\":{\"type\":\"string\",\"default\":\"both\",\"enum\":[\"usp\",\"cwmp\",\"both\"]},\"type_t\":{\"type\":\"string\",\"enum\":[\"xsd:string\",\"xsd:unsignedInt\",\"xsd:int\",\"xsd:unsignedLong\",\"xsd:long\",\"xsd:boolean\",\"xsd:dateTime\",\"xsd:hexBinary\",\"xsd:object\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", + "out": "{\"oneof\":[{\"status\":\"1\"},{\"parameters\":[{\"path\":\"ex Lorem nulla\",\"status\":\"0\",\"fault\":7596},{\"path\":\"donulla\",\"status\":\"0\",\"fault\":8341},{\"path\":\"sintUt Excepteur\",\"status\":\"0\",\"fault\":8882},{\"path\":\"sint irure\",\"status\":\"0\",\"fault\":8476},{\"path\":\"veniam elit fugiat\",\"status\":\"0\",\"fault\":7593}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.Bridging.Bridge.{i}.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.{i}.SSID\"]},\"boolean_t\":{\"type\":\"string\",\"enum\":[\"0\",\"1\"]},\"operate_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.DHCPv4.Client.{i}.Renew()\",\"Device.FactoryReset()\"]},\"operate_type_t\":{\"type\":\"string\",\"enum\":[\"async\",\"sync\"]},\"query_path_t\":{\"description\":\"DM object path with search queries\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.[SSID==\\\"test_ssid\\\"].BSSID\",\"Device.WiFi.SSID.*.BSSID\",\"Device.WiFi.SSID.[SSID!=\\\"test_ssid\\\"&&Enable==1].BSSID\",\"Device.WiFi.\"]},\"instance_t\":{\"description\":\"Multi object instances\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256},\"proto_t\":{\"type\":\"string\",\"default\":\"both\",\"enum\":[\"usp\",\"cwmp\",\"both\"]},\"type_t\":{\"type\":\"string\",\"enum\":[\"xsd:string\",\"xsd:unsignedInt\",\"xsd:int\",\"xsd:unsignedLong\",\"xsd:long\",\"xsd:boolean\",\"xsd:dateTime\",\"xsd:hexBinary\",\"xsd:object\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", "simpletype": "complex" } ``` @@ -1644,10 +1632,11 @@ Unknown type ``. { "status": "1" }, { "parameters": [ - { "path": "adipisicing", "status": "0", "fault": 8493 }, - { "path": "officia", "status": "0", "fault": 7762 }, - { "path": "laboris cillum dolore", "status": "0", "fault": 7359 }, - { "path": "exercitation Duis", "status": "0", "fault": 7188 } + { "path": "ex Lorem nulla", "status": "0", "fault": 7596 }, + { "path": "donulla", "status": "0", "fault": 8341 }, + { "path": "sintUt Excepteur", "status": "0", "fault": 8882 }, + { "path": "sint irure", "status": "0", "fault": 8476 }, + { "path": "veniam elit fugiat", "status": "0", "fault": 7593 } ] } ], @@ -1667,11 +1656,6 @@ Unknown type ``. "examples": ["Device.Bridging.Bridge.{i}.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.{i}.SSID"] }, "boolean_t": { "type": "string", "enum": ["0", "1"] }, - "notify_type_t": { - "type": "string", - "description": "Notification type as per libbbf", - "enum": ["0", "1", "2", "3", "4", "5", "6"] - }, "operate_path_t": { "description": "Datamodel object schema path", "type": "string", @@ -1817,7 +1801,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp validate {"path":"anim et","proto":"cwmp"} +ubus call usp validate {"path":"irure veniam vo","proto":"usp"} ``` ### JSONRPC Example @@ -1827,7 +1811,7 @@ ubus call usp validate {"path":"anim et","proto":"cwmp"} "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp", "validate", { "path": "anim et", "proto": "cwmp" }] + "params": ["<SID>", "usp", "validate", { "path": "irure veniam vo", "proto": "usp" }] } ``` @@ -1860,5 +1844,5 @@ ubus call usp validate {"path":"anim et","proto":"cwmp"} ### Output Example ```json -{ "parameter": "do" } +{ "parameter": "in" } ``` diff --git a/docs/api/usp.raw.md b/docs/api/usp.raw.md index 4d62abba79924306e8c8ab6b6a5943817d4a7cb6..0a4ab17775d2781d836bb53824edaa5c3229a9d5 100644 --- a/docs/api/usp.raw.md +++ b/docs/api/usp.raw.md @@ -16,17 +16,14 @@ https://www.iopsys.eu/usp.raw.json | [del_object](#del_object) | Method | usp.raw (this schema) | | [dump_schema](#dump_schema) | Method | usp.raw (this schema) | | [get](#get) | Method | usp.raw (this schema) | -| [getm_attributes](#getm_attributes) | Method | usp.raw (this schema) | | [getm_names](#getm_names) | Method | usp.raw (this schema) | | [getm_values](#getm_values) | Method | usp.raw (this schema) | | [instances](#instances) | Method | usp.raw (this schema) | | [list_events](#list_events) | Method | usp.raw (this schema) | -| [list_notify](#list_notify) | Method | usp.raw (this schema) | | [list_operate](#list_operate) | Method | usp.raw (this schema) | | [object_names](#object_names) | Method | usp.raw (this schema) | | [operate](#operate) | Method | usp.raw (this schema) | | [set](#set) | Method | usp.raw (this schema) | -| [setm_attributes](#setm_attributes) | Method | usp.raw (this schema) | | [setm_values](#setm_values) | Method | usp.raw (this schema) | | [transaction_abort](#transaction_abort) | Method | usp.raw (this schema) | | [transaction_commit](#transaction_commit) | Method | usp.raw (this schema) | @@ -168,7 +165,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp.raw add_object {"path":"enim irure consequat","transaction_id":18764740,"proto":"both","key":"eu","instance_mode":1} +ubus call usp.raw add_object {"path":"esse irure sit","transaction_id":27603940,"proto":"cwmp","key":"ad dolore","instance_mode":1} ``` ### JSONRPC Example @@ -182,7 +179,7 @@ ubus call usp.raw add_object {"path":"enim irure consequat","transaction_id":187 "<SID>", "usp.raw", "add_object", - { "path": "enim irure consequat", "transaction_id": 18764740, "proto": "both", "key": "eu", "instance_mode": 1 } + { "path": "esse irure sit", "transaction_id": 27603940, "proto": "cwmp", "key": "ad dolore", "instance_mode": 1 } ] } ``` @@ -245,7 +242,7 @@ ubus call usp.raw add_object {"path":"enim irure consequat","transaction_id":187 ### Output Example ```json -{ "status": true, "instance": 61229967, "fault": 7943 } +{ "status": true, "instance": 71042098, "fault": 8418 } ``` ## del_object @@ -379,7 +376,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp.raw del_object {"path":"reprehenderit ","transaction_id":4518874,"proto":"both","instance_mode":0} +ubus call usp.raw del_object {"path":"eavelit qui Excepteur laboris","transaction_id":18825047,"proto":"cwmp","instance_mode":0} ``` ### JSONRPC Example @@ -393,7 +390,7 @@ ubus call usp.raw del_object {"path":"reprehenderit ","transaction_id":4518874," "<SID>", "usp.raw", "del_object", - { "path": "reprehenderit ", "transaction_id": 4518874, "proto": "both", "instance_mode": 0 } + { "path": "eavelit qui Excepteur laboris", "transaction_id": 18825047, "proto": "cwmp", "instance_mode": 0 } ] } ``` @@ -442,7 +439,7 @@ ubus call usp.raw del_object {"path":"reprehenderit ","transaction_id":4518874," ### Output Example ```json -{ "status": false, "fault": 8135 } +{ "status": false, "fault": 7284 } ``` ## dump_schema @@ -574,8 +571,8 @@ All items must be of the type: Unknown type ``. ```json { "parameters": [ - { "parameter": "consectetur", "writable": "1", "type": "xsd:object", "unique_keys": ["et irure do"] }, - { "parameter": "culpa ad", "writable": "0", "type": "xsd:long" } + { "parameter": "reprehenderit culpa", "writable": "0", "type": "xsd:dateTime", "unique_keys": ["irure"] }, + { "parameter": "nisi tempor mollit", "writable": "1", "type": "xsd:hexBinary" } ] } ``` @@ -682,7 +679,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp.raw get {"path":"aute proident est ex","proto":"both"} +ubus call usp.raw get {"path":"sunt nulla incididunt do","proto":"both"} ``` ### JSONRPC Example @@ -692,7 +689,7 @@ ubus call usp.raw get {"path":"aute proident est ex","proto":"both"} "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp.raw", "get", { "path": "aute proident est ex", "proto": "both" }] + "params": ["<SID>", "usp.raw", "get", { "path": "sunt nulla incididunt do", "proto": "both" }] } ``` @@ -766,184 +763,11 @@ All items must be of the type: Unknown type ``. ```json { - "fault": 7647, - "parameters": [{ "parameter": "incididunt", "value": "nostrud Lorem irure amet qui", "type": "xsd:unsignedInt" }] + "fault": 7854, + "parameters": [{ "parameter": "sunt Excepteur nisi", "value": "aliquip occaecat", "type": "xsd:int" }] } ``` -## getm_attributes - -### Get attributes of multiple objects - -`getm_attributes` - -- type: `Method` - -### getm_attributes Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | Optional | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| ------------ | ------- | ------------ | -------- | -| `next-level` | boolean | Optional | | -| `paths` | array | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### paths - -`paths` - -- is **required** -- type: `array` - -##### paths Type - -Array type: `array` - -All items must be of the type: Unknown type ``. - -```json -{ - "type": "array", - "items": [ - { - "$ref": "#/definitions/path_t" - } - ], - "simpletype": "`array`" -} -``` - -#### proto - -`proto` - -- is optional -- type: reference -- default: `"both"` - -##### proto Type - -`string` - -The value of this property **must** be equal to one of the [known values below](#getm_attributes-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp.raw getm_attributes {"paths":["inDuis ut sed"],"proto":"both","next-level":false} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "<SID>", - "usp.raw", - "getm_attributes", - { "paths": ["inDuis ut sed"], "proto": "both", "next-level": false } - ] -} -``` - -#### output - -`output` - -- is optional -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| ------------ | ----- | ------------ | -| `parameters` | array | **Required** | - -#### parameters - -`parameters` - -- is **required** -- type: `array` - -##### parameters Type - -Array type: `array` - -All items must be of the type: Unknown type ``. - -```json -{ - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ "parameters": [{ "parameter": "nostrud dolore cillum", "value": "0", "type": "xsd:dateTime" }] } -``` - ## getm_names ### Get multiple object names @@ -1043,7 +867,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp.raw getm_names {"paths":["laborum magna aliqua"],"proto":"cwmp","next-level":false} +ubus call usp.raw getm_names {"paths":["nisi officia anim commodo "],"proto":"usp","next-level":true} ``` ### JSONRPC Example @@ -1057,7 +881,7 @@ ubus call usp.raw getm_names {"paths":["laborum magna aliqua"],"proto":"cwmp","n "<SID>", "usp.raw", "getm_names", - { "paths": ["laborum magna aliqua"], "proto": "cwmp", "next-level": false } + { "paths": ["nisi officia anim commodo "], "proto": "usp", "next-level": true } ] } ``` @@ -1116,7 +940,7 @@ All items must be of the type: Unknown type ``. ### Output Example ```json -{ "parameters": [{ "parameter": "Lorem ea", "value": "0", "type": "xsd:string" }] } +{ "parameters": [{ "parameter": "Loremesse do labore dolor", "value": "1", "type": "xsd:unsignedInt" }] } ``` ## getm_values @@ -1204,7 +1028,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp.raw getm_values {"paths":["laborum anim"],"proto":"both"} +ubus call usp.raw getm_values {"paths":["sint anim non irure"],"proto":"usp"} ``` ### JSONRPC Example @@ -1214,7 +1038,7 @@ ubus call usp.raw getm_values {"paths":["laborum anim"],"proto":"both"} "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp.raw", "getm_values", { "paths": ["laborum anim"], "proto": "both" }] + "params": ["<SID>", "usp.raw", "getm_values", { "paths": ["sint anim non irure"], "proto": "usp" }] } ``` @@ -1272,7 +1096,11 @@ All items must be of the type: Unknown type ``. ### Output Example ```json -{ "parameters": [{ "parameter": "mollit", "value": "elit in ex", "type": "xsd:hexBinary" }] } +{ + "parameters": [ + { "parameter": "proident pariatur magna in Excepteur", "value": "qui in cupidatat", "type": "xsd:boolean" } + ] +} ``` ## instances @@ -1377,7 +1205,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp.raw instances {"path":"velit dolore nulla Duis officia","proto":"both"} +ubus call usp.raw instances {"path":"nostrud aliqua sunt consectetur dolore","proto":"both"} ``` ### JSONRPC Example @@ -1387,7 +1215,7 @@ ubus call usp.raw instances {"path":"velit dolore nulla Duis officia","proto":"b "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp.raw", "instances", { "path": "velit dolore nulla Duis officia", "proto": "both" }] + "params": ["<SID>", "usp.raw", "instances", { "path": "nostrud aliqua sunt consectetur dolore", "proto": "both" }] } ``` @@ -1439,7 +1267,7 @@ All items must be of the type: Unknown type ``. ### Output Example ```json -{ "parameters": [{ "parameter": "et ipsum nostr" }] } +{ "parameters": [{ "parameter": "nostrud p" }] } ``` ## list_events @@ -1545,137 +1373,7 @@ All items must be of the type: Unknown type ``. ### Output Example ```json -{ "parameters": [{ "parameter": "ex Duis occaecat", "in": ["ex labore veniam"] }] } -``` - -## list_notify - -### List cwmp notification objects - -`list_notify` - -- type: `Method` - -### list_notify Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | Optional | -| `output` | object | **Required** | - -#### input - -`input` - -- is optional -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| --------------- | ------- | -------- | -| `instance_mode` | integer | Optional | - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -### Ubus CLI Example - -``` -ubus call usp.raw list_notify {"instance_mode":45065415} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": ["<SID>", "usp.raw", "list_notify", { "instance_mode": 45065415 }] -} -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| ------------ | ----- | ------------ | -| `parameters` | array | **Required** | - -#### parameters - -`parameters` - -- is **required** -- type: `array` - -##### parameters Type - -Array type: `array` - -All items must be of the type: Unknown type ``. - -```json -{ - "type": "array", - "items": [ - { - "type": "object", - "required": ["parameter", "value", "notification", "type"], - "properties": { - "parameter": { - "$ref": "#/definitions/operate_path_t" - }, - "value": { - "type": "string" - }, - "notification": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ - "parameters": [ - { - "parameter": "Ut anim et officia", - "value": "est ad nostrud Lorem", - "notification": "officia labore", - "type": "xsd:hexBinary" - } - ] -} +{ "parameters": [{ "parameter": "exercitation sunt", "in": ["proident laboris voluptate"] }] } ``` ## list_operate @@ -1792,7 +1490,16 @@ All items must be of the type: Unknown type ``. ### Output Example ```json -{ "parameters": [{ "parameter": "nulla sit ut", "type": "sync", "in": ["tempor laborum esse"], "out": ["nulla"] }] } +{ + "parameters": [ + { + "parameter": "labore dolor", + "type": "async", + "in": ["sit tempor reprehenderit et"], + "out": ["sit cupidatat adipisicing velit"] + } + ] +} ``` ## object_names @@ -1897,7 +1604,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp.raw object_names {"path":"enim exercitation dolor eiusmod","proto":"usp"} +ubus call usp.raw object_names {"path":"deserunt","proto":"both"} ``` ### JSONRPC Example @@ -1907,7 +1614,7 @@ ubus call usp.raw object_names {"path":"enim exercitation dolor eiusmod","proto" "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp.raw", "object_names", { "path": "enim exercitation dolor eiusmod", "proto": "usp" }] + "params": ["<SID>", "usp.raw", "object_names", { "path": "deserunt", "proto": "both" }] } ``` @@ -1959,7 +1666,7 @@ All items must be of the type: Unknown type ``. ### Output Example ```json -{ "parameters": [{ "parameter": "Ut proident in sit in" }] } +{ "parameters": [{ "parameter": "consectetur" }] } ``` ## operate @@ -2108,7 +1815,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp.raw operate {"path":"quis proident t","action":"cillum()","proto":"both","input":{}} +ubus call usp.raw operate {"path":"fugiat dolore","action":"sint in adipisicing","proto":"cwmp","input":{}} ``` ### JSONRPC Example @@ -2122,7 +1829,7 @@ ubus call usp.raw operate {"path":"quis proident t","action":"cillum()","proto": "<SID>", "usp.raw", "operate", - { "path": "quis proident t", "action": "cillum()", "proto": "both", "input": {} } + { "path": "fugiat dolore", "action": "sint in adipisicing", "proto": "cwmp", "input": {} } ] } ``` @@ -2370,7 +2077,7 @@ To set multiple values at once, path should be relative to object elements ### Ubus CLI Example ``` -ubus call usp.raw set {"path":"sed do voluptate minim","value":"laboris reprehenderit","transaction_id":82743032,"proto":"cwmp","values":{},"key":"elit cillum Lorem dolor nisi","instance_mode":0} +ubus call usp.raw set {"path":"aliqui","value":"","transaction_id":23221830,"proto":"usp","values":{},"key":"in consectetur sit magna","instance_mode":0} ``` ### JSONRPC Example @@ -2385,12 +2092,12 @@ ubus call usp.raw set {"path":"sed do voluptate minim","value":"laboris reprehen "usp.raw", "set", { - "path": "sed do voluptate minim", - "value": "laboris reprehenderit", - "transaction_id": 82743032, - "proto": "cwmp", + "path": "aliqui", + "value": "", + "transaction_id": 23221830, + "proto": "usp", "values": {}, - "key": "elit cillum Lorem dolor nisi", + "key": "in consectetur sit magna", "instance_mode": 0 } ] @@ -2464,11 +2171,6 @@ Unknown type ``. "type": "string", "enum": ["0", "1"] }, - "notify_type_t": { - "type": "string", - "description": "Notification type as per libbbf", - "enum": ["0", "1", "2", "3", "4", "5", "6"] - }, "operate_path_t": { "description": "Datamodel object schema path", "type": "string", @@ -2525,7 +2227,7 @@ Unknown type ``. "maximum": 9050 } }, - "out": "{\"oneof\":[{\"status\":\"1\"},{\"parameters\":[{\"path\":\"minim sunt ut ipsum\",\"status\":\"0\",\"fault\":8050}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.Bridging.Bridge.{i}.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.{i}.SSID\"]},\"boolean_t\":{\"type\":\"string\",\"enum\":[\"0\",\"1\"]},\"notify_type_t\":{\"type\":\"string\",\"description\":\"Notification type as per libbbf\",\"enum\":[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"]},\"operate_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.DHCPv4.Client.{i}.Renew()\",\"Device.FactoryReset()\"]},\"operate_type_t\":{\"type\":\"string\",\"enum\":[\"async\",\"sync\"]},\"query_path_t\":{\"description\":\"DM object path with search queries\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.[SSID==\\\"test_ssid\\\"].BSSID\",\"Device.WiFi.SSID.*.BSSID\",\"Device.WiFi.SSID.[SSID!=\\\"test_ssid\\\"&&Enable==1].BSSID\",\"Device.WiFi.\"]},\"instance_t\":{\"description\":\"Multi object instances\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256},\"proto_t\":{\"type\":\"string\",\"default\":\"both\",\"enum\":[\"usp\",\"cwmp\",\"both\"]},\"type_t\":{\"type\":\"string\",\"enum\":[\"xsd:string\",\"xsd:unsignedInt\",\"xsd:int\",\"xsd:unsignedLong\",\"xsd:long\",\"xsd:boolean\",\"xsd:dateTime\",\"xsd:hexBinary\",\"xsd:object\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", + "out": "{\"oneof\":[{\"status\":\"1\"},{\"parameters\":[{\"path\":\"labore et sit dolor sunt\",\"status\":\"0\",\"fault\":7485}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.Bridging.Bridge.{i}.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.{i}.SSID\"]},\"boolean_t\":{\"type\":\"string\",\"enum\":[\"0\",\"1\"]},\"operate_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.DHCPv4.Client.{i}.Renew()\",\"Device.FactoryReset()\"]},\"operate_type_t\":{\"type\":\"string\",\"enum\":[\"async\",\"sync\"]},\"query_path_t\":{\"description\":\"DM object path with search queries\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.[SSID==\\\"test_ssid\\\"].BSSID\",\"Device.WiFi.SSID.*.BSSID\",\"Device.WiFi.SSID.[SSID!=\\\"test_ssid\\\"&&Enable==1].BSSID\",\"Device.WiFi.\"]},\"instance_t\":{\"description\":\"Multi object instances\",\"type\":\"string\",\"minLength\":6,\"maxLength\":256},\"proto_t\":{\"type\":\"string\",\"default\":\"both\",\"enum\":[\"usp\",\"cwmp\",\"both\"]},\"type_t\":{\"type\":\"string\",\"enum\":[\"xsd:string\",\"xsd:unsignedInt\",\"xsd:int\",\"xsd:unsignedLong\",\"xsd:long\",\"xsd:boolean\",\"xsd:dateTime\",\"xsd:hexBinary\",\"xsd:object\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", "simpletype": "complex" } ``` @@ -2534,7 +2236,10 @@ Unknown type ``. ```json { - "oneof": [{ "status": "1" }, { "parameters": [{ "path": "minim sunt ut ipsum", "status": "0", "fault": 8050 }] }], + "oneof": [ + { "status": "1" }, + { "parameters": [{ "path": "labore et sit dolor sunt", "status": "0", "fault": 7485 }] } + ], "definitions": { "path_t": { "description": "Complete object element path as per TR181", @@ -2551,11 +2256,6 @@ Unknown type ``. "examples": ["Device.Bridging.Bridge.{i}.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.{i}.SSID"] }, "boolean_t": { "type": "string", "enum": ["0", "1"] }, - "notify_type_t": { - "type": "string", - "description": "Notification type as per libbbf", - "enum": ["0", "1", "2", "3", "4", "5", "6"] - }, "operate_path_t": { "description": "Datamodel object schema path", "type": "string", @@ -2599,220 +2299,6 @@ Unknown type ``. } ``` -## setm_attributes - -### Set attributes of multiple objects at once - -`setm_attributes` - -- type: `Method` - -### setm_attributes Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | Optional | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| ---------------- | ------- | ------------ | -------- | -| `instance_mode` | integer | Optional | | -| `paths` | array | **Required** | | -| `proto` | string | Optional | `"both"` | -| `transaction_id` | integer | Optional | | - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -- minimum value: `0` -- maximum value: `1` - -#### paths - -`paths` - -- is **required** -- type: `array` - -##### paths Type - -Array type: `array` - -All items must be of the type: Unknown type ``. - -```json -{ - "type": "array", - "items": [ - { - "type": "object", - "required": ["path", "notify-type", "notify"], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "notify-type": { - "$ref": "#/definitions/notify_type_t" - }, - "notify": { - "$ref": "#/definitions/boolean_t" - } - } - } - ], - "simpletype": "`array`" -} -``` - -#### proto - -`proto` - -- is optional -- type: reference -- default: `"both"` - -##### proto Type - -`string` - -The value of this property **must** be equal to one of the [known values below](#setm_attributes-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -#### transaction_id - -`transaction_id` - -- is optional -- type: `integer` - -##### transaction_id Type - -`integer` - -- minimum value: `0` - -### Ubus CLI Example - -``` -ubus call usp.raw setm_attributes {"paths":[{"path":"incididunt veniam proident","notify-type":"6","notify":"0"}],"proto":"usp","instance_mode":0,"transaction_id":5570446} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "<SID>", - "usp.raw", - "setm_attributes", - { - "paths": [{ "path": "incididunt veniam proident", "notify-type": "6", "notify": "0" }], - "proto": "usp", - "instance_mode": 0, - "transaction_id": 5570446 - } - ] -} -``` - -#### output - -`output` - -- is optional -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| ------------ | ------- | -------- | -| `fault` | integer | Optional | -| `parameters` | array | Optional | - -#### fault - -`fault` - -- is optional -- type: reference - -##### fault Type - -`integer` - -- minimum value: `7000` -- maximum value: `9050` - -#### parameters - -`parameters` - -- is optional -- type: `array` - -##### parameters Type - -Array type: `array` - -All items must be of the type: Unknown type ``. - -```json -{ - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/path_t" - } - } - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ "fault": 8859, "parameters": [{ "path": "aliquip eiusmod ipsum incididunt ullamco" }] } -``` - ## setm_values ### Set values of multiple objects at once @@ -2949,7 +2435,7 @@ All items must be of the type: Unknown type ``. ### Ubus CLI Example ``` -ubus call usp.raw setm_values {"pv_tuple":[{"path":"pariatur irure voluptate Excepteur ut","value":"dolor","key":"officia commodo eiusmod"}],"transaction_id":64884117,"proto":"both","key":"sed","instance_mode":1} +ubus call usp.raw setm_values {"pv_tuple":[{"path":"pariatur in ut","value":"nostrud aute elit ipsum","key":"laboris cupidatat adipisicing qui"}],"transaction_id":86006430,"proto":"cwmp","key":"consequat Excepteur officia et","instance_mode":0} ``` ### JSONRPC Example @@ -2965,12 +2451,12 @@ ubus call usp.raw setm_values {"pv_tuple":[{"path":"pariatur irure voluptate Exc "setm_values", { "pv_tuple": [ - { "path": "pariatur irure voluptate Excepteur ut", "value": "dolor", "key": "officia commodo eiusmod" } + { "path": "pariatur in ut", "value": "nostrud aute elit ipsum", "key": "laboris cupidatat adipisicing qui" } ], - "transaction_id": 64884117, - "proto": "both", - "key": "sed", - "instance_mode": 1 + "transaction_id": 86006430, + "proto": "cwmp", + "key": "consequat Excepteur officia et", + "instance_mode": 0 } ] } @@ -3042,7 +2528,7 @@ All items must be of the type: Unknown type ``. ### Output Example ```json -{ "status": true, "parameters": [{ "path": "aliqua c", "status": false, "fault": 8313 }] } +{ "status": true, "parameters": [{ "path": "ut veniam", "status": true, "fault": 7227 }] } ``` ## transaction_abort @@ -3093,7 +2579,7 @@ All items must be of the type: Unknown type ``. ### Ubus CLI Example ``` -ubus call usp.raw transaction_abort {"transaction_id":40972802} +ubus call usp.raw transaction_abort {"transaction_id":57220780} ``` ### JSONRPC Example @@ -3103,7 +2589,7 @@ ubus call usp.raw transaction_abort {"transaction_id":40972802} "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp.raw", "transaction_abort", { "transaction_id": 40972802 }] + "params": ["<SID>", "usp.raw", "transaction_abort", { "transaction_id": 57220780 }] } ``` @@ -3148,7 +2634,7 @@ ubus call usp.raw transaction_abort {"transaction_id":40972802} ### Output Example ```json -{ "status": false, "error": "occaecat ea" } +{ "status": false, "error": "qui incididunt amet" } ``` ## transaction_commit @@ -3211,7 +2697,7 @@ ubus call usp.raw transaction_abort {"transaction_id":40972802} ### Ubus CLI Example ``` -ubus call usp.raw transaction_commit {"transaction_id":90510511,"restart_services":true} +ubus call usp.raw transaction_commit {"transaction_id":9024232,"restart_services":false} ``` ### JSONRPC Example @@ -3221,7 +2707,7 @@ ubus call usp.raw transaction_commit {"transaction_id":90510511,"restart_service "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp.raw", "transaction_commit", { "transaction_id": 90510511, "restart_services": true }] + "params": ["<SID>", "usp.raw", "transaction_commit", { "transaction_id": 9024232, "restart_services": false }] } ``` @@ -3292,7 +2778,7 @@ All items must be of the type: Unknown type ``. ### Output Example ```json -{ "status": false, "error": "sed reprehenderit", "updated_services": ["proident mollit velit"] } +{ "status": true, "error": "sit fug", "updated_services": ["pariatur elit in"] } ``` ## transaction_start @@ -3341,7 +2827,7 @@ All items must be of the type: Unknown type ``. ### Ubus CLI Example ``` -ubus call usp.raw transaction_start {"app":"esse elit"} +ubus call usp.raw transaction_start {"app":"sed adipisicing"} ``` ### JSONRPC Example @@ -3351,7 +2837,7 @@ ubus call usp.raw transaction_start {"app":"esse elit"} "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp.raw", "transaction_start", { "app": "esse elit" }] + "params": ["<SID>", "usp.raw", "transaction_start", { "app": "sed adipisicing" }] } ``` @@ -3410,7 +2896,7 @@ ubus call usp.raw transaction_start {"app":"esse elit"} ### Output Example ```json -{ "status": false, "transaction_id": 28608890, "error": "quis amet aliqua Excepteur dolor" } +{ "status": false, "transaction_id": 24672867, "error": "labore incididunt dolor" } ``` ## validate @@ -3515,7 +3001,7 @@ The value of this property **must** be equal to one of the [known values below]( ### Ubus CLI Example ``` -ubus call usp.raw validate {"path":"suntfugiat","proto":"usp"} +ubus call usp.raw validate {"path":"reprehenderit","proto":"both"} ``` ### JSONRPC Example @@ -3525,7 +3011,7 @@ ubus call usp.raw validate {"path":"suntfugiat","proto":"usp"} "jsonrpc": "2.0", "id": 0, "method": "call", - "params": ["<SID>", "usp.raw", "validate", { "path": "suntfugiat", "proto": "usp" }] + "params": ["<SID>", "usp.raw", "validate", { "path": "reprehenderit", "proto": "both" }] } ``` @@ -3580,5 +3066,5 @@ All items must be of the type: Unknown type ``. ### Output Example ```json -{ "parameters": [{ "parameter": "sed cupidatat dolore adipisicing", "fault": 7788 }] } +{ "parameters": [{ "parameter": "inreprehenderit", "fault": 8454 }] } ``` diff --git a/docs/functionspec.md b/docs/functionspec.md index 7a05e079437c4c175ba9a640733a8ac54c9aebc6..09508f09cba28362565781b6835a534291983bc6 100644 --- a/docs/functionspec.md +++ b/docs/functionspec.md @@ -17,8 +17,6 @@ root@iopsys:~# ubus -v list usp "del_object":{"path":"String","proto":"String","key":"String"} "getm_values":{"paths":"Array","proto":"String","next-level":"Boolean"} "getm_names":{"paths":"Array","proto":"String","next-level":"Boolean"} - "getm_attributes":{"paths":"Array","proto":"String","next-level":"Boolean"} - "setm_attributes":{"paths":"Array","proto":"String"} root@iopsys:~# root@iopsys:~# ubus -v list usp.raw 'usp.raw' @ff9d104b @@ -34,8 +32,6 @@ root@iopsys:~# ubus -v list usp.raw "del_object":{"path":"String","proto":"String","key":"String"} "getm_values":{"paths":"Array","proto":"String","next-level":"Boolean"} "getm_names":{"paths":"Array","proto":"String","next-level":"Boolean"} - "getm_attributes":{"paths":"Array","proto":"String","next-level":"Boolean"} - "setm_attributes":{"paths":"Array","proto":"String"} ``` @@ -64,8 +60,6 @@ An object that publishes device information. "del_object":{"path":"String","proto":"String","key":"String"} "getm_values":{"paths":"Array","proto":"String","next-level":"Boolean"} "getm_names":{"paths":"Array","proto":"String","next-level":"Boolean"} - "getm_attributes":{"paths":"Array","proto":"String","next-level":"Boolean"} - "setm_attributes":{"paths":"Array","proto":"String"} ```` | Method |Function ID | @@ -82,8 +76,6 @@ An object that publishes device information. | [del_object](#del_object) | 10 | | [getm_values](#getm_values) | 11 | | [getm_names](#getm_names) | 12 | -| [getm_attributes](#getm_attribues) | 13 | -| [setm_attributes](#setm_attribues) | 14 | #### Methods @@ -161,16 +153,6 @@ An extension to get method, this method can be use to get names parameter for mu * [getm_names documentation](./api/usp.md#getm_names) -##### getm_attributes - -Get attribues for multiple query paths at once. -* [getm_attributes documentation](./api/usp.md#getm_attributes) - -##### setm_attributes - -Set attribues for multiple query paths at once. -* [setm_attributes documentation](./api/usp.md#setm_attributes) - ### usp.raw Object for device functionality. One object per device will be published to @@ -189,8 +171,6 @@ ubus. "del_object":{"path":"String","proto":"String","key":"String"} "getm_values":{"paths":"Array","proto":"String","next-level":"Boolean"} "getm_names":{"paths":"Array","proto":"String","next-level":"Boolean"} - "getm_attributes":{"paths":"Array","proto":"String","next-level":"Boolean"} - "setm_attributes":{"paths":"Array","proto":"String"} ```` @@ -208,8 +188,6 @@ ubus. | [del_object](#del_object_raw) | 10 | | [getm_values](#getm_values_raw) | 11 | | [getm_names](#getm_names_raw) | 12 | -| [getm_attributes](#getm_attribues_raw) | 13 | -| [setm_attributes](#setm_attribues_raw) | 14 | #### Methods @@ -287,13 +265,3 @@ An extension to get method, this method can be use to get names parameter for mu * [getm_names documentation](./api/usp.raw.md#getm_names) -##### getm_attributes_raw - -Get attribues for multiple query paths at once. -* [getm_attributes documentation](./api/usp.raw.md#getm_attributes) - -##### setm_attributes_raw - -Set attribues for multiple query paths at once. -* [setm_attributes documentation](./api/usp.raw.md#setm_attributes) - diff --git a/docs/testspec.md b/docs/testspec.md index 6296cdaf3c326d883f493bad39c976971501b737..9f01362842c8a461db04102efb1dd2b4af53ea18 100644 --- a/docs/testspec.md +++ b/docs/testspec.md @@ -53,8 +53,6 @@ libubus, and validates it against the objects json-schema. | 10 | del_object | With path argument | [10](./functionspec.md#del_object) | | 11 | getm_values | With paths array argument | [11](./functionspec.md#getm_values) | | 12 | getm_name | With paths array argument | [12](./functionspec.md#getm_names) | -| 13 | getm_attributes| With paths array argument | [13](./functionspec.md#getm_attributes) | -| 14 | setm_attributes| With paths array argument | [14](./functionspec.md#setm_attributes) | #### usp.raw @@ -72,8 +70,6 @@ libubus, and validates it against the objects json-schema. | 10 | del_object | With path argument | [24](./functionspec.md#del_object_raw) | | 11 | getm_values | With paths array argument | [25](./functionspec.md#getm_values_raw) | | 12 | getm_name | With paths array argument | [26](./functionspec.md#getm_names_raw) | -| 13 | getm_attributes| With paths array argument | [27](./functionspec.md#getm_attributes_raw) | -| 14 | setm_attributes| With paths array argument | [28](./functionspec.md#setm_attributes_raw) | ### Unit Tests @@ -97,8 +93,6 @@ This means mocking the arguments of a cli or libubus invoke in a | 10 | del_object | [test_api_usp_del](#test_api_usp_del_object) | [10](./functionspec.md#del_object) | | 11 | getm_values | [test_api_usp_get_safe_values](#test_api_usp_get_safe_values) | [11](./functionspec.md#getm_values) | | 12 | getm_name | [test_api_usp_get_safe_names](#test_api_usp_get_safe_names) | [12](./functionspec.md#getm_names) | -| 13 | getm_attributes | [test_api_usp_get_safe_attr](#test_api_usp_get_safe_attr) | [13](./functionspec.md#getm_attributes) | -| 14 | setm_attributes | [test_api_usp_raw_set_safe](#test_api_usp_raw_set_safe) | [14](./functionspec.md#setm_attributes) | #### test_api_usp_dump_schema diff --git a/schemas/ubus/usp.json b/schemas/ubus/usp.json index 42573fbd52c6b86b484926556515ac5b8c80b35a..d224eb57517d0b0e5c66addb1a09954474da0367 100644 --- a/schemas/ubus/usp.json +++ b/schemas/ubus/usp.json @@ -30,19 +30,6 @@ "1" ] }, - "notify_type_t": { - "type": "string", - "description": "Notification type as per libbbf", - "enum": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6" - ] - }, "operate_path_t": { "description": "Datamodel object schema path", "type": "string", diff --git a/schemas/ubus/usp.raw.json b/schemas/ubus/usp.raw.json index 2504e761e4cb71e079df96802b2a03db113ea2ad..0b669c4bbfeb3bdfc8f6173f6d0248fb297fead0 100644 --- a/schemas/ubus/usp.raw.json +++ b/schemas/ubus/usp.raw.json @@ -30,19 +30,6 @@ "1" ] }, - "notify_type_t": { - "type": "string", - "description": "Notification type as per libbbf", - "enum": [ - "0", - "1", - "2", - "3", - "4", - "5", - "6" - ] - }, "operate_path_t": { "description": "Datamodel object schema path", "type": "string",