diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 77a75f99..028e766f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,7 @@ variables: DEBUG: 'TRUE' SOURCE_FOLDER: "." COMMON_IMAGE: dev.iopsys.eu:5050/iopsys/gitlab-ci-pipeline/code-analysis:0.27 - RUN_CPPCHECK: "cppcheck --enable=information --error-exitcode=1 -DBBFDM_ENABLE_DOTSO_PLUGIN -DBBFDM_ENABLE_DOTSO_PLUGIN -DBBF_TR181 -DBBF_VENDOR_IOPSYS -DBBF_VENDOR_OPENWRT --inline-suppr -i test/" + RUN_CPPCHECK: "cppcheck --enable=information --error-exitcode=1 -DBBFDM_ENABLE_DOTSO_PLUGIN -DBBFDM_ENABLE_DOTSO_PLUGIN -DBBF_TR181 -DBBF_VENDOR_IOPSYS --inline-suppr -i test/" stages: - static_code_analysis diff --git a/README.md b/README.md index 2f38b745..2c00e9b6 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ This package comprises of the below libraries: │   ├── tr181 │   └── vendor │   ├── iopsys -│   ├── openwrt │   └── vendor.h ├── libbbf_api ├── scripts diff --git a/bbfd/LICENSE b/bbfd/LICENSE deleted file mode 100644 index 0d6eff4c..00000000 --- a/bbfd/LICENSE +++ /dev/null @@ -1,308 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - uspd - USP Daemon exposing USP API over uBus - Copyright (C) 2019 iopsys Software Solutions AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/bbfd/Makefile b/bbfd/Makefile index 2df283ce..f1bf9f94 100644 --- a/bbfd/Makefile +++ b/bbfd/Makefile @@ -1,25 +1,58 @@ -all: - make -C src all +PROG = uspd +OBJS =common.o get.o get_helper.o set.o operate.o add_delete.o pretty_print.o usp.o events.o +CP=cp -f -uspd: - make -C src uspd +PROG_CFLAGS = $(CFLAGS) \ + -fstrict-aliasing \ + -Wall -Wextra -Werror \ + -Wformat \ + -Wformat-signedness -fPIC -test: - make -C src test +PROG_LDFLAGS = $(LDFLAGS) +PROG_LDFLAGS += -luci -lubus -lubox -ljson-c -lblobmsg_json -lbbfdm -unit-test: - make -C test/cmocka unit-test USPD_LIB_DIR=$(PWD) +ifeq ($(USE_MBEDTLS),yes) +PROG_LDFLAGS += -lmbedcrypto -lmbedtls +endif -func-test: - make -C src func-test +ifeq ($(USE_OPENSSL),yes) +PROG_LDFLAGS += -lssl -lcrypto +endif +ifeq ($(USE_WOLFSSL),yes) +PROG_LDFLAGS += -lwolfssl +endif + +%.o: %.c + $(CC) $(PROG_CFLAGS) -c -o $@ $< + +all: ${PROG} + +${PROG}: $(OBJS) + $(CC) $(PROG_CFLAGS) -o $@ $^ $(PROG_LDFLAGS) + $(CP) ${PROG} ../${PROG} + +test: PROG_CFLAGS += -fPIC +test: ${OBJS} + ${CC} $(PROG_CFLAGS) -shared -o libuspd.so ${OBJS} $(PROG_LDFLAGS) + $(CP) libuspd.so ../libuspd.so + +unit-test: CFLAGS += -g -O0 -fprofile-arcs -ftest-coverage +unit-test: LDFLAGS += --coverage +unit-test: clean_objs +unit-test: test + make -C ../test/cmocka unit-test USPD_LIB_DIR=$(PWD) + +func-test: CFLAGS += -g -O0 -fprofile-arcs -ftest-coverage +func-test: LDFLAGS += --coverage +func-test: clean_objs +func-test: ${PROG} + +clean_objs: + rm -f *.o clean: - make -C src clean - make -C test/cmocka clean - rm -f uspd + rm -f *.o libuspd.so $(PROG) + rm -f *.xml *.html find -name '*.gcda' -exec rm {} -fv \; find -name '*.gcno' -exec rm {} -fv \; find -name '*.gcov' -exec rm {} -fv \; - find -name '*.so' -exec rm {} -fv \; - rm -f *.log *.xml - rm -rf report diff --git a/bbfd/README.md b/bbfd/README.md deleted file mode 100644 index e06fc95b..00000000 --- a/bbfd/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# USP Daemon (uspd) - -`uspd` is data-model daemon which exposes data-model objects over ubus as required -by [TR-069/cwmp](https://cwmp-data-models.broadband-forum.org/) or [TR-369/USP](https://usp.technology/), -`uspd` also understand [USP syntax](https://usp.technology/specification/architecture/) as defined in R-ARC.7 - R-ARC.12 -and provide details for data-model queries. - -> Note 1: The command outputs shown in this readme are examples only, actual output may differ based on device and configuration. - -> Note 2: Long command outputs are compressed for better readability - -## Project Components - -Project consists of following components: - -- Application itself written in C programming language -- Documentation in a Markdown format - -## Build Instructions - -`uspd` is written using C programming language and depends on a number of components found in `OpenWrt` for building and running. - -## UCI Config - -`uspd` requires a configuration file to provide more granular objects over `ubus`. -Granularity is an optional feature of `uspd`, it can be skipped or set to level 0. -The configuration file is an `uci` file `/etc/config/uspd`. Sample configuration file is provided below. - -```bash -config uspd 'usp' - option granularitylevel '0' - option debug 'true' - option loglevel '2' - option sock '/tmp/usp.sock' - option transaction_timeout 60 - option subprocess_level '1' - option refresh_time '5' -``` - -In the above uci, loglevel can have below value: - -|loglevel | Meaning | -|---------| -----------------------------------------| -| 0 | Disabled logging | -| 1 | Only errors will be logged | -| 2 | Only errors and warnings will be logged | -| 3 | Log everything except debug | -| 4 | Everything will be logged | - -For more info on the `uspd` UCI configuration visit [uci documentation](./docs/api/uci/uspd.md) OR [raw uci schema](https://dev.iopsys.eu/iopsys/uspd/-/tree/module_docs/schemas/uci/uspd.json) - -## Concepts and Workflow - -`uspd` internally uses `libbbfdm` to get the data-model objects. On startup it parses the uci file to check if the granularity is set and then as per the granularity value it registers the required ubus namespaces. - -When a ubus method is called it first checks the `path` parameter to identify if it has special USP syntax, if present it parses and determine the correct objects from `libbbfdm`, then proceeds with the `Get/Set/Operate/Add/Del` operation on the qualified objects. - -So, `uspd` search for `[[+*]+` in path expression, if it matches then segments the path and get the schema from `libbbfdm` and store it in a link-list, then it proceeds with the next segment to filter out the unneeded schema paths. It keeps on doing so till all the expressions are solved and it finally left with qualified objects. -Once all the expressions are solved, it starts getting the values for qualified objects and store it in a `stack` to print the output in pretty format. - -For operate command, it solve the path expression and then call `bbf_operate` from `libbbfdm` to execute the operate command. - -`uspd` uses `dm_entry_param_method` API from `libbbfdm` to get the device tree schema and it's values. - -In short, it covers/supports the new syntax introduced in `TR-369` by using the existing data-model available with `libbbfdm`. - - -## Important topics -* [UBUS methods](./docs/guide/ubus_methods.md) -* [UBUS Errors](./docs/guide/ubus_errors.md) -* [UBUS examples](./docs/guide/ubus_example.md) -* [Parallel UBUS call](./docs/guide/ubus_parallel_call.md) -* [Third party datamodel integration](./docs/guide/data_model_integration.md) - - -## Dependencies - -### Build-Time Dependencies - -To successfully build uspd, following libraries are needed: - -| Dependency | Link | License | -| ---------- | ------------------------------------------- | -------------- | -| libuci | https://git.openwrt.org/project/uci.git | LGPL 2.1 | -| libubox | https://git.openwrt.org/project/libubox.git | BSD | -| libubus | https://git.openwrt.org/project/ubus.git | LGPL 2.1 | -| libjson-c | https://s3.amazonaws.com/json-c_releases | MIT | -| libbbfdm | https://dev.iopsys.eu/iopsys/bbf.git | LGPL 2.1 | - - -### Run-Time Dependencies - -In order to run the `uspd`, following dependencies are needed to be running/available before `uspd`. - -| Dependency | Link | License | -| ---------- | ---------------------------------------- | -------- | -| ubusd | https://git.openwrt.org/project/ubus.git | LGPL 2.1 | -| libbbfdm | https://dev.iopsys.eu/iopsys/bbf.git | LGPL 2.1 | - -System daemon `ubusd` is used to expose the USP functionality over `ubus`. diff --git a/bbfd/src/add_delete.c b/bbfd/add_delete.c similarity index 100% rename from bbfd/src/add_delete.c rename to bbfd/add_delete.c diff --git a/bbfd/src/add_delete.h b/bbfd/add_delete.h similarity index 100% rename from bbfd/src/add_delete.h rename to bbfd/add_delete.h diff --git a/bbfd/src/common.c b/bbfd/common.c similarity index 100% rename from bbfd/src/common.c rename to bbfd/common.c diff --git a/bbfd/src/common.h b/bbfd/common.h similarity index 100% rename from bbfd/src/common.h rename to bbfd/common.h diff --git a/bbfd/docs/.pages b/bbfd/docs/.pages deleted file mode 100644 index 0f676761..00000000 --- a/bbfd/docs/.pages +++ /dev/null @@ -1,7 +0,0 @@ -title: "USP Daemon Documentation" - -nav: - - "api" - - "guide" - - "spec" - - "..." diff --git a/bbfd/docs/api/.pages b/bbfd/docs/api/.pages deleted file mode 100644 index 20f788a4..00000000 --- a/bbfd/docs/api/.pages +++ /dev/null @@ -1,6 +0,0 @@ -title: "USP Daemon API" - -nav: - - "ubus" - - "uci" - - "..." diff --git a/bbfd/docs/api/ubus/.pages b/bbfd/docs/api/ubus/.pages deleted file mode 100644 index 853bfe51..00000000 --- a/bbfd/docs/api/ubus/.pages +++ /dev/null @@ -1,4 +0,0 @@ -title: "USP Daemon UBUS" - -nav: - - "..." diff --git a/bbfd/docs/api/ubus/usp.md b/bbfd/docs/api/ubus/usp.md deleted file mode 100644 index 0a357f10..00000000 --- a/bbfd/docs/api/ubus/usp.md +++ /dev/null @@ -1,3162 +0,0 @@ -# usp Schema - -``` -https://dev.iopsys.eu/iopsys/uspd/-/blob/devel/docs/api/ubus/usp.md -``` - -| Custom Properties | Additional Properties | -| ----------------- | --------------------- | -| Forbidden | Forbidden | - -# usp - -| List of Methods | -| ------------------------------------- | -| [add_object](#add_object) | Method | usp (this schema) | -| [del_object](#del_object) | Method | usp (this schema) | -| [get](#get) | Method | usp (this schema) | -| [get_supported_dm](#get_supported_dm) | Method | usp (this schema) | -| [instances](#instances) | Method | usp (this schema) | -| [list_operate](#list_operate) | Method | usp (this schema) | -| [object_names](#object_names) | Method | usp (this schema) | -| [operate](#operate) | Method | usp (this schema) | -| [set](#set) | Method | usp (this schema) | -| [validate](#validate) | Method | usp (this schema) | - -## add_object - -### Add a new object instance - -Add a new object in multi instance object - -`add_object` - -- type: `Method` - -### add_object Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance_mode` | integer | Optional | | -| `key` | string | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -- minimum value: `0` -- maximum value: `1` - -#### key - -`key` - -- is optional -- type: `string` - -##### key Type - -`string` - -#### path - -Complete object element path as per TR181 - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.1. -``` - -```json -Device.WiFi. -``` - -#### 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](#add_object-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp add_object {"path":"in dolore nul","proto":"usp","instance_mode":1} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp", - "add_object", - { "path": "in dolore nul", "proto": "usp", "instance_mode": 1 } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| ------------ | ----- | ------------ | -| `parameters` | array | **Required** | - -#### parameters - -`parameters` - -- is **required** -- type: `object[]` - -##### parameters Type - -Array type: `object[]` - -All items must be of the type: `object` with following properties: - -| Property | Type | Required | -| ----------- | ------- | ------------ | -| `fault` | integer | Optional | -| `instance` | string | Optional | -| `parameter` | string | **Required** | -| `status` | boolean | **Required** | - -#### fault - -`fault` - -- is optional -- type: reference - -##### fault Type - -`integer` - -- minimum value: `7000` -- maximum value: `9050` - -#### instance - -`instance` - -- is optional -- type: `string` - -##### instance Type - -`string` - -#### parameter - -Complete object element path as per TR181 - -`parameter` - -- is **required** -- type: reference - -##### parameter Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### parameter Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.1. -``` - -```json -Device.WiFi. -``` - -#### status - -`status` - -- is **required** -- type: `boolean` - -##### status Type - -`boolean` - -### Output Example - -```json -{ - "parameters": [ - { "parameter": "consequat", "status": false, "instance": "occaecat sit con", "fault": 8804 }, - { "parameter": "mollit proident nisi est commodo", "status": false, "instance": "sunt ut nisi", "fault": 7496 }, - { "parameter": "et irure ut incididunt", "status": true, "instance": "minim", "fault": 7873 }, - { "parameter": "occaecat sint eu", "status": false, "instance": "est aliqua voluptate cillum", "fault": 7743 }, - { "parameter": "Ut repr", "status": true, "instance": "velit voluptate in", "fault": 7418 } - ] -} -``` - -## del_object - -### Delete object instance - -Delete a object instance from multi instance object - -`del_object` - -- type: `Method` - -### del_object Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance_mode` | integer | Optional | | -| `key` | string | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -- minimum value: `0` -- maximum value: `1` - -#### key - -`key` - -- is optional -- type: `string` - -##### key Type - -`string` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#del_object-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp del_object {"path":"ea amet qui et culp","proto":"usp",instance_mode":0} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp", - "del_object", - { "path": "ea amet qui et culp", "proto": "usp", "instance_mode": 0 } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| ------------ | ----- | ------------ | -| `parameters` | array | **Required** | - -#### parameters - -`parameters` - -- is **required** -- type: `object[]` - -##### parameters Type - -Array type: `object[]` - -All items must be of the type: `object` with following properties: - -| Property | Type | Required | -| ----------- | ------- | ------------ | -| `fault` | integer | Optional | -| `parameter` | string | **Required** | -| `status` | boolean | **Required** | - -#### fault - -`fault` - -- is optional -- type: reference - -##### fault Type - -`integer` - -- minimum value: `7000` -- maximum value: `9050` - -#### parameter - -Complete object element path as per TR181 - -`parameter` - -- is **required** -- type: reference - -##### parameter Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### parameter Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.1. -``` - -```json -Device.WiFi. -``` - -#### status - -`status` - -- is **required** -- type: `boolean` - -##### status Type - -`boolean` - -### Output Example - -```json -{ - "parameters": [ - { "parameter": "culpaconsectetur proident voluptate", "status": true, "fault": 7084 }, - { "parameter": "auteofficia", "status": false, "fault": 8637 }, - { "parameter": "eu occaecat cillum laborum", "status": true, "fault": 7337 }, - { "parameter": "irure adipisicing", "status": true, "fault": 8214 } - ] -} -``` - -## get - -### Get handler - -Query the datamodel object - -`get` - -- type: `Method` - -### get Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance-mode` | integer | Optional | | -| `maxdepth` | integer | Optional | | -| `next-level` | boolean | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance-mode - -`instance-mode` - -- is optional -- type: `integer` - -##### instance-mode Type - -`integer` - -#### maxdepth - -Integer to decide the depth of data model to be parsed - -`maxdepth` - -- is optional -- type: `integer` - -##### maxdepth Type - -`integer` - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#get-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp get {"path":"adipisicing aliqua","proto":"both","maxdepth":-13721201,"next-level":true,"instance-mode":-25889726} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp", - "get", - { - "path": "adipisicing aliqua", - "proto": "both", - "maxdepth": -13721201, - "next-level": true, - "instance-mode": -25889726 - } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code in fault_t" - } - }, - { - "type": "object", - "properties": {}, - "examples": [ - "root@iopsys:/tmp# ubus call usp get '{\"path\":\"Device.Users.User.2.\"}'\n{\n\t\"User\": [\n\t\t{\n\t\t\t\"Alias\": \"\",\n\t\t\t\"Enable\": true,\n\t\t\t\"Language\": \"\",\n\t\t\t\"Password\": \"\",\n\t\t\t\"RemoteAccessCapable\": false,\n\t\t\t\"Username\": \"user_2\"\n\t\t}\n\t]\n}", - "root@iopsys:/tmp# ubus call usp get '{\"path\":\"Device.Users.\"}'\n{\n\t\"Users\": {\n\t\t\"User\": [\n\t\t\t{\n\t\t\t\t\"Alias\": \"\",\n\t\t\t\t\"Enable\": true,\n\t\t\t\t\"Language\": \"\",\n\t\t\t\t\"Password\": \"\",\n\t\t\t\t\"RemoteAccessCapable\": true,\n\t\t\t\t\"Username\": \"user\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Alias\": \"\",\n\t\t\t\t\"Enable\": true,\n\t\t\t\t\"Language\": \"\",\n\t\t\t\t\"Password\": \"\",\n\t\t\t\t\"RemoteAccessCapable\": false,\n\t\t\t\t\"Username\": \"user_2\"\n\t\t\t}\n\t\t],\n\t\t\"UserNumberOfEntries\": 2\n\t}\n}" - ] - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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\":[{\"fault\":8504},{}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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" -} -``` - -### Output Example - -```json -{ - "oneof": [{ "fault": 8504 }, {}], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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 } - } -} -``` - -## get_supported_dm - -### Get list of supported datamodel parameters - -Schema will have all the nodes/objects supported by libbbf - -`get_supported_dm` - -- type: `Method` - -### get_supported_dm Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | Optional | -| `output` | | **Required** | - -#### input - -`input` - -- is optional -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| ------------- | ------- | -------- | -| `next-level` | boolean | Optional | -| `path` | string | Optional | -| `schema_type` | integer | Optional | - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### path - -DM object path with search queries - -`path` - -- is optional -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### schema_type - -0-All, 1-Parameter only 2- Event only 3- operate only - -`schema_type` - -- is optional -- type: `integer` - -##### schema_type Type - -`integer` - -- minimum value: `0` -- maximum value: `3` - -### Ubus CLI Example - -``` -ubus call usp get_supported_dm {"path":"cupidatat mollit do off","next-level":false,"schema_type":0} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp", - "get_supported_dm", - { "path": "cupidatat mollit do off", "next-level": false, "schema_type": 0 } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": ["parameter", "type", "writable"], - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "cmd_type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - }, - "out": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - } - } - } - ] - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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\":[{\"fault\":8131},{\"parameters\":[{\"parameter\":\"Lorem eu dolor\",\"type\":\"xsd:object\",\"writable\":\"0\",\"cmd_type\":\"async\",\"in\":[\"reprehenderit consectetur mollit dolor\"],\"out\":[\"sed proident et magna pariatur\"]}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "fault": 8131 }, - { - "parameters": [ - { - "parameter": "Lorem eu dolor", - "type": "xsd:object", - "writable": "0", - "cmd_type": "async", - "in": ["reprehenderit consectetur mollit dolor"], - "out": ["sed proident et magna pariatur"] - } - ] - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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 } - } -} -``` - -## instances - -### Instance query handler - -Get the instances of multi object - -`instances` - -- type: `Method` - -### instances Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance-mode` | integer | Optional | | -| `maxdepth` | integer | Optional | | -| `next-level` | boolean | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance-mode - -`instance-mode` - -- is optional -- type: `integer` - -##### instance-mode Type - -`integer` - -#### maxdepth - -Integer to decide the depth of data model to be parsed - -`maxdepth` - -- is optional -- type: `integer` - -##### maxdepth Type - -`integer` - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#instances-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp instances {"path":"veniam ex fugiat","proto":"cwmp","maxdepth":72958357,"next-level":true,"instance-mode":-75752298} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp", - "instances", - { - "path": "veniam ex fugiat", - "proto": "cwmp", - "maxdepth": 72958357, - "next-level": true, - "instance-mode": -75752298 - } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code in fault_t" - } - }, - { - "type": "object", - "required": ["parameters"], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/instance_t" - } - } - } - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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\":[{\"fault\":7958},{\"parameters\":[{\"parameter\":\"magna dolor ess\"},{\"parameter\":\"exidut in cillum\"},{\"parameter\":\"adipisicing Ut\"},{\"parameter\":\"in dolore in irure\"}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "fault": 7958 }, - { - "parameters": [ - { "parameter": "magna dolor ess" }, - { "parameter": "exidut in cillum" }, - { "parameter": "adipisicing Ut" }, - { "parameter": "in dolore in irure" } - ] - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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 } - } -} -``` - -## list_operate - -### List down supported usp operate commands - -Commands will be shown in schema format - -`list_operate` - -- type: `Method` - -### list_operate 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 | -| -------- | ---- | -------- | -| None | None | None | - -### Ubus CLI Example - -``` -ubus call usp list_operate {} -``` - -### JSONRPC Example - -```json -{ "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["", "usp", "list_operate", {}] } -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| ------------ | ----- | ------------ | -| `parameters` | array | **Required** | - -#### parameters - -`parameters` - -- is **required** -- type: `object[]` - -##### parameters Type - -Array type: `object[]` - -All items must be of the type: `object` with following properties: - -| Property | Type | Required | -| ----------- | ------ | ------------ | -| `in` | array | Optional | -| `out` | array | Optional | -| `parameter` | string | **Required** | -| `type` | string | **Required** | - -#### in - -`in` - -- is optional -- type: `string[]` - -##### in Type - -Array type: `string[]` - -All items must be of the type: `string` - -#### out - -`out` - -- is optional -- type: `string[]` - -##### out Type - -Array type: `string[]` - -All items must be of the type: `string` - -#### parameter - -Datamodel object schema path - -`parameter` - -- is **required** -- type: reference - -##### parameter Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### parameter Examples - -```json -Device.DHCPv4.Client.{i}.Renew() -``` - -```json -Device.FactoryReset() -``` - -#### type - -`type` - -- is **required** -- type: reference - -##### type Type - -`string` - -The value of this property **must** be equal to one of the [known values below](#list_operate-known-values). - -##### type Known Values - -| Value | -| ----- | -| async | -| sync | - -### Output Example - -```json -{ - "parameters": [ - { - "parameter": "incididunt occaecat", - "type": "async", - "in": ["sed magna", "in", "exercitation ut culpa"], - "out": ["fugiat eu in officia"] - } - ] -} -``` - -## object_names - -### Get objects names - -Get names of all the objects below input object path - -`object_names` - -- type: `Method` - -### object_names Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance-mode` | integer | Optional | | -| `maxdepth` | integer | Optional | | -| `next-level` | boolean | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance-mode - -`instance-mode` - -- is optional -- type: `integer` - -##### instance-mode Type - -`integer` - -#### maxdepth - -Integer to decide the depth of data model to be parsed - -`maxdepth` - -- is optional -- type: `integer` - -##### maxdepth Type - -`integer` - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#object_names-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp object_names {"path":"ullamco","proto":"cwmp","maxdepth":6964414,"next-level":true,"instance-mode":-14339037} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp", - "object_names", - { "path": "ullamco", "proto": "cwmp", "maxdepth": 6964414, "next-level": true, "instance-mode": -14339037 } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code in fault_t" - } - }, - { - "type": "object", - "required": ["parameters"], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": { - "$ref": "#/definitions/type_t" - }, - "required": ["parameter", "type", "writable"], - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - } - } - } - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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\":[{\"fault\":8049},{\"parameters\":[{\"type\":\"xsd:int\",\"required\":[\"parameter\",\"type\",\"writable\"],\"writable\":\"0\",\"properties\":{\"parameter\":\"dolore sint\"}},{\"type\":\"xsd:string\",\"required\":[\"parameter\",\"type\",\"writable\"],\"writable\":\"0\",\"properties\":{\"parameter\":\"ipsum Duis do sunt\"}},{\"type\":\"xsd:hexBinary\",\"required\":[\"parameter\",\"type\",\"writable\"],\"writable\":\"1\",\"properties\":{\"parameter\":\"dolore\"}},{\"type\":\"xsd:unsignedLong\",\"required\":[\"parameter\",\"type\",\"writable\"],\"writable\":\"1\",\"properties\":{\"parameter\":\"esse proident aliqua\"}},{\"type\":\"xsd:boolean\",\"required\":[\"parameter\",\"type\",\"writable\"],\"writable\":\"1\",\"properties\":{\"parameter\":\"labore fugiat\"}}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "fault": 8049 }, - { - "parameters": [ - { - "type": "xsd:int", - "required": ["parameter", "type", "writable"], - "writable": "0", - "properties": { "parameter": "dolore sint" } - }, - { - "type": "xsd:string", - "required": ["parameter", "type", "writable"], - "writable": "0", - "properties": { "parameter": "ipsum Duis do sunt" } - }, - { - "type": "xsd:hexBinary", - "required": ["parameter", "type", "writable"], - "writable": "1", - "properties": { "parameter": "dolore" } - }, - { - "type": "xsd:unsignedLong", - "required": ["parameter", "type", "writable"], - "writable": "1", - "properties": { "parameter": "esse proident aliqua" } - }, - { - "type": "xsd:boolean", - "required": ["parameter", "type", "writable"], - "writable": "1", - "properties": { "parameter": "labore fugiat" } - } - ] - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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 } - } -} -``` - -## operate - -### Operate handler - -Operate on object element provided in path - -`operate` - -- type: `Method` - -### operate Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `action` | string | **Required** | | -| `input` | object | Optional | | -| `instance-mode` | integer | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### action - -Opreate command as defined in TR-369, TR-181-2.13 - -`action` - -- is **required** -- type: `string` - -##### action Type - -`string` - -All instances must conform to this regular expression - -```regex -[a-zA-Z]+\(\) -``` - -- test example: - [{&quot;path&quot;:&quot;Device.WiFi.&quot;, &quot;action&quot;:&quot;Reset\(\)&quot;}]() - -##### action Example - -```json -{ "path": "Device.WiFi.", "action": "Reset()" } -``` - -#### input - -Input arguments for the operate command as defined in TR-181-2.13 - -`input` - -- is optional -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ---- | -------- | -| None | None | None | - -##### input Example - -```json -{ "path": "Device.IP.Diagnostics", "action": "IPPing()", "input": { "Host": "iopsys.eu" } } -``` - -#### instance-mode - -`instance-mode` - -- is optional -- type: `integer` - -##### instance-mode Type - -`integer` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#operate-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp operate {"path":"nullaea aliquip","action":"MFy()","proto":"usp","instance-mode":21204540,"input":{}} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp", - "operate", - { "path": "nullaea aliquip", "action": "MFy()", "proto": "usp", "instance-mode": 21204540, "input": {} } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code in fault_t" - } - }, - { - "description": "Output will have status for sync commands and for async commands parameters as defined in TR-181-2.13", - "type": "object", - "required": ["Results"], - "properties": { - "Results": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "result": { - "type": "array", - "items": { - "type": "object", - "properties": { - "Result": { - "type": "string", - "Description": "Success or Failure" - } - } - } - } - } - } - } - }, - "examples": [ - "{\n\t\"status\": true}", - "{\n\t\"AverageResponseTime\": \"0\",\n\t\"AverageResponseTimeDetailed\": \"130\",\n\t\"FailureCount\": \"0\",\n\t\"MaximumResponseTime\": \"0\",\n\t\"MaximumResponseTimeDetailed\": \"140\",\n\t\"MinimumResponseTime\": \"0\",\n\t\"MinimumResponseTimeDetailed\": \"120\",\n\t\"SuccessCount\": \"3\"}" - ] - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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\":[{\"fault\":7934},{\"Results\":[{\"path\":\"nisi quis fugi\",\"result\":[{\"Result\":\"adipisicing consequat sunt laborum\"}]},{\"path\":\"in Excepteur exerci\",\"result\":[{\"Result\":\"aliqua ullamco laborum irure\"},{\"Result\":\"sed\"},{\"Result\":\"ullamco do occae\"}]}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "fault": 7934 }, - { - "Results": [ - { "path": "nisi quis fugi", "result": [{ "Result": "adipisicing consequat sunt laborum" }] }, - { - "path": "in Excepteur exerci", - "result": [ - { "Result": "aliqua ullamco laborum irure" }, - { "Result": "sed" }, - { "Result": "ullamco do occae" } - ] - } - ] - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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 } - } -} -``` - -## set - -### Set handler - -Set values of datamodel object element - -`set` - -- type: `Method` - -### set Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance_mode` | integer | Optional | | -| `key` | string | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | -| `value` | string | **Required** | | -| `values` | object | Optional | | - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -- minimum value: `0` -- maximum value: `1` - -#### key - -`key` - -- is optional -- type: `string` - -##### key Type - -`string` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#set-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -#### value - -value of the object element provided in path, path should contains valid writable object element - -`value` - -- is **required** -- type: `string` - -##### value Type - -`string` - -##### value Examples - -```json -{ "path": "Device.WiFi.SSID.1.SSID", "value": "test_ssid" } -``` - -```json -{ "path": "Device.WiFi.SSID.2.Enable", "value": "true" } -``` - -```json -{ "path": "Device.WiFi.SSID.1.Enable", "value": "0" } -``` - -#### values - -To set multiple values at once, path should be relative to object elements - -`values` - -- is optional -- type: `object` - -##### values Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ---- | -------- | -| None | None | None | - -##### values Examples - -```json -{ "path": "Device.WiFi.SSID.1", "values": { ".SSID": "test_ssid", ".Name": "test_name" } } -``` - -```json -{ "path": "Device.WiFi.SSID.2", "values": { ".SSID": "test_ssid" } } -``` - -### Ubus CLI Example - -``` -ubus call usp set {"path":"magna voluptate labore","value":"cupidatat","proto":"usp","values":{},"instance_mode":1} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp", - "set", - { - "path": "magna voluptate labore", - "value": "cupidatat", - "proto": "usp", - "values": {}, - "key": "quis", - "instance_mode": 1 - } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "type": "object", - "properties": { - "status": { - "const": "1" - } - } - }, - { - "type": "object", - "required": ["parameters"], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "status": { - "const": "0" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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\":\"nulla ad\",\"status\":\"0\",\"fault\":8453},{\"path\":\"ut non\",\"status\":\"0\",\"fault\":8067},{\"path\":\"exercitation ad\",\"status\":\"0\",\"fault\":7689},{\"path\":\"nostrud\",\"status\":\"0\",\"fault\":8772}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "status": "1" }, - { - "parameters": [ - { "path": "nulla ad", "status": "0", "fault": 8453 }, - { "path": "ut non", "status": "0", "fault": 8067 }, - { "path": "exercitation ad", "status": "0", "fault": 7689 }, - { "path": "nostrud", "status": "0", "fault": 8772 } - ] - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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 } - } -} -``` - -## validate - -### Validate a datamodel object - -API to check if a datamodel object is available - -`validate` - -- type: `Method` - -### validate Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance-mode` | integer | Optional | | -| `maxdepth` | integer | Optional | | -| `next-level` | boolean | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance-mode - -`instance-mode` - -- is optional -- type: `integer` - -##### instance-mode Type - -`integer` - -#### maxdepth - -Integer to decide the depth of data model to be parsed - -`maxdepth` - -- is optional -- type: `integer` - -##### maxdepth Type - -`integer` - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#validate-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp validate {"path":"et Excepteur ad","proto":"cwmp","maxdepth":2151689,"next-level":true,"instance-mode":-6258066} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp", - "validate", - { "path": "et Excepteur ad", "proto": "cwmp", "maxdepth": 2151689, "next-level": true, "instance-mode": -6258066 } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| ----------- | ------- | -------- | -| `fault` | integer | Optional | -| `parameter` | string | Optional | - -#### fault - -`fault` - -- is optional -- type: reference - -##### fault Type - -`integer` - -- minimum value: `7000` -- maximum value: `9050` - -#### parameter - -`parameter` - -- is optional -- type: `string` - -##### parameter Type - -`string` - -### Output Example - -```json -{ "parameter": "nisi te", "fault": 8845 } -``` diff --git a/bbfd/docs/api/ubus/usp.raw.md b/bbfd/docs/api/ubus/usp.raw.md deleted file mode 100644 index 5b401fb8..00000000 --- a/bbfd/docs/api/ubus/usp.raw.md +++ /dev/null @@ -1,4694 +0,0 @@ -# usp.raw Schema - -``` -https://dev.iopsys.eu/iopsys/uspd/-/blob/devel/docs/api/ubus/usp.raw.md -``` - -| Custom Properties | Additional Properties | -| ----------------- | --------------------- | -| Forbidden | Forbidden | - -# usp.raw - -| List of Methods | -| ----------------------------------------- | -| [add_object](#add_object) | Method | usp.raw (this schema) | -| [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) | -| [get_supported_dm](#get_supported_dm) | 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_operate](#list_operate) | Method | usp.raw (this schema) | -| [notify_event](#notify_event) | 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_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) | -| [transaction_start](#transaction_start) | Method | usp.raw (this schema) | -| [transaction_status](#transaction_status) | Method | usp.raw (this schema) | -| [validate](#validate) | Method | usp.raw (this schema) | - -## add_object - -### Add a new object instance - -Add a new object in multi instance object - -`add_object` - -- type: `Method` - -### add_object Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| ---------------- | ------- | ------------ | -------- | -| `instance_mode` | integer | Optional | | -| `key` | string | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | -| `transaction_id` | integer | **Required** | | - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -- minimum value: `0` -- maximum value: `1` - -#### key - -`key` - -- is optional -- type: `string` - -##### key Type - -`string` - -#### path - -Complete object element path as per TR181 - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.1. -``` - -```json -Device.WiFi. -``` - -#### 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](#add_object-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -#### transaction_id - -`transaction_id` - -- is **required** -- type: `integer` - -##### transaction_id Type - -`integer` - -- minimum value: `1` - -### Ubus CLI Example - -``` -ubus call usp.raw add_object {"path":"eu sit","transaction_id":13511822,"proto":"both","instance_mode":1} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "add_object", - { - "path": "eu sit", - "transaction_id": 13511822, - "proto": "both", - "key": "ut non in qui cupidatat", - "instance_mode": 1 - } - ] -} -``` - -#### 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", "status"], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - }, - "instance": { - "type": "string" - } - } - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ - "parameters": [ - { - "parameter": "exnon sint minim cupidatat anim", - "status": false, - "fault": 8106, - "instance": "exercitation qui culpa ven" - } - ] -} -``` - -## del_object - -### Delete object instance - -Delete a object instance from multi instance object - -`del_object` - -- type: `Method` - -### del_object Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| ---------------- | ------- | ------------ | -------- | -| `instance_mode` | integer | Optional | | -| `key` | string | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | -| `transaction_id` | integer | **Required** | | - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -- minimum value: `0` -- maximum value: `1` - -#### key - -`key` - -- is optional -- type: `string` - -##### key Type - -`string` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#del_object-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -#### transaction_id - -`transaction_id` - -- is **required** -- type: `integer` - -##### transaction_id Type - -`integer` - -- minimum value: `1` - -### Ubus CLI Example - -``` -ubus call usp.raw del_object {"path":"ut adipisicing ut nisi","transaction_id":8573124,"proto":"cwmp","instance_mode":1} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "del_object", - { - "path": "ut adipisicing ut nisi", - "transaction_id": 8573124, - "proto": "cwmp", - "key": "tempor consectetur veniam laborum", - "instance_mode": 1 - } - ] -} -``` - -#### 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", "status"], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ "parameters": [{ "parameter": "essein incididunt Duis dolore mollit", "status": true, "fault": 7621 }] } -``` - -## dump_schema - -### Get available datamodel schema from Device - -Schema will have all the nodes/objects supported by data model - -`dump_schema` - -- type: `Method` - -### dump_schema 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 | -| -------- | ---- | -------- | -| None | None | None | - -### Ubus CLI Example - -``` -ubus call usp.raw dump_schema {} -``` - -### JSONRPC Example - -```json -{ "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["", "usp.raw", "dump_schema", {}] } -``` - -#### 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", - "uniqueItems": true, - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "unique_keys": { - "type": "array", - "uniqueItems": true, - "maxItems": 8, - "items": [ - { - "type": "string" - } - ] - } - }, - "required": ["parameter", "writable", "type"] - }, - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - } - }, - "required": ["parameter", "writable", "type"] - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ - "parameters": [ - { - "parameter": "aliquip adipisicing sed quis", - "writable": "1", - "type": "xsd:unsignedLong", - "unique_keys": ["nisi"] - }, - { "parameter": "reprehenderit occaecat i", "writable": "0", "type": "xsd:object" } - ] -} -``` - -## get - -### Get handler - -Query the datamodel object - -`get` - -- type: `Method` - -### get Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance-mode` | integer | Optional | | -| `maxdepth` | integer | Optional | | -| `next-level` | boolean | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance-mode - -`instance-mode` - -- is optional -- type: `integer` - -##### instance-mode Type - -`integer` - -#### maxdepth - -Integer to decide the depth of data model to be parsed - -`maxdepth` - -- is optional -- type: `integer` - -##### maxdepth Type - -`integer` - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#get-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp.raw get {"path":"etcillum in Duis","proto":"cwmp","maxdepth":-12869241,"next-level":false,"instance-mode":-60814589} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "get", - { - "path": "etcillum in Duis", - "proto": "cwmp", - "maxdepth": -12869241, - "next-level": false, - "instance-mode": -60814589 - } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": ["parameter", "value", "type"], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ] - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"oneof\":[{\"fault\":8248},{\"parameters\":[{\"parameter\":\"in magna et\",\"value\":\"Excepteur\",\"type\":\"xsd:int\"}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "fault": 8248 }, - { "parameters": [{ "parameter": "in magna et", "value": "Excepteur", "type": "xsd:int" }] } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` - -## get_supported_dm - -### Get list of supported datamodel parameters - -Schema will have all the nodes/objects supported by libbbf - -`get_supported_dm` - -- type: `Method` - -### get_supported_dm Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | Optional | -| `output` | | **Required** | - -#### input - -`input` - -- is optional -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| ------------- | ------- | -------- | -| `next-level` | boolean | Optional | -| `path` | string | Optional | -| `schema_type` | integer | Optional | - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### path - -DM object path with search queries - -`path` - -- is optional -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### schema_type - -0-All, 1-Parameter only 2- Event only 3- operate only - -`schema_type` - -- is optional -- type: `integer` - -##### schema_type Type - -`integer` - -- minimum value: `0` -- maximum value: `3` - -### Ubus CLI Example - -``` -ubus call usp.raw get_supported_dm {"path":"minim occae","next-level":false,"schema_type":1} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": ["", "usp.raw", "get_supported_dm", { "path": "minim occae", "next-level": false, "schema_type": 1 }] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "cmd_type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - }, - "out": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - } - }, - "required": ["parameter", "type"] - } - ] - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"oneof\":[{\"fault\":7018},{\"parameters\":[{\"parameter\":\"sunt Ut nulla labore id\",\"type\":\"xsd:unsignedInt\",\"writable\":\"1\",\"cmd_type\":\"async\",\"in\":[\"minim est\"],\"out\":[\"sed in laborum fugiat\"]}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "fault": 7018 }, - { - "parameters": [ - { - "parameter": "sunt Ut nulla labore id", - "type": "xsd:unsignedInt", - "writable": "1", - "cmd_type": "async", - "in": ["minim est"], - "out": ["sed in laborum fugiat"] - } - ] - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` - -## getm_names - -### Get multiple object names - -Query multiple object names at once - -`getm_names` - -- type: `Method` - -### getm_names Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance_mode` | integer | Optional | | -| `next-level` | boolean | Optional | | -| `paths` | array | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -- minimum value: `0` -- maximum value: `1` - -#### 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_names-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp.raw getm_names {"paths":["sit id"],"proto":"usp","next-level":true,"instance_mode":1} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "getm_names", - { "paths": ["sit id"], "proto": "usp", "next-level": true, "instance_mode": 1 } - ] -} -``` - -#### 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"], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - } - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ - "parameters": [ - { "parameter": "incididunt sed et", "value": "consequat incididunt dolore", "type": "xsd:boolean", "fault": 9006 } - ] -} -``` - -## getm_values - -### Get multiple values - -Query multiple paths at once - -`getm_values` - -- type: `Method` - -### getm_values Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance_mode` | integer | Optional | | -| `next-level` | boolean | Optional | | -| `paths` | array | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -- minimum value: `0` -- maximum value: `1` - -#### 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_values-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp.raw getm_values {"paths":["nulla esse magna"],"proto":"both","next-level":true,"instance_mode":1} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "getm_values", - { "paths": ["nulla esse magna"], "proto": "both", "next-level": true, "instance_mode": 1 } - ] -} -``` - -#### 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"], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - } - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ "parameters": [{ "parameter": "aliqua ullamco", "value": "qui eiusmo", "type": "xsd:string", "fault": 8116 }] } -``` - -## instances - -### Instance query handler - -Get the instances of multi object - -`instances` - -- type: `Method` - -### instances Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | Optional | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance-mode` | integer | Optional | | -| `maxdepth` | integer | Optional | | -| `next-level` | boolean | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance-mode - -`instance-mode` - -- is optional -- type: `integer` - -##### instance-mode Type - -`integer` - -#### maxdepth - -Integer to decide the depth of data model to be parsed - -`maxdepth` - -- is optional -- type: `integer` - -##### maxdepth Type - -`integer` - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#instances-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp.raw instances {"path":"eiusmod","proto":"usp","next-level":true,"maxdepth":-11964632,"instance-mode":9983797} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "instances", - { "path": "eiusmod", "proto": "usp", "next-level": true, "maxdepth": -11964632, "instance-mode": 9983797 } - ] -} -``` - -#### output - -`output` - -- is optional -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - }, - { - "type": "object", - "required": ["parameters"], - "properties": { - "parameters": { - "type": "array", - "required": ["parameter"], - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/instance_t" - } - } - } - ] - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"oneof\":[{\"fault\":7620},{\"parameters\":[{\"parameter\":\"doloret minim adi\"}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "oneof": [{ "fault": 7620 }, { "parameters": [{ "parameter": "doloret minim adi" }] }], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` - -## list_events - -### List down supported usp events - -events will be shown in schema format - -`list_events` - -- type: `Method` - -### list_events 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 | -| -------- | ---- | -------- | -| None | None | None | - -### Ubus CLI Example - -``` -ubus call usp.raw list_events {} -``` - -### JSONRPC Example - -```json -{ "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["", "usp.raw", "list_events", {}] } -``` - -#### 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", "type"], - "properties": { - "parameter": { - "$ref": "#/definitions/operate_path_t" - }, - "type": { - "type": "string", - "pattern": "xsd:event" - }, - "in": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - } - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ "parameters": [{ "parameter": "in est nostrud ea", "type": "xsd:event", "in": ["labore"] }] } -``` - -## list_operate - -### List down supported usp operate commands - -Commands will be shown in schema format - -`list_operate` - -- type: `Method` - -### list_operate 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 | -| -------- | ---- | -------- | -| None | None | None | - -### Ubus CLI Example - -``` -ubus call usp.raw list_operate {} -``` - -### JSONRPC Example - -```json -{ "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["", "usp.raw", "list_operate", {}] } -``` - -#### 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", "type"], - "properties": { - "parameter": { - "$ref": "#/definitions/operate_path_t" - }, - "type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - }, - "out": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - } - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ - "parameters": [ - { "parameter": "in com", "type": "async", "in": ["fugiat"], "out": ["pariatur ut cillum proident veniam"] } - ] -} -``` - -## notify_event - -### notify occurance of an event on ubus - -`notify_event` - -- type: `Method` - -### notify_event Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | Optional | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | string | Optional | -| `name` | string | **Required** | - -#### input - -`input` - -- is optional -- type: `string` - -##### input Type - -`string` - -#### name - -`name` - -- is **required** -- type: `string` - -##### name Type - -`string` - -### Ubus CLI Example - -``` -ubus call usp.raw notify_event {"name":"deserunt ipsum dolor officia","input":"Lorem consequat commodo in occaecat"} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "notify_event", - { "name": "deserunt ipsum dolor officia", "input": "Lorem consequat commodo in occaecat" } - ] -} -``` - -#### output - -`output` - -- is optional -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` - -## object_names - -### Get objects names - -Get names of all the objects below input object path - -`object_names` - -- type: `Method` - -### object_names Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance-mode` | integer | Optional | | -| `maxdepth` | integer | Optional | | -| `next-level` | boolean | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance-mode - -`instance-mode` - -- is optional -- type: `integer` - -##### instance-mode Type - -`integer` - -#### maxdepth - -Integer to decide the depth of data model to be parsed - -`maxdepth` - -- is optional -- type: `integer` - -##### maxdepth Type - -`integer` - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#object_names-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp.raw object_names {"path":"mollit aliqua dolor Duis elit","proto":"cwmp","next-level":true,"maxdepth":-77404850,"instance-mode":-15946651} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "object_names", - { - "path": "mollit aliqua dolor Duis elit", - "proto": "cwmp", - "next-level": true, - "maxdepth": -77404850, - "instance-mode": -15946651 - } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - }, - { - "type": "object", - "required": ["parameters"], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": ["parameter", "writable", "type"], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "writable": { - "type": "integer", - "description": "1 if object is writable, 0 otherwise" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ] - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"oneof\":[{\"fault\":7963},{\"parameters\":[{\"parameter\":\"sint do dolor ex\",\"writable\":-25525336,\"type\":\"xsd:event\"}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "fault": 7963 }, - { "parameters": [{ "parameter": "sint do dolor ex", "writable": -25525336, "type": "xsd:event" }] } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` - -## operate - -### Operate handler - -Operate on object element provided in path - -`operate` - -- type: `Method` - -### operate Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `action` | string | **Required** | | -| `input` | object | Optional | | -| `instance_mode` | integer | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### action - -Opreate command as defined in TR-369, TR-181-2.13 - -`action` - -- is **required** -- type: `string` - -##### action Type - -`string` - -##### action Example - -```json -{ "path": "Device.WiFi.", "action": "Reset()" } -``` - -#### input - -Input arguments for the operate command as defined in TR-181-2.13 - -`input` - -- is optional -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ---- | -------- | -| None | None | None | - -##### input Example - -```json -{ "path": "Device.IP.Diagnostics", "action": "IPPing()", "input": { "Host": "iopsys.eu" } } -``` - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -- minimum value: `0` -- maximum value: `1` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#operate-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp.raw operate {"path":"magna dolor qui","action":"qui in dolore eiusmod","proto":"cwmp","input":{},"instance_mode":1} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "operate", - { "path": "magna dolor qui", "action": "qui in dolore eiusmod", "proto": "cwmp", "input": {}, "instance_mode": 1 } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| --------- | ----- | ------------ | -| `Results` | array | **Required** | - -#### Results - -`Results` - -- is **required** -- type: `array` - -##### Results Type - -Array type: `array` - -All items must be of the type: Unknown type ``. - -```json -{ - "type": "array", - "items": [ - { - "type": "object", - "required": ["path"], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "parameters": { - "description": "Output will have status for sync commands and for async commands parameters as defined in TR-181-2.13", - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "type": "string" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ], - "examples": [ - "{\n\t\"status\": true}", - "{\n\t\"AverageResponseTime\": \"0\",\n\t\"AverageResponseTimeDetailed\": \"130\",\n\t\"FailureCount\": \"0\",\n\t\"MaximumResponseTime\": \"0\",\n\t\"MaximumResponseTimeDetailed\": \"140\",\n\t\"MinimumResponseTime\": \"0\",\n\t\"MinimumResponseTimeDetailed\": \"120\",\n\t\"SuccessCount\": \"3\"}" - ] - } - } - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ - "Results": [ - { - "path": "minim irure enim exercitation e", - "parameters": [ - { "parameter": "laboris anim commodo", "value": "consequat in veniam", "type": "xsd:boolean", "fault": 8214 } - ] - } - ] -} -``` - -## set - -### Set handler - -Set values of datamodel object element - -`set` - -- type: `Method` - -### set Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| ---------------- | ------- | ------------ | -------- | -| `instance_mode` | integer | Optional | | -| `key` | string | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | -| `transaction_id` | integer | **Required** | | -| `value` | string | **Required** | | -| `values` | object | Optional | | - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -- minimum value: `0` -- maximum value: `1` - -#### key - -`key` - -- is optional -- type: `string` - -##### key Type - -`string` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#set-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -#### transaction_id - -`transaction_id` - -- is **required** -- type: `integer` - -##### transaction_id Type - -`integer` - -- minimum value: `1` - -#### value - -value of the object element provided in path, path should contains valid writable object element - -`value` - -- is **required** -- type: `string` - -##### value Type - -`string` - -##### value Examples - -```json -{ "path": "Device.WiFi.SSID.1.SSID", "value": "test_ssid" } -``` - -```json -{ "path": "Device.WiFi.SSID.2.Enable", "value": "true" } -``` - -```json -{ "path": "Device.WiFi.SSID.1.Enable", "value": "0" } -``` - -#### values - -To set multiple values at once, path should be relative to object elements - -`values` - -- is optional -- type: `object` - -##### values Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ---- | -------- | -| None | None | None | - -##### values Examples - -```json -{ "path": "Device.WiFi.SSID.1", "values": { ".SSID": "test_ssid", ".Name": "test_name" } } -``` - -```json -{ "path": "Device.WiFi.SSID.2", "values": { ".SSID": "test_ssid" } } -``` - -### Ubus CLI Example - -``` -ubus call usp.raw set {"path":"anim ullamco","value":"officia nostrud dolor ad tempor","transaction_id":47775846,"proto":"usp","values":{},"instance_mode":1} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "set", - { - "path": "anim ullamco", - "value": "officia nostrud dolor ad tempor", - "transaction_id": 47775846, - "proto": "usp", - "values": {}, - "key": "dolore aliquip quis nostrud", - "instance_mode": 1 - } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "type": "object", - "properties": { - "status": { - "const": "1" - } - } - }, - { - "type": "object", - "required": ["parameters"], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": ["parameter"], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"oneof\":[{\"status\":\"1\"},{\"parameters\":[{\"parameter\":\"deserunt tempor\",\"status\":false,\"fault\":7042}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "oneof": [{ "status": "1" }, { "parameters": [{ "parameter": "deserunt tempor", "status": false, "fault": 7042 }] }], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` - -## setm_values - -### Set values of multiple objects at once - -`setm_values` - -- type: `Method` - -### setm_values Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| ---------------- | ------- | ------------ | -------- | -| `instance_mode` | integer | Optional | | -| `key` | string | Optional | | -| `proto` | string | Optional | `"both"` | -| `pv_tuple` | array | **Required** | | -| `transaction_id` | integer | **Required** | | - -#### instance_mode - -`instance_mode` - -- is optional -- type: `integer` - -##### instance_mode Type - -`integer` - -- minimum value: `0` -- maximum value: `1` - -#### key - -`key` - -- is optional -- type: `string` - -##### key Type - -`string` - -#### 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_values-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -#### pv_tuple - -`pv_tuple` - -- is **required** -- type: `array` - -##### pv_tuple Type - -Array type: `array` - -All items must be of the type: Unknown type ``. - -```json -{ - "type": "array", - "items": [ - { - "type": "object", - "required": ["path", "value"], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "key": { - "type": "string" - } - } - } - ], - "simpletype": "`array`" -} -``` - -#### transaction_id - -`transaction_id` - -- is **required** -- type: `integer` - -##### transaction_id Type - -`integer` - -- minimum value: `0` - -### Ubus CLI Example - -``` -ubus call usp.raw setm_values {"pv_tuple":[{"path":"exmagna incididunt qui labore","value":"cillum occaecat aliquip anim id"}],"transaction_id":54841604,"proto":"both","instance_mode":0} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "setm_values", - { - "pv_tuple": [ - { - "path": "exmagna incididunt qui labore", - "value": "cillum occaecat aliquip anim id", - "key": "adipisicing reprehenderit" - } - ], - "transaction_id": 54841604, - "proto": "both", - "key": "ad", - "instance_mode": 0 - } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| ------------ | ------- | -------- | -| `parameters` | array | Optional | -| `status` | boolean | Optional | - -#### 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" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ], - "simpletype": "`array`" -} -``` - -#### status - -`status` - -- is optional -- type: `boolean` - -##### status Type - -`boolean` - -### Output Example - -```json -{ "status": false, "parameters": [{ "path": "Excepteur eu quis voluptate", "status": false, "fault": 8080 }] } -``` - -## transaction_abort - -### Aborts an on-going transaction - -`transaction_abort` - -- type: `Method` - -### transaction_abort Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| ---------------- | ------- | ------------ | -| `transaction_id` | integer | **Required** | - -#### transaction_id - -`transaction_id` - -- is **required** -- type: `integer` - -##### transaction_id Type - -`integer` - -- minimum value: `1` - -### Ubus CLI Example - -``` -ubus call usp.raw transaction_abort {"transaction_id":57946802} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": ["", "usp.raw", "transaction_abort", { "transaction_id": 57946802 }] -} -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------- | ------------ | -| `error` | string | Optional | -| `status` | boolean | **Required** | - -#### error - -`error` - -- is optional -- type: `string` - -##### error Type - -`string` - -#### status - -`status` - -- is **required** -- type: `boolean` - -##### status Type - -`boolean` - -### Output Example - -```json -{ "status": true, "error": "labore ad id" } -``` - -## transaction_commit - -### Commits an on-going transaction - -`transaction_commit` - -- type: `Method` - -### transaction_commit Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| ------------------ | ------- | ------------ | -| `restart_services` | boolean | Optional | -| `transaction_id` | integer | **Required** | - -#### restart_services - -`restart_services` - -- is optional -- type: `boolean` - -##### restart_services Type - -`boolean` - -#### transaction_id - -`transaction_id` - -- is **required** -- type: `integer` - -##### transaction_id Type - -`integer` - -- minimum value: `1` - -### Ubus CLI Example - -``` -ubus call usp.raw transaction_commit {"transaction_id":86335477,"restart_services":false} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": ["", "usp.raw", "transaction_commit", { "transaction_id": 86335477, "restart_services": false }] -} -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| ------------------ | ------- | ------------ | -| `error` | string | Optional | -| `status` | boolean | **Required** | -| `updated_services` | array | Optional | - -#### error - -`error` - -- is optional -- type: `string` - -##### error Type - -`string` - -#### status - -`status` - -- is **required** -- type: `boolean` - -##### status Type - -`boolean` - -#### updated_services - -`updated_services` - -- is optional -- type: `array` - -##### updated_services Type - -Array type: `array` - -All items must be of the type: Unknown type ``. - -```json -{ - "type": "array", - "items": [ - { - "type": "string" - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ "status": true, "error": "mollit id deserunt", "updated_services": ["id pariatur enim ut sunt"] } -``` - -## transaction_start - -### Start a transaction before set/add/del operations - -`transaction_start` - -- type: `Method` - -### transaction_start Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| ------------- | ------- | ------------ | -| `app` | string | **Required** | -| `max_timeout` | integer | Optional | - -#### app - -`app` - -- is **required** -- type: `string` - -##### app Type - -`string` - -#### max_timeout - -`max_timeout` - -- is optional -- type: `integer` - -##### max_timeout Type - -`integer` - -- minimum value: `0` - -### Ubus CLI Example - -``` -ubus call usp.raw transaction_start {"app":"a","max_timeout":76766611} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": ["", "usp.raw", "transaction_start", { "app": "a", "max_timeout": 76766611 }] -} -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| ---------------- | ------- | ------------ | -| `error` | string | Optional | -| `status` | boolean | **Required** | -| `transaction_id` | integer | Optional | - -#### error - -`error` - -- is optional -- type: `string` - -##### error Type - -`string` - -#### status - -`status` - -- is **required** -- type: `boolean` - -##### status Type - -`boolean` - -#### transaction_id - -`transaction_id` - -- is optional -- type: `integer` - -##### transaction_id Type - -`integer` - -- minimum value: `1` - -### Output Example - -```json -{ "status": false, "transaction_id": 12109922, "error": "deserunt aliquip consectetur q" } -``` - -## transaction_status - -### Shows status of a transaction - -`transaction_status` - -- type: `Method` - -### transaction_status Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| ---------------- | ------- | ------------ | -| `transaction_id` | integer | **Required** | - -#### transaction_id - -`transaction_id` - -- is **required** -- type: `integer` - -##### transaction_id Type - -`integer` - -- minimum value: `1` - -### Ubus CLI Example - -``` -ubus call usp.raw transaction_status {"transaction_id":55898564} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": ["", "usp.raw", "transaction_status", { "transaction_id": 55898564 }] -} -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| ---------------- | ------- | ------------ | -| `app` | string | Optional | -| `remaining_time` | integer | Optional | -| `status` | string | **Required** | - -#### app - -`app` - -- is optional -- type: `string` - -##### app Type - -`string` - -#### remaining_time - -`remaining_time` - -- is optional -- type: `integer` - -##### remaining_time Type - -`integer` - -#### status - -on-going or not-exists - -`status` - -- is **required** -- type: `string` - -##### status Type - -`string` - -### Output Example - -```json -{ "status": "sed ut", "remaining_time": 13818285, "app": "anim" } -``` - -## validate - -### Validate a datamodel path - -Validate a path - -`validate` - -- type: `Method` - -### validate Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| --------------- | ------- | ------------ | -------- | -| `instance-mode` | integer | Optional | | -| `maxdepth` | integer | Optional | | -| `next-level` | boolean | Optional | | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### instance-mode - -`instance-mode` - -- is optional -- type: `integer` - -##### instance-mode Type - -`integer` - -#### maxdepth - -Integer to decide the depth of data model to be parsed - -`maxdepth` - -- is optional -- type: `integer` - -##### maxdepth Type - -`integer` - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### path - -DM object path with search queries - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.[SSID=="test_ssid"].BSSID -``` - -```json -Device.WiFi.SSID.*.BSSID -``` - -```json -Device.WiFi.SSID.[SSID!="test_ssid"&&Enable==1].BSSID -``` - -```json -Device.WiFi. -``` - -#### 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](#validate-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call usp.raw validate {"path":"id adipisicing","proto":"both","next-level":true,"maxdepth":232638,"instance-mode":47166958} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "usp.raw", - "validate", - { "path": "id adipisicing", "proto": "both", "next-level": true, "maxdepth": 232638, "instance-mode": 47166958 } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - }, - { - "type": "object", - "required": ["parameters"], - "properties": { - "parameters": { - "$ref": "#/definitions/path_t" - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"oneof\":[{\"fault\":7959},{\"parameters\":\"id aute\"}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"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\":1024,\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "oneof": [{ "fault": 7959 }, { "parameters": "id aute" }], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` diff --git a/bbfd/docs/api/uci/.pages b/bbfd/docs/api/uci/.pages deleted file mode 100644 index 35a6ea1a..00000000 --- a/bbfd/docs/api/uci/.pages +++ /dev/null @@ -1,4 +0,0 @@ -title: "USP Daemon UCI" - -nav: - - "..." diff --git a/bbfd/docs/api/uci/uspd.md b/bbfd/docs/api/uci/uspd.md deleted file mode 100644 index 50294433..00000000 --- a/bbfd/docs/api/uci/uspd.md +++ /dev/null @@ -1,216 +0,0 @@ -# UCI Config - - - - -
uspd
- - - - - - - - - - - - - - - -
-
section
-
-
description
-
-
multi
-
-
options
-
-
uspd
-
-
USP daemon Settings
-
-
false
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
name
-
-
type
-
-
required
-
-
default
-
-
description
-
-
granularitylevel
-
-
integer
-
-
no
-
-
0
-
-
Creates ubus objects along with object names, depth of object name depends - on granularitylevel
-
-
debug
-
-
boolean
-
-
no
-
-
-
-
Enabled debug logging
-
-
sock
-
-
string
-
-
no
-
-
-
-
Path for ubus socket to register uspd services
-
-
transaction_timeout
-
-
integer
-
-
no
-
-
10
-
-
Transaction timeout value in seconds
-
-
loglevel
-
-
integer
-
-
no
-
-
1
-
-
Internal loglevel for debugging {0: No Logs; 1: Errors only; 2: Errors - and warnings; 3: Error, warning and info; 4: Everything}
-
-
subprocess_level
-
-
integer
-
-
no
-
-
2
-
-
This parameter configures when subprocess can be used for get operation. Level here denotes the Datamodel object depth up-to which subprocess will be used to collect the get data. For example, if this is configured to 1, then only get for 'Device.' shall be called within the subprocess. If configured as level 2, then all the get with up-to depth 2 like 'Device.WiFi.', 'Device.IP.' shall be called in subprocess.
-
-
bbf_caching_time
-
-
integer
-
-
no
-
-
0
-
-
Max caching time in seconds for ubus output used in datamodel parameters. If not configured, output shall be cleared end the end of call.
-
-
dm_version
-
-
string
-
-
no
-
-
-
-
Configures the datamodel version to use for datamodel parameters, if not configured show all defined datamodel
-
-
refresh_time
-
-
integer
-
-
no
-
-
5
-
-
The time period in seconds after which uspd will refresh the datamodel instances in a periodic manner. If configured to '0' then instance updater will be disabled. If not configured at all then after every 5 seconds datamodel instances will be refreshed.
-
-
- - - diff --git a/bbfd/docs/css/assets/fonts/Madera-Bold.eot b/bbfd/docs/css/assets/fonts/Madera-Bold.eot deleted file mode 100644 index 457671d8..00000000 Binary files a/bbfd/docs/css/assets/fonts/Madera-Bold.eot and /dev/null differ diff --git a/bbfd/docs/css/assets/fonts/Madera-Bold.svg b/bbfd/docs/css/assets/fonts/Madera-Bold.svg deleted file mode 100644 index 93cf70fe..00000000 --- a/bbfd/docs/css/assets/fonts/Madera-Bold.svg +++ /dev/null @@ -1,5301 +0,0 @@ - - - - -Created by FontForge 20201107 at Thu Jan 11 12:25:57 2018 - By Unknown -Copyright (c) 2018 Monotype Imaging Inc. All rights reserved - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bbfd/docs/css/assets/fonts/Madera-Bold.ttf b/bbfd/docs/css/assets/fonts/Madera-Bold.ttf deleted file mode 100644 index f2727b12..00000000 Binary files a/bbfd/docs/css/assets/fonts/Madera-Bold.ttf and /dev/null differ diff --git a/bbfd/docs/css/assets/fonts/Madera-Bold.woff b/bbfd/docs/css/assets/fonts/Madera-Bold.woff deleted file mode 100644 index 4cb26fdb..00000000 Binary files a/bbfd/docs/css/assets/fonts/Madera-Bold.woff and /dev/null differ diff --git a/bbfd/docs/css/assets/fonts/Madera-Bold.woff2 b/bbfd/docs/css/assets/fonts/Madera-Bold.woff2 deleted file mode 100644 index 090315e9..00000000 Binary files a/bbfd/docs/css/assets/fonts/Madera-Bold.woff2 and /dev/null differ diff --git a/bbfd/docs/css/assets/fonts/Madera-Regular.eot b/bbfd/docs/css/assets/fonts/Madera-Regular.eot deleted file mode 100644 index 33d4788a..00000000 Binary files a/bbfd/docs/css/assets/fonts/Madera-Regular.eot and /dev/null differ diff --git a/bbfd/docs/css/assets/fonts/Madera-Regular.svg b/bbfd/docs/css/assets/fonts/Madera-Regular.svg deleted file mode 100644 index b4ed242c..00000000 --- a/bbfd/docs/css/assets/fonts/Madera-Regular.svg +++ /dev/null @@ -1,5284 +0,0 @@ - - - - -Created by FontForge 20201107 at Thu Jan 11 12:26:25 2018 - By Unknown -Copyright (c) 2018 Monotype Imaging Inc. All rights reserved - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bbfd/docs/css/assets/fonts/Madera-Regular.ttf b/bbfd/docs/css/assets/fonts/Madera-Regular.ttf deleted file mode 100644 index c0808e8e..00000000 Binary files a/bbfd/docs/css/assets/fonts/Madera-Regular.ttf and /dev/null differ diff --git a/bbfd/docs/css/assets/fonts/Madera-Regular.woff b/bbfd/docs/css/assets/fonts/Madera-Regular.woff deleted file mode 100644 index 4b828b47..00000000 Binary files a/bbfd/docs/css/assets/fonts/Madera-Regular.woff and /dev/null differ diff --git a/bbfd/docs/css/assets/fonts/Madera-Regular.woff2 b/bbfd/docs/css/assets/fonts/Madera-Regular.woff2 deleted file mode 100644 index a2b257cf..00000000 Binary files a/bbfd/docs/css/assets/fonts/Madera-Regular.woff2 and /dev/null differ diff --git a/bbfd/docs/css/colors.css b/bbfd/docs/css/colors.css deleted file mode 100755 index 3a952ae6..00000000 --- a/bbfd/docs/css/colors.css +++ /dev/null @@ -1,124 +0,0 @@ -//// -/// Copyright (c) 2016-2021 Martin Donath -/// -/// Permission is hereby granted, free of charge, to any person obtaining a -/// copy of this software and associated documentation files (the "Software"), -/// to deal in the Software without restriction, including without limitation -/// the rights to use, copy, modify, merge, publish, distribute, sublicense, -/// and/or sell copies of the Software, and to permit persons to whom the -/// Software is furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -/// DEALINGS -//// - -// ---------------------------------------------------------------------------- -// Rules -// ---------------------------------------------------------------------------- - - - -// Color variables -:root { - - // Default color shades - --md-default-fg-color: hsla(0, 0%, 0%, 0.87); - --md-default-fg-color--light: hsla(0, 0%, 0%, 0.54); - --md-default-fg-color--lighter: hsla(0, 0%, 0%, 0.32); - --md-default-fg-color--lightest: hsla(0, 0%, 0%, 0.07); - --md-default-bg-color: hsla(0, 0%, 100%, 1); - --md-default-bg-color--light: hsla(0, 0%, 100%, 0.7); - --md-default-bg-color--lighter: hsla(0, 0%, 100%, 0.3); - --md-default-bg-color--lightest: hsla(0, 0%, 100%, 0.12); - - // Primary color shades - --md-primary-fg-color: hsla(#{hex2hsl($clr-indigo-500)}, 1); - --md-primary-fg-color--light: hsla(#{hex2hsl($clr-indigo-400)}, 1); - --md-primary-fg-color--dark: hsla(#{hex2hsl($clr-indigo-700)}, 1); - --md-primary-bg-color: hsla(0, 0%, 100%, 1); - --md-primary-bg-color--light: hsla(0, 0%, 100%, 0.7); - - // Accent color shades - --md-accent-fg-color: hsla(#{hex2hsl($clr-indigo-a200)}, 1); - --md-accent-fg-color--transparent: hsla(#{hex2hsl($clr-indigo-a200)}, 0.1); - --md-accent-bg-color: hsla(0, 0%, 100%, 1); - --md-accent-bg-color--light: hsla(0, 0%, 100%, 0.7); - - // Light theme (default) - > * { - - // Code color shades - --md-code-fg-color: hsla(200, 18%, 26%, 1); - --md-code-bg-color: hsla(0, 0%, 96%, 1); - - // Code highlighting color shades - --md-code-hl-color: hsla(#{hex2hsl($clr-yellow-a200)}, 0.5); - --md-code-hl-number-color: hsla(0, 67%, 50%, 1); - --md-code-hl-special-color: hsla(340, 83%, 47%, 1); - --md-code-hl-function-color: hsla(291, 45%, 50%, 1); - --md-code-hl-constant-color: hsla(250, 63%, 60%, 1); - --md-code-hl-keyword-color: hsla(219, 54%, 51%, 1); - --md-code-hl-string-color: hsla(150, 63%, 30%, 1); - --md-code-hl-name-color: var(--md-code-fg-color); - --md-code-hl-operator-color: var(--md-default-fg-color--light); - --md-code-hl-punctuation-color: var(--md-default-fg-color--light); - --md-code-hl-comment-color: var(--md-default-fg-color--light); - --md-code-hl-generic-color: var(--md-default-fg-color--light); - --md-code-hl-variable-color: var(--md-default-fg-color--light); - - // Typeset color shades - --md-typeset-color: var(--md-default-fg-color); - - // Typeset `a` color shades - --md-typeset-a-color: var(--md-primary-fg-color); - - // Typeset `mark` color shades - --md-typeset-mark-color: hsla(#{hex2hsl($clr-yellow-a200)}, 0.5); - - // Typeset `del` and `ins` color shades - --md-typeset-del-color: hsla(6, 90%, 60%, 0.15); - --md-typeset-ins-color: hsla(150, 90%, 44%, 0.15); - - // Typeset `kbd` color shades - --md-typeset-kbd-color: hsla(0, 0%, 98%, 1); - --md-typeset-kbd-accent-color: hsla(0, 100%, 100%, 1); - --md-typeset-kbd-border-color: hsla(0, 0%, 72%, 1); - - // Typeset `table` color shades - --md-typeset-table-color: hsla(0, 0%, 0%, 0.12); - - // Admonition color shades - --md-admonition-fg-color: var(--md-default-fg-color); - --md-admonition-bg-color: var(--md-default-bg-color); - - // Footer color shades - --md-footer-fg-color: hsla(0, 0%, 100%, 1); - --md-footer-fg-color--light: hsla(0, 0%, 100%, 0.7); - --md-footer-fg-color--lighter: hsla(0, 0%, 100%, 0.3); - --md-footer-bg-color: hsla(0, 0%, 0%, 0.87); - --md-footer-bg-color--dark: hsla(0, 0%, 0%, 0.32); - } - - // Shadow depth 1 - --md-shadow-z1: - 0 #{px2rem(4px)} #{px2rem(10px)} hsla(0, 0%, 0%, 0.05), - 0 0 #{px2rem(1px)} hsla(0, 0%, 0%, 0.1); - - // Shadow depth 2 - --md-shadow-z2: - 0 #{px2rem(4px)} #{px2rem(10px)} hsla(0, 0%, 0%, 0.1), - 0 0 #{px2rem(1px)} hsla(0, 0%, 0%, 0.25); - - // Shadow depth 3 - --md-shadow-z3: - 0 #{px2rem(4px)} #{px2rem(10px)} hsla(0, 0%, 0%, 0.2), - 0 0 #{px2rem(1px)} hsla(0, 0%, 0%, 0.35); -} diff --git a/bbfd/docs/css/extra.css b/bbfd/docs/css/extra.css deleted file mode 100755 index d3f7b61e..00000000 --- a/bbfd/docs/css/extra.css +++ /dev/null @@ -1,2601 +0,0 @@ -:root { - --md-primary-fg-color: #101010; // Color: Black normal - --md-primary-fg-color--light: rgba(0, 0, 0, 0.54); // Color: Gray - --md-primary-fg-color--dark: #000; // Color: Black dark - --md-primary-bg-color: #007990; // Color: Petrol - --md-primary-bg-color--light: hsla(0, 0%, 100%, 0.7); - --md-typeset-a-color: #4051b5; // -} - - -ul.md-nav__list { - - font-size: large; - color: #007990; -} - -.md-header__button.md-logo img, .md-header__button.md-logo svg { - width: 8rem; -} - -.md-tabs__link--active { - border-bottom-width: 1px; - border-bottom-style: solid; - border-bottom-color: #007990; - font-weight: bold; -} - - -.md-tabs__link:hover { - color: #007990; - -} - -.md-tabs__item { - display: inline-block; - height: 2.8rem; - padding-left: .6rem; - padding-right: .6rem; -} - - -/* -Theme Name: Iopsys Web 2021 -Theme URI: http://www.wpbeaverbuilder.com -Version: 1.0 -Description: Custom built child theme developed for Iopsys by Crescando and DevHouse. -Author: DevHouse -Author URI: http://devhouse.se -template: bb-theme -*/ - -/* ======================================== - -───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -─████████████───██████████████─██████──██████─██████──██████─██████████████─██████──██████─██████████████─██████████████─ -─██░░░░░░░░████─██░░░░░░░░░░██─██░░██──██░░██─██░░██──██░░██─██░░░░░░░░░░██─██░░██──██░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─ -─██░░████░░░░██─██░░██████████─██░░██──██░░██─██░░██──██░░██─██░░██████░░██─██░░██──██░░██─██░░██████████─██░░██████████─ -─██░░██──██░░██─██░░██─────────██░░██──██░░██─██░░██──██░░██─██░░██──██░░██─██░░██──██░░██─██░░██─────────██░░██───────── -─██░░██──██░░██─██░░██████████─██░░██──██░░██─██░░██████░░██─██░░██──██░░██─██░░██──██░░██─██░░██████████─██░░██████████─ -─██░░██──██░░██─██░░░░░░░░░░██─██░░██──██░░██─██░░░░░░░░░░██─██░░██──██��░██─██░░██──██░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─ -─██░░██──██░░██─██░░██████████─██░░██──██░░██─██░░██████░░██─██░░██──██░░██─██░░██──██░░██─██████████░░██─██░░██████████─ -─██░░██──██░░██─██░░██─────────██░░░░██░░░░██─██░░██──██░░██─██░░██──██░░██─██░░██──██░░██─────────██░░██─██░░██───────── -─██░░████░░░░██─██░░██████████─████░░░░░░████─██░░██──██░░██─██░░██████░░██─██░░██████░░██─██████████░░██─██░░██████████─ -─██░░░░░░░░████─██░░░░░░░░░░██───████░░████───██░░██──██░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─ -─████████████───██████████████─────██████─────██████──██████─██████████████─██████████████─██████████████─██████████████─ -───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── - - COLORS - - body text # - - gold # - - petrol # - - grey # - - FONTS - - default body text "", , ; - - h1-h4 text "", , ; - - h5-h6 text "", , ; - - buttons "", , ; - - forms "", , ; - - CONTENTS - 1. Fonts - 2. Global - 5. Landing Page - 6. Standard Page - 7. Slick Slider - - ===================================== */ - - -/* ======================================== - FONTS - ===================================== */ - - -@font-face { - font-family: 'Madera'; - src: url('./assets/fonts/Madera-Regular.eot'); - src: local('Madera'), local('Madera-Regular'), - url('./assets/fonts/Madera-Regular.eot?#iefix') format('embedded-opentype'), - url('./assets/fonts/Madera-Regular.woff2') format('woff2'), - url('./assets/fonts/Madera-Regular.woff') format('woff'), - url('./assets/fonts/Madera-Regular.ttf') format('truetype'), - url('./assets/fonts/Madera-Regular.svg#Madera-Regular') format('svg'); - font-weight: normal; - font-style: normal; -} - -@font-face { - font-family: 'Madera'; - src: url('./assets/fonts/Madera-Bold.eot'); - src: local('Madera Bold'), local('Madera-Bold'), - url('./assets/fonts/Madera-Bold.eot?#iefix') format('embedded-opentype'), - url('./assets/fonts/Madera-Bold.woff2') format('woff2'), - url('./assets/fonts/Madera-Bold.woff') format('woff'), - url('./assets/fonts/Madera-Bold.ttf') format('truetype'), - url('./assets/fonts/Madera-Bold.svg#Madera-Bold') format('svg'); - font-weight: bold; - font-style: normal; -} - -h1, h2, h4, h5 { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - font-weight: bold; - margin-top: 0px; -} - -h3, h6, body { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - font-weight: normal; - margin-top: 0px; -} - -h3, h6 { - margin-top: 0px; -} - -h3 { - padding-bottom: 10px; -} - -h1 { - font-size: 28px; -} - - -@media screen and (min-width: 350px) { - - h1 { - font-size: 30px; - } - -} - -@media screen and (min-width: 768px) { - - h1 { - font-size: 36px; - } - -} - -@media screen and (min-width: 1024px) { - - h1 { - font-size: 42px; - } - -} - - -/* ======================================== - HEADER - ===================================== */ - -.main-menu { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - font-weight: normal; - letter-spacing: 1.2px; -} - -header.fl-builder-content-editing { - background-color: #000; -} - -.header-container .fl-col-content { - display: inline-block; - font-size: 0; -} - -.iopsys-logo { - display: inline-block; - max-width: 165px; - vertical-align: top; -} - -.main-menu { - display: inline-block; - max-width: calc(100% - 165px); - vertical-align: top; -} - -.main-menu .fl-menu-mobile-flyout { - background-color: rgba(0, 0, 0, 0.8); - padding: 0px; -} - -.main-menu li a, -.main-menu li a:hover { - transition: 0.4s; -} - -.main-menu .fl-menu-mobile-toggle { - padding-right: 0px; -} - -.main-menu .fl-menu-mobile-flyout li a { - color: white !important; - background-color: rgba(0, 0, 0, 0.4); - border-top: 0px; - font-weight: 600; - text-transform: uppercase; - font-size: 12px; - padding-top: 18px; - line-height: 1.4; -} - -.main-menu .fl-menu-mobile-flyout li .sub-menu { - border-top: 1px solid transparent; -} - -.main-menu .fl-menu-mobile-flyout li .sub-menu li a { - padding-left: 28px; -} - -.main-menu .fl-menu-mobile-close, .fl-menu-mobile-close { - padding: 14px 16px 14px 14px; -} - -.main-menu .fl-menu-mobile-flyout li .fl-menu-toggle:before { - right: 80% !important; -} - -.main-menu .fl-menu-mobile-flyout li.fl-active .fl-menu-toggle { - right: 17px; -} - -.main-menu .fl-menu-mobile-close, .fl-menu-mobile-close:hover { - font-size: 16px !important; -} - -.main-menu .fl-menu-mobile-close, .fl-menu-mobile-close i { - color: #fff; - float: right; - transition: 0.4s; -} - -.main-menu .fl-menu-mobile-close, .fl-menu-mobile-close:hover i { - color: #00b1d4; - transition: 0.4s; -} - -@media screen and (min-width: 1024px) { - - .main-menu li a { - font-weight: 600; - text-transform: uppercase; - font-size: 11px; - } - - .main-menu li:last-of-type a { - padding-right: 0px !important; - } - - .main-menu li .fl-menu-toggle:before { - width: 7px !important; - height: 7px !important; - } - - .main-menu .fl-menu-horizontal.fl-toggle-arrows .fl-has-submenu-container a { - padding-right: 30px !important; - } - - .main-menu ul.sub-menu { - background-color: rgba(0, 0, 0, 0.6) !important; - box-shadow: none !important; - } - - .main-menu ul.sub-menu li a { - line-height: 1.4; - padding-top: 10px; - padding-bottom: 10px; - text-transform: initial !important; - } - - .main-menu ul.sub-menu li:first-of-type a { - padding-top: 24px; - } - - .main-menu ul.sub-menu li:last-of-type a { - padding-bottom: 24px; - } - -} - -@media screen and (min-width: 1150px) { - - .main-menu li a { - font-size: 13px; - } - -} - -@media screen and (min-width: 1224px) { - - .main-menu li a { - padding-right: 23px !important; - padding-left: 23px !important; - } - -} - - -/* ======================================== - FOOTER - ===================================== */ - -.dividing-line { - display: none; - padding-left: 20px; - padding-right: 20px; -} - -.footer-social-icons { - display: inline-block; -} - -.footer-social-icons .fl-module-content { - max-width: 35px; -} - -.footer-text { - display: block; - width: 100%; - padding-top: 7px; - padding-bottom: 7px; -} - -.main-menu.footer { - display: none; -} - -footer a { - transition: 0.4s; -} - -footer a:hover { - color: #00b1d4 !important; - transition: 0.4s; -} - -.footer-main-section p strong { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px; - font-weight: normal; -} - -@media screen and (min-width: 768px) { - - .footer-social-icons .fl-module-content { - max-width: 45px; - } - - .footer-text, - .dividing-line { - display: inline-block; - width: auto; - } - - .footer-main-section .fl-col-content { - max-width: 1049px !important; - margin-left: auto; - } - - .main-menu.footer { - display: block; - max-width: 100%; - } - - .main-menu.footer nav { - text-align: left; - } - -} - -@media screen and (min-width: 1024px) { - - .main-menu.footer { - display: inline-block; - max-width: calc(100% - 165px); - } - - .main-menu.footer nav { - text-align: right; - } - -} - -/* ======================================== - GLOBAL - ===================================== */ - -.arrow-icon { - position: absolute; - bottom: 10px; - left: calc(50% - 39px); -} - -.fl-builder-edit .arrow-icon { - position: relative; - bottom: 10px; - left: calc(50% - 39px); -} - -.button-inline-container .fl-col-content { - display: inline-block; - width: 100%; - text-align: center; -} - -.button-inline-container .fl-module { - display: inline-block; -} - -.video-image a { - position: relative; - display: inline-block; - overflow: hidden; -} - -.video-image .fl-photo-content a:after, .video-image > a:after { - content: ""; - display: inline-block; - width: 120px; - height: 120px; - opacity: 1; - position: absolute; - top: calc(50% - 60px); - left: calc(50% - 60px); - z-index: 2; - background-image: url(/wp-content/themes/bb-theme-child/assets/images/play-button.png); - background-size: 120px 120px; - background-repeat: no-repeat; - transition: all 0.4s !important; -} - -.video-image .fl-photo-content a:hover:after, .video-image > a:hover:after { - opacity: 0.7; - transition: all 0.4s !important; -} - -#video-modal-popup { - position: fixed; - width: 100%; - height: 100%; - z-index: 999; - background: rgba(51, 51, 51, 0.9); - line-height: 100vh; - padding: 20px; - box-sizing: border-box; - cursor: pointer; -} - -.video-modal-popup-container { - vertical-align: middle; - display: inline-block; - width: 100%; - text-align: center; -} - -.video-modal-wrapper { - margin: 0 auto; - max-width: 1054px; - position: relative; -} - -#video-modal-popup .video-close { - right: -20px; - top: -20px; - z-index: 99; -} - -.proof-close-btn { - display: inline-block; - position: absolute; - right: -20px; - top: -20px; - z-index: 99; - border-radius: 100px !important; - height: 36px !important; - width: 36px !important; - padding: 2px !important; - background-color: #007990 !important; - background-image: url(/wp-content/themes/bb-theme-child/assets/images/close.png) !important; - background-size: 13px 13px !important; - background-repeat: no-repeat !important; - background-position: 50% 50% !important; - font-size: 0 !important; - transition: all 0.4s; - -webkit-transition: all 0.4s; - cursor: pointer; -} - -.fl-module-rich-text ul { - list-style-type: none; - padding-left: 0px; -} - -.fl-module-rich-text ul li { - padding-left: 25px; - background-image: url(/wp-content/themes/bb-theme-child/assets/images/bullet-point.jpg); - background-repeat: no-repeat; - background-size: 13px 13px; - background-position: 0% 6px; - margin-bottom: 5px; -} - -.full-width-mobile .fl-col { - max-width: 100% !important; -} - -.fl-col { - max-width: 550px; -} - -header .fl-col, -footer .fl-col { - max-width: 100%; -} - -@media screen and (min-width: 768px) { - - .text-left .fl-col { - display: block; - } - - .text-left .fl-col .fl-col-content { - max-width: 650px; - margin-left: auto; - padding-right: 40px; - } - - .text-right .fl-col { - display: block; - } - - .text-right .fl-col .fl-col-content { - max-width: 650px; - margin-right: auto; - padding-left: 40px; - } - - .fl-col { - max-width: 100%; - } - - .inline-buttons { - display: inline-block; - vertical-align: top; - } - - .inline-button-container { - display: inline-block; - } - -} - -/* Search Bar */ - -.search-bar { - position: absolute; - top: calc(50% - 40px); - right: 0px; - width: auto !important; - z-index: 999; -} - -.menu-container .search-bar .fl-search-input { - height: 45px; - width: 45px; - border-radius: 0px; - border: 0px; - background-color: rgba(0, 0, 0, 0); - color: rgba(0, 0, 0, 0); - /*transition: 0.4s;*/ - background-image: url(./assets/images/search-icon.png); - background-size: 23px 23px; - background-position: 11.5px 50%; - background-repeat: no-repeat; - cursor: pointer; - font-size: 0; -} - -.menu-container .search-bar .fl-search-input:hover { - opacity: 0.5; -} - -.menu-container .search-bar .fl-search-input:focus { - opacity: 1 !important; - height: 45px !important; - width: 380px; - max-width: 794px; - color: #ffffff; - background-color: #fff !important; - padding-left: 47px; - cursor: text; - color: #33333a; - background-image: url(./assets/images/search-icon-blue.png); - font-size: 14px; -} - - -@media screen and (min-width: 1024px) { - .search-bar { - position: absolute; - top: calc(50% - 40px); - } -} - -@media screen and (min-width: 1440px) { - - .menu-container .search-bar .fl-search-input:focus { - width: 637px; - } - -} - -@media screen and (max-width: 767px) { - - .menu-container .search-bar { - display: none !important; - } - -} - -/*@media screen and (min-width: 768px) {*/ -/* .home-hero .fl-col-small {*/ -/* width: 70%;*/ -/* max-width: 450px;*/ -/* } */ -/*}*/ - - -/* CTA Buttons */ - -.frm_button_submit { - margin: 0px !important; -} - -.button-blue a { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px; - font-weight: normal; - min-width: 160px; - text-align: center; - background-color: #007990 !important; - border: 2px solid #007990 !important; - border-radius: 0px !important; - text-transform: uppercase; - padding: 17px 24px 13px !important; - transition: 0.4s; - font-size: 14px !important; - box-shadow: none !important; -} - -.fl-button { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px; - font-weight: normal; - min-width: 160px; - font-weight: 600 !important; - text-align: center; - border: 2px solid #007990 !important; - border-radius: 0px !important; - text-transform: uppercase; - padding: 17px 24px 13px !important; - transition: 0.4s; - font-size: 14px !important; - box-shadow: none !important; -} - -.frm_button_submit, -.button-blue a span { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - color: #fff !important; - font-weight: 600 !important; - font-size: 14px !important; - transition: 0.4s; -} - -.frm_button_submit { - line-height: 1.2 !important; -} - -.frm_button_submit:hover, -.button-blue a:hover, -a.fl-button:hover { - background-color: rgba(0, 0, 0, 0) !important; - transition: 0.4s; -} - -.frm_button_submit:hover, -.button-blue a:hover span, -a.fl-button:hover, -a.fl-button:hover span { - color: #007990 !important; - transition: 0.4s; -} - -.button-white-border a { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px; - min-width: 160px; - text-align: center; - background-color: rgba(255, 255, 255, 0) !important; - border: 2px solid #fff !important; - border-radius: 0px !important; - text-transform: uppercase; - padding: 17px 24px 13px !important; - transition: 0.4s; - font-size: 14px !important; -} - -.button-white-border a span { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px; - font-weight: normal; - color: #fff !important; - font-weight: 600 !important; - font-size: 14px !important; - transition: 0.4s; -} - -.button-white-border a:hover { - background-color: #fff !important; - transition: 0.4s; -} - -.button-white-border a:hover span { - color: #007990 !important; - transition: 0.4s; -} - -.button-blue-border a { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px; - min-width: 160px; - text-align: center; - background-color: rgba(255, 255, 255, 0) !important; - border: 2px solid #007990 !important; - border-radius: 0px !important; - text-transform: uppercase; - padding: 17px 24px 13px !important; - transition: 0.4s; - font-size: 14px !important; -} - -body .button-blue-border a span { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px; - color: #007990 !important; - font-weight: 600 !important; - font-size: 14px !important; - transition: 0.4s; -} - -.button-blue-border a:hover { - background-color: #007990 !important; - transition: 0.4s; -} - -.button-blue-border a:hover span { - color: #fff !important; - transition: 0.4s; -} - -.button-red-border a.fl-button { - background-color: rgba(255, 255, 255, 0) !important; - border: 2px solid #f63f00 !important; - color: #f63f00 !important; - border-radius: 0px !important; -} - -.button-red-border a.fl-button:hover { - color: white !important; -} - -.button-red-border a.fl-button span { - color: #f63f00 !important; -} - -.button-red-border a:hover { - background-color: #f63f00 !important; - transition: 0.4s; -} - -.button-red-border a:hover span { - color: #fff !important; - transition: 0.4s; -} - -.frm_button_submit, -.button-red a { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px; - min-width: 160px; - text-align: center; - background-color: #f63f00 !important; - border: 2px solid #f63f00 !important; - border-radius: 0px !important; - text-transform: uppercase; - padding: 17px 24px 13px !important; - transition: 0.4s; - font-size: 14px !important; - box-shadow: 0 0 !important; -} - -.button-red a span, -a.fl-button span { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px; - font-weight: normal; - color: #fff !important; - font-weight: 600 !important; - font-size: 14px !important; - transition: 0.4s; -} - -.button-red a.fl-button, .button-red a.fl-button:visited { - background-color: #f63f00 !important; -} - -.button-red a:hover, -.frm_button_submit:hover { - background-color: rgba(255, 88, 77, 0) !important; - color: #f63f00 !important; - transition: 0.4s; -} - -.button-red a:hover span, -.frm_button_submit:hover { - color: #f63f00 !important; - transition: 0.4s; -} - -.fl-button-text { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px; - font-weight: normal; -} - -@media screen and (min-width: 768px) { - - .frm_button_submit, - a.fl-button, - a.fl-button span, - .cta-inner-container .fl-button, - .cta-inner-container .frm_button_submit, - .white-form .frm_button_submit, - .button-blue-border a, - .button-white-border a, - .button-red a, - .button-blue a, - .button-blue-border a span, - .button-white-border a span, - .button-red a span, - body .button-blue-border a span, - .button-blue a span { - font-size: 15px !important; - } - -} - -@media screen and (min-width: 1024px) { - - .frm_button_submit, - a.fl-button, - a.fl-button span, - .cta-inner-container .fl-button, - .cta-inner-container .frm_button_submit, - .white-form .frm_button_submit, - .button-blue-border a, - .button-white-border a, - .button-red a, - .button-blue a, - .button-blue-border a span, - .button-white-border a span, - .button-red a span, - body .button-blue-border a span, - .button-blue a span { - min-width: 200px; - font-size: 16px !important; - } - -} - -/* Aminations */ - -@-webkit-keyframes fl-slide-in-up { - from { - opacity: 0; - -webkit-transform: translate3d(0, 20%, 0); - transform: translate3d(0, 20%, 0); - visibility: visible; - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } - -} - -@keyframes fl-slide-in-up { - from { - opacity: 0; - -webkit-transform: translate3d(0, 20%, 0); - transform: translate3d(0, 20%, 0); - visibility: visible; - } - to { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} - -@-webkit-keyframes fl-slide-in-right { - 0% { - opacity: 0; - -webkit-transform: translate3d(5%, 0, 0); - transform: translate3d(5%, 0, 0); - visibility: visible; - } - 100% { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} - -@keyframes fl-slide-in-right { - 0% { - opacity: 0; - -webkit-transform: translate3d(5%, 0, 0); - transform: translate3d(5%, 0, 0); - visibility: visible; - } - 100% { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} - -@-webkit-keyframes fl-fade-left { - 0% { - opacity: 0; - -webkit-transform: translate3d(-5%, 0, 0); - transform: translate3d(-5%, 0, 0) !important; - } - 100% { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} - -@keyframes fl-fade-left { - 0% { - opacity: 0; - -webkit-transform: translate3d(-5%, 0, 0); - transform: translate3d(-5%, 0, 0); - } - 100% { - opacity: 1; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} - - -.solutions-page.callout-style .fl-callout-title { - display: none; -} - -.solutions-page.callout-style .fl-callout-text { - margin-bottom: 30px; -} - -.callout-style .fl-callout-text { - padding-bottom: 20px !important; -} - -.full-width-button .fl-callout-button a { - width: calc(100% - 80px); -} - -.callout-container.no-icon .callout-style .fl-callout-title { - padding-top: 0px !important; -} - -.callout-container.no-icon .fl-module-content { - margin-top: 10px !important; -} - -@media screen and (min-width: 768px) { - - .callout-container.no-icon .callout-style .fl-callout-title { - padding-top: 20px !important; - } - - .callout-container.no-icon .fl-module-content { - margin-top: 20px !important; - } - - .callout-container.no-icon .fl-col-content { - padding-top: 0px !important; - } - - .callout-container .fl-col-content { - padding-top: 120px; - padding-bottom: 102px !important; - position: relative; - } - - .callout-style .fl-callout-button { - position: absolute; - bottom: 60px; - width: 100%; - left: 0; - } - - .callout-style .fl-callout-photo .fl-photo { - position: absolute; - top: 60px; - width: 100%; - left: 0; - } - -} - - -/* Inspiration Post Grid */ - -.inspiration-post-grid .fl-post-grid-post { - border: 0px; -} - -.inspiration-post-grid .fl-post-image { - background-size: cover; - background-position: 50%; - height: 0; - padding-bottom: 56.2%; -} - -.inspiration-post-grid .fl-post-text { - padding: 25px 20px 20px; - text-align: center; -} - -.inspiration-post-grid .fl-post-more-link { - padding-top: 0px; -} - -.inspiration-post-grid .fl-post-more-link a { - text-transform: uppercase; - font-weight: 600; -} - -.inspiration-post-grid a, -.inspiration-post-grid a:hover { - transition: 0.4s; -} - -@media screen and (min-width: 768px) { - - .inspiration-post-grid .fl-post-text { - padding: 25px 20px 30px; - text-align: center; - } - -} - - -/* Subscribe Section */ - -.subscribe-text-section p { - font-size: 14px; -} - -.subscribe-form .frm_forms input[type=email] { - margin-bottom: 15px !important; -} - -.frm_submit { - margin-top: 20px; -} - -@media screen and (min-width: 768px) { - - .subscribe-form .frm_button_submit.frm_final_submit { - min-width: 200px; - } - - .frm_submit { - margin-top: 0px; - } - - .subscribe-form .frm_checkbox label { - padding-top: 15px; - } - - .subscribe-form .frm_fields_container { - width: 100%; - font-size: 0; - } - - .subscribe-text-section p { - font-size: 15px; - } - - .subscribe-form .frm_fields_container { - position: relative; - } - - .subscribe-form .frm_fields_container, - .subscribe-form .frm_form_field:first-of-type, - .subscribe-form .frm_submit { - display: inline-block; - vertical-align: top; - } - - .subscribe-form .frm_forms input[type=email] { - margin-bottom: 0px !important; - } - - .subscribe-form .frm_form_field:first-of-type { - max-width: calc(100% - 220px) !important; - } - - .subscribe-form .frm_submit { - margin-left: 20px; - position: absolute; - top: 0px; - right: 0px; - } - -} - -@media screen and (min-width: 1024px) { - - .subscribe-text-section p { - font-size: 16px; - } - - .subscribe-section, - .subscribe-text-section, - .subscribe-form { - display: inline-block; - } - - .subscribe-form, - .subscribe-text-section { - width: 50%; - } - - .subscribe-section { - width: 100%; - font-size: 0; - } - - .subscribe-section, - .subscribe-text-section, - .subscribe-form { - display: inline-block; - vertical-align: middle; - } - -} - -@media screen and (min-width: 1200px) { - .subscribe-section .subscribe-text-section { - width: 600px; - } - - .subscribe-section .subscribe-form { - width: calc(100% - 600px); - min-width: 600px !important; - } -} - -/* Slick Slider */ - -.seliro-slider { - text-align: center; - position: relative; -} - -.seliro-slider ul.slick-dots { - display: inline-block; - padding-left: 0px; - list-style-type: none; -} - -.seliro-slider ul.slick-dots > li { - display: inline-block; -} - -.seliro-slider ul.slick-dots > li > button { - border: 2px solid #007990; - background: #fff; - color: #fff; - font-size: 0; - border-radius: 50%; - margin: 5px; - padding: 0; - height: 22.5px; - width: 22.5px; - -webkit-transition: ease-in-out .2s; - -o-transition: ease-in-out .2s; - transition: ease-in-out .2s; -} - -.seliro-slider ul.slick-dots > li:focus, -.slick-slide:focus { - outline: none; -} - -.seliro-slider ul.slick-dots > li > button:hover, -.seliro-slider ul.slick-dots > li.slick-active > button { - background: #007990; -} - -.seliro-slider ul.slick-dots > li.slick-active > button:active, -.seliro-slider ul.slick-dots > li.slick-active > button:focus { - top: 0 !important; -} - -.slide-text { - position: relative; -} - -.slide-text > h4 { - color: #969696; - font-style: italic; - font-weight: 400; - margin-bottom: 60px; -} - -.slide-image { - margin: 0 auto; - width: 120px; - height: 120px; - background-position: center center; - background-repeat: no-repeat; - background-size: cover; - border-radius: 50%; - margin-bottom: 8px; -} - -.slide-name > h4 { - color: #007990 !important; - margin-bottom: 5px !important; -} - -.white-slider h4, -.white-slider .slide-company, -.white-slider .slide-name h4 a { - color: #fff !important; -} - -.white-slider .seliro-slider ul.slick-dots > li > button:hover, .white-slider .seliro-slider ul.slick-dots > li.slick-active > button { - background: #fff !important; -} - -.white-slider .seliro-slider ul.slick-dots > li > button { - border: 2px solid #fff; - background: rgba(0, 0, 0, 0); -} - -.slide-company { - margin-bottom: 20px; - font-size: 12px; -} - -@media screen and (min-width: 992px) { - .slide-text { - max-width: 50%; - margin-left: auto; - margin-right: auto; - } - - .seliro-slider::before, - .seliro-slider::after { - content: ""; - width: 104px; - height: 85px; - background-image: url(/wp-content/themes/bb-theme-child/assets/images/slider-arrow-gray.png); - background-position: center center; - background-repeat: no-repeat; - background-size: contain; - position: absolute; - top: 45px; - } - - .seliro-slider::before { - left: 12.5%; - background-image: url(/wp-content/themes/bb-theme-child/assets/images/slider-arrow-gray-reverse.png); - } - - .white-slider .seliro-slider::before, - .white-slider .seliro-slider::after { - content: ""; - width: 104px; - height: 85px; - background-image: url(/wp-content/themes/bb-theme-child/assets/images/slider-arrow-dark-gray.png); - background-position: center center; - background-repeat: no-repeat; - background-size: contain; - position: absolute; - top: 45px; - } - - .white-slider .seliro-slider::before { - left: 12.5%; - background-image: url(/wp-content/themes/bb-theme-child/assets/images/slider-arrow-dark-gray-reverse.png); - } - - .seliro-slider::after { - right: 12.5%; - } -} - -/* Seliro Tabs */ -.seliro-tabs .nav-tabs { - border-bottom: none; -} - -.seliro-tabs .nav-tabs > li { - margin-bottom: 0px; - width: 100%; - text-align: center; -} - -.seliro-tabs .nav-tabs > li > a { - border-radius: 0px; - border: 2px solid #ddd; - border-bottom: none; - margin-right: 0; - color: black !important; - font-weight: bold; - padding: 12px 15px; - transition: ease-in-out .2s; -} - -.seliro-tabs .nav-tabs > li > a:hover, -.seliro-tabs .nav-tabs > li > a:active, -.seliro-tabs .nav-tabs > li > a:focus, -.seliro-tabs .nav-tabs > li > a.active { - background-color: #eee; -} - -.seliro-tabs .tab-content { - display: none; -} - -.seliro-tabs .tab-content.active { - border: 2px solid #ddd; - display: block; - padding: 20px; - width: 100%; -} - -.seliro-tabs .tab-content.active .tab-columns { -} - -.seliro-tabs .tab-content.active .tab-columns > ul { - padding-left: 0px; - list-style-type: none; -} - -.seliro-tabs .tab-content .tab-columns > ul { - margin-bottom: 20px; -} - -.seliro-tabs .tab-content .tab-columns > ul > li { - position: relative; - margin-bottom: 8px; - margin-left: 23px; - font-size: 16px; -} - -.seliro-tabs .tab-content .tab-columns ul > h5 { - margin-bottom: 20px; -} - -.seliro-tabs .tab-content .tab-description { - margin-bottom: 20px; -} - -.seliro-tabs .tab-content .tab-download { - position: relative; - margin-left: 23px; - font-weight: bold; - margin-bottom: 20px; - display: block; -} - -.seliro-tabs .tab-content .tab-download::before { /* PDF download */ - content: '\f1c1'; - font-family: 'Font Awesome\ 5 Free'; - font-weight: bold; - font-size: 14px; - position: absolute; - top: 55%; - transform: translateY(-50%); - left: -22px; -} - -.seliro-tabs .tab-content .tab-columns > ul > li::before { - content: '\f140'; - font-family: 'Font Awesome\ 5 Free'; - font-weight: bold; - font-size: 14px; - position: absolute; - top: 14px; - transform: translateY(-50%); - left: -22px; -} - -@media screen and (min-width: 768px) { - - .seliro-tabs .nav-tabs > li > a { - padding: 5px 15px; - } - -} - -@media screen and (min-width: 992px) { - - .seliro-tabs .nav-tabs > li { - width: inherit; - text-align: center; - } - - .seliro-tabs .tab-content.active { - display: inline-block; - padding: 40px; - } - - .seliro-tabs .nav-tabs > li > a.active::after { - content: ''; - height: 6px; - background-color: #fff; - width: 100%; - position: absolute; - bottom: -4px; - left: 0; - } - - .seliro-tabs .nav-tabs > li > a:hover, - .seliro-tabs .nav-tabs > li > a:active, - .seliro-tabs .nav-tabs > li > a:focus, - .seliro-tabs .nav-tabs > li > a.active { - background-color: #fff; - } - - .seliro-tabs .tab-content.active .tab-columns { - } - - .seliro-tabs .tab-content.active .tab-columns > ul { - display: inline-block; - width: 45%; - vertical-align: top; - margin-right: 5%; - margin-bottom: 0px; - } - - .seliro-tabs .nav-tabs > li > a { - padding: 10px 30px; - border-right: 2px solid #ddd !important; - border-left: none; - } - - .seliro-tabs .nav-tabs > li > a.active { - border-bottom: 0; - } - - .seliro-tabs .nav-tabs > li:first-child > a { - border-right: none; - border-left: 2px solid #ddd !important; - } - - .seliro-tabs .nav-tabs > li:last-child > a { - border-right: 2px solid #ddd; - } - -} - -/* Book a Session */ - -.book-a-session-section .fl-row-content-wrap { - background-image: url(/wp-content/themes/bb-theme-child/assets/images/section-arrow.png); - background-position: top center; - background-repeat: no-repeat; - background-size: 58px 29px; - background-color: transparent !important; -} - -.book-a-session-section { - background-color: #e8e8e8; -} - -@media screen and (min-width: 768px) { - - .section-left p { - font-size: 15px; - } - - .book-a-session-section .fl-col-content { - display: inline-block; - font-size: 0; - width: 100%; - } - - .section-left { - width: calc(100% - 240px) !important; - display: inline-block; - vertical-align: middle; - } - - .section-left p { - font-size: 14px; - } - - .section-right { - width: 240px !important; - display: inline-block; - vertical-align: middle; - } - -} - -@media screen and (min-width: 1024px) { - - .section-left p { - font-size: 16px; - } - -} - -/* Steps Section */ - -.step-container { - margin: 0 auto; - max-width: 350px; - vertical-align: top; - text-align: center; - padding: 30px 20px 60px 20px; - background-image: url(/wp-content/themes/bb-theme-child/assets/images/arrow-down.png); - background-position: bottom center; - background-repeat: no-repeat; - background-size: 60px 39px; -} - -.step-container:first-of-type { - padding-top: 0px; -} - -.step-container:last-of-type { - background-image: none !important; - padding-bottom: 0px; -} - -.step-container-img { - margin: 0 auto; - margin-bottom: 15px; - width: 75px; - height: 75px; - background-position: center center; - background-size: contain; - background-repeat: no-repeat; -} - -.step-container p { - font-size: 14px; -} - -.steps-main-container .step-container img { - min-height: 75px; - max-height: 75px; - padding-bottom: 20px; -} - -@media screen and (min-width: 768px) { - - .step-container p { - font-size: 15px; - } - -} - -@media screen and (min-width: 1024px) { - - .steps-main-container { - font-size: 0; - display: inline-block; - } - - .step-container { - display: inline-block; - width: 20%; - vertical-align: top; - text-align: center; - padding: 0px 45px 0px 5px; - background-image: url(/wp-content/themes/bb-theme-child/assets/images/arrow-right.png); - background-position: top right; - background-repeat: no-repeat; - background-size: 39px 60px; - } - - .step-container p { - font-size: 16px; - } - -} - - -/* ======================================== - KNOWLEDGE & INSPIRATION - ===================================== */ - -.breadcrumb-title, -.breadcrumb { - text-transform: uppercase; - font-size: 14px; - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - color: #000; -} - -.breadcrumb { - font-weight: bold; -} - -.breadcrumb-pointer { - font-size: 0; - background-image: url(/wp-content/themes/bb-theme-child/assets/images/breadcrumb-arrow.png); - background-position: calc(50% + 1px) 50%; - background-repeat: no-repeat; - background-size: 5px 9px; - height: 26px; - width: 18px; - display: inline-block; - vertical-align: top; -} - - -.breadcrumb-title:hover, -.breadcrumb a { - color: #000; -} - -.facetwp-pager { - text-align: center; -} - -.facetwp-page { - padding: 7px 12px !important; - border: solid 2px #007990; - margin-right: 5px; - transition: 0.4s; - font-weight: bold; - color: #007990; - height: 41px; - vertical-align: top; - width: 38px; -} - -.facetwp-page:hover { - border: solid 2px #007990; - background-color: #007990; - color: #fff; - transition: 0.4s; - text-decoration: none !important; -} - -.facetwp-page.active { - border: solid 2px #007990; - background-color: #007990; - color: #fff; - font-weight: bold; -} - -.facetwp-page.active:hover { - text-decoration: none !important; - border: solid 2px #007990; - background-color: #007990; - color: #fff; -} - -.facetwp-page.next, -.facetwp-page.prev { - font-size: 0; - height: 41px; - vertical-align: top; - width: 41px; - background-position: center; - background-repeat: no-repeat; - background-size: 8px 12px; -} - -.facetwp-page.next { - background-image: url(/wp-content/themes/bb-theme-child/assets/images/arrow-right-blue.png); -} - -.facetwp-page.next:hover { - background-image: url(/wp-content/themes/bb-theme-child/assets/images/arrow-right-white.png); -} - -.facetwp-page.prev { - background-image: url(/wp-content/themes/bb-theme-child/assets/images/arrow-left-blue.png); -} - -.facetwp-page.prev:hover { - background-image: url(/wp-content/themes/bb-theme-child/assets/images/arrow-left-white.png); -} - -.cta-inner-container { - background-color: #007990 !important; - padding: 40px; - text-align: center; - background-size: cover; - background-repeat: no-repeat; - background-position: center center; -} - -.cta-inner-container p, -.cta-inner-container h4, -.cta-inner-container .frm_checkbox label { - color: #fff !important; -} - -.cta-inner-container * { - text-align: center; -} - -.cta-inner-container .cta-content { - margin-bottom: 20px; -} - -.cta-container, -.cta-inner-container { - height: 100%; -} - -.cta-inner-container img { - margin-bottom: 20px; -} - -.cta-container > a > img:hover { - transition: all 0.6s; - -webkt-transition: all 0.6s; - opacity: 0.7; - -} - -.youtube-embed { - position: relative; - padding-bottom: 56.25%; /* 16:9 */ - height: 0; -} - -.youtube-embed iframe { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; -} - -.facetwp-radio, -.facetwp-radio.checked { - background: none !important; -} - -.facetwp-counter { - display: none; -} - -.facetwp-radio:hover { - text-decoration: none; -} - -.facetwp-radio { - color: #fff; - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - text-transform: uppercase; - font-weight: 600; - padding-left: 15px !important; - padding-right: 15px !important; - display: inline-block; - font-size: 15px; - transition: 0.4s; -} - -.facetwp-radio:hover { - color: #007990; - transition: 0.4s; -} - -.facetwp-radio.checked { - color: #007990; - transition: 0.4s; -} - -.facetwp-facet { - text-align: center; - margin-bottom: 5px !important; - margin-top: 5px !important; -} - -.cta-inner-container .frm_checkbox, -.cta-inner-container .frm_button_submit, -.cta-inner-container .frm_submit { - text-align: center !important; -} - -.cta-inner-container .frm_checkbox { - margin-bottom: 30px; -} - -.cta-inner-container input[type=email] { - margin-bottom: 15px !important; - text-align: left; -} - -#cta-loop .fl-post-grid-post { - margin-bottom: 20px; -} - -.video-container { - margin-bottom: 15px; -} - -.blog-post-container, -.cta-outter-container { - width: 100%; -} - -.blog-post-container { - margin-bottom: 40px; -} - -.blog-post-container .fl-col-content, -.cta-outter-container .fl-col-content { - max-width: 550px; - margin: 0 auto; -} - -.inspiration-post-grid .fl-post-column { - padding-bottom: 20px !important; -} - -.customer-logo img { - max-height: 160px; - max-width: 230px; -} - -@media screen and (min-width: 768px) { - - .inspiration-post-grid .fl-post-column { - padding-bottom: 30px !important; - } - -} - -@media screen and (min-width: 1024px) { - - .cta-outter-container { - width: 35%; - max-width: 100%; - } - - .blog-post-container { - width: 65%; - max-width: 100%; - } - - .blog-post-container .fl-col-content, - .cta-outter-container .fl-col-content { - max-width: 100%; - margin: 0 auto; - } - - .blog-post-container { - margin-bottom: 0px; - } - -} - -/** -* Seliro Image Repeater Styling. -**/ -.seliro-images-repeater { - display: flex; - flex-direction: column; - flex-wrap: nowrap; - justify-content: space-around; - text-align: center; -} - -.image-repeate-image { - text-align: center; - margin: 0 auto; - width: 55px; - height: 55px; - background-position: center center; - background-repeat: no-repeat; - background-size: contain; - margin-bottom: 15px; -} - -.image-repeater-column { - margin-bottom: 30px; -} - -@media screen and (min-width: 992px) { - .seliro-images-repeater { - flex-direction: row; - } - - .image-repeater-column { - margin-bottom: 0px; - } -} - -/** -* Customer Cases Post Grid -**/ - -.customer-cases-container .fl-col { - min-width: 100% !important; -} - -.customer-cases .fl-post-text { - text-align: center; - padding: 35px 20px 60px; -} - -.customer-cases .fl-post-title, -.customer-cases .fl-post-excerpt, -.customer-cases .customer-name { - padding-bottom: 20px -} - -.customer-cases .fl-post-title a, -.customer-cases .fl-post-title a:hover { - transition: 0.4s; -} - -.customer-cases .fl-post-image { - background-size: cover; - background-position: 50%; - min-height: 350px; -} - -.customer-cases .fl-post-more-link { - padding: 20px 0px 14px; -} - -.customer-cases .fl-post-more-link a { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px !important; - min-width: 160px !important; - text-align: center !important; - background-color: #f63f00 !important; - border: 2px solid #f63f00 !important; - border-radius: 0px !important; - text-transform: uppercase !important; - padding: 19px 44px 15px !important; - transition: 0.4s !important; - font-size: 14px !important; - box-shadow: 0 0 !important; - font-size: 16px !important; - font-weight: bold !important; - color: #fff !important; -} - -.customer-cases .fl-post-more-link a:hover { - background-color: rgba(0, 0, 0, 0) !important; - color: #f63f00 !important; - text-decoration: none !important; - transition: 0.4s !important; -} - -@media screen and (min-width: 768px) { - - .customer-cases .fl-post-text { - max-width: 690px; - padding: 100px 60px 100px 60px; - } - - .customer-cases .fl-post-text-container, - .customer-cases .fl-post-image { - flex: 1; - vertical-align: top; - } - - .customer-cases .fl-post-feed-post { - display: flex; - width: 100%; - border: 0px !important; - } - - .customer-cases .fl-post-feed-post:nth-child(odd) { - flex-direction: row-reverse; - } - - .customer-cases .fl-post-feed-post:nth-child(odd) .fl-post-text { - padding: 100px 60px 100px 60px; - margin-left: auto !important; - } - - .customer-cases .fl-post-feed-post:nth-child(even) .fl-post-text { - margin-right: auto !important; - } - -} - - -/** -* Investor Post Grid -**/ - -.investor-post-grid .fl-post-grid-post { - border: 0px !important; -} - -.investor-post-grid .fl-post-image { - background-size: cover; - background-position: center top; - height: 375px; -} - -.customer-logo { - text-align: center; - padding: 20px; -} - -@media screen and (min-width: 768px) { - - .customer-logos-container { - display: inline-block; - width: 100%; - font-size: 0; - } - - .customer-logo { - display: inline-block; - width: 33.333%; - } - -} - - -/* ======================================== - SHARPSPRING FORMS - ===================================== */ - -.sharpspring_form form { - background: none; -} - -.sharpspring_form input[type=text], -.sharpspring_form input[type=email] { - height: 53px; - border: 2px solid #fff; - border-radius: 0px; - background-color: #fff; - padding: 7px 12px 7px 12px; - width: 100%; - margin-bottom: 0 !important; - box-shadow: none !important; - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - font-size: 14px; - -webkit-appearance: none !important; -} - -.sharpspring_form textarea { - height: 126px; - border: 2px solid #fff; - border-radius: 0px; - background-color: #fff; - padding: 10px 12px 10px; - width: 100%; - margin-bottom: 0 !important; - color: #007990; - box-shadow: none !important; - font-size: 14px; - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; -} - -.sharpspring_form label { - display: block; - padding-left: 20px !important; - text-indent: -20px; - font-size: 13px !important; - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; -} - -.sharpspring_form input[type=checkbox] { - -webkit-appearance: none !important; - height: 16px !important; - width: 16px !important; - background-color: #fff; - border-radius: 3px !important; - box-shadow: none !important; - vertical-align: sub !important; - border: 1px solid #717dac; - margin: 4px 5px 0 0; -} - -.sharpspring_form li.field.text label, -.sharpspring_form li.field.email label, -.sharpspring_form li.field.textarea label, -.sharpspring_form li.field.checkbox .required { - display: none; -} - -.sharpspring_form #submit_button { - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - letter-spacing: 1.2px; - min-width: 160px; - text-align: center; - background-color: #f63f00 !important; - border: 2px solid #f63f00 !important; - border-radius: 0px !important; - text-transform: uppercase; - padding: 17px 24px 13px !important; - transition: 0.4s; - font-size: 14px !important; - box-shadow: 0 0 !important; - display: inline-block; - width: auto; - height: auto; - font-size: 16px !important; -} - -@media screen and (min-width: 432px) { - .sharpspring_form #submit_button { - min-width: 200px; - } - - .sharpspring_form li.firstName, - .sharpspring_form li.companyName { - width: 50%; - display: inline-block; - box-sizing: border-box; - } - - .sharpspring_form li.firstName { - padding-right: 5px; - } - - .sharpspring_form li.companyName { - padding-left: 5px; - } -} - - -/* Cookie Consent UK */ - -#cookie-notice .cn-button { - background-color: #007990 !important; - border-radius: 0px !important; - border: 2px solid #007990 !important; - transition: 0.4s; -} - -#cookie-notice .cn-button:hover { - color: #007990 !important; - background-color: rgba(0, 0, 0, 0) !important; - transition: 0.4s; -} - -html.has-cookie-bar.cookie-bar-top-bar { - margin-top: 30px; - -webkit-transition: all 0.25s; - -moz-transition: all 0.25s; - transition: all 0.25s; -} - -#catapult-cookie-bar { - box-sizing: border-box; - max-height: 0; - opacity: 0; - direction: ltr; - padding: 0 20px; - z-index: 99999; - overflow: hidden; - text-align: left; - -webkit-transition: all 0.25s; - -moz-transition: all 0.25s; - transition: all 0.25s; -} - -.ctcc-exclude-AF.geoip-continent-AF #catapult-cookie-bar, -.ctcc-exclude-AN.geoip-continent-AN #catapult-cookie-bar, -.ctcc-exclude-AS.geoip-continent-AS #catapult-cookie-bar, -.ctcc-exclude-EU.geoip-continent-EU #catapult-cookie-bar, -.ctcc-exclude-NA.geoip-continent-NA #catapult-cookie-bar, -.ctcc-exclude-OC.geoip-continent-OC #catapult-cookie-bar, -.ctcc-exclude-SA.geoip-continent-SA #catapult-cookie-bar { - display: none; -} - -.ctcc-exclude-AF.geoip-continent-AF, -.ctcc-exclude-AN.geoip-continent-AN, -.ctcc-exclude-AS.geoip-continent-AS, -.ctcc-exclude-EU.geoip-continent-EU, -.ctcc-exclude-NA.geoip-continent-NA, -.ctcc-exclude-OC.geoip-continent-OC, -.ctcc-exclude-SA.geoip-continent-SA { - margin-top: 0 !important; -} - -#catapult-cookie-bar.rounded-corners { - border-radius: 3px; -} - -#catapult-cookie-bar.drop-shadow { - -webkit-box-shadow: 0px 3px 9px 0px rgba(0, 0, 0, 0.4); - -moz-box-shadow: 0px 3px 9px 0px rgba(0, 0, 0, 0.4); - box-shadow: 0px 3px 9px 0px rgba(0, 0, 0, 0.4); -} - -.cookie-bar-block #catapult-cookie-bar { - max-height: 999px; - -webkit-transition: opacity 0.25s; - -moz-transition: opacity 0.25s; - transition: opacity 0.25s; -} - -.has-cookie-bar #catapult-cookie-bar { - opacity: 1; - max-height: 999px; - min-height: 30px; - padding: 15px 20px 15px; -} - -.cookie-bar-block #catapult-cookie-bar span { - display: block; - margin: 1em 0; -} - -.cookie-bar-bar #catapult-cookie-bar.float-accept span.ctcc-right-side { - float: right; -} - -button#catapultCookie { - cursor: pointer; - margin: 0 20px 0 0; -} - -.cookie-bar-bar button#catapultCookie { - margin: 0 0 0 20px; -} - -.cookie-bar-bar .ctcc-inner { - display: -webkit-flex; - display: flex; - -webkit-align-items: center; - align-items: center; - -webkit-justify-content: center; - justify-content: center; - position: relative; -} - -.cookie-bar-bar .float-accept .ctcc-inner { - -webkit-justify-content: space-between; - justify-content: space-between; -} - -@media screen and (max-width: 991px) { - .ctcc-left-side { - margin-right: 1em; - } -} - -.ctcc-right-side { - -webkit-flex-shrink: 0; - flex-shrink: 0; -} - -.cookie-bar-block #catapult-cookie-bar h3 { - margin: 0.5em 0 0; -} - -.use_x_close .x_close { - position: absolute; - top: 10px; - right: 10px; - cursor: pointer; - font-family: sans-serif; - -webkit-transition-duration: 0.5s; - transition-duration: 0.5s; -} - -.cookie-bar-bar .use_x_close .x_close { - right: 0; - top: 50%; - -webkit-transform: translateY(-50%); - transform: translateY(-50%); -} - -.x_close { - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - -webkit-transform: translate3d(0px, 0px, 0px); - width: 14px; - height: 30px; - position: relative; - margin: 0 auto; - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -o-transform: rotate(0deg); - transform: rotate(0deg); - -webkit-transition: .5s ease-in-out; - -moz-transition: .5s ease-in-out; - -o-transition: .5s ease-in-out; - transition: .5s ease-in-out; - cursor: pointer; -} - -.x_close span { - display: block; - position: absolute; - height: 3px; - width: 14px; - background: #000; - border-radius: 6px; - opacity: 1; - left: 0; - -webkit-transform: rotate(0deg); - -moz-transform: rotate(0deg); - -o-transform: rotate(0deg); - transform: rotate(0deg); - -webkit-transition: .25s ease-in-out; - -moz-transition: .25s ease-in-out; - -o-transition: .25s ease-in-out; - transition: .25s ease-in-out; - transition-delay: .14s; - -webkit-transition-delay: .14s; - -moz-transition-delay: .14s; -} - -.x_close span:nth-child(1), -.x_close span:nth-child(2) { - top: 14px; -} - -.x_close span:nth-child(1) { - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); -} - -.x_close span:nth-child(2) { - -webkit-transform: rotate(-45deg); - -moz-transform: rotate(-45deg); - -o-transform: rotate(-45deg); - transform: rotate(-45deg); -} - -.x_close:hover span:nth-child(1) { - -webkit-transform: rotate(0); - -moz-transform: rotate(0); - -o-transform: rotate(0); - transform: rotate(0); -} - -.x_close:hover span:nth-child(2) { - -webkit-transform: rotate(0); - -moz-transform: rotate(0); - -o-transform: rotate(0); - transform: rotate(0); -} - -/* Email Encoder */ - -span.eeb-nodis { - display: none !important; -} - -span.eeb-rtl { - unicode-bidi: bidi-override !important; - direction: rtl !important; - display: inline !important; -} - -span.eeb-rtl span.eeb-sd, span.eeb-nrtl span.eeb-sd { - display: inline !important; - padding-left: 0 !important; -} - -span.eeb-nrtl { - word-break: break-all !important; -} - -.eeb-encoded { - position: relative; - margin-top: -0.3em; - z-index: 1000; - color: green; -} - - -/* Slick */ - -/* Slider */ -.slick-slider { - position: relative; - - display: block; - box-sizing: border-box; - - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - - -webkit-touch-callout: none; - -khtml-user-select: none; - -ms-touch-action: pan-y; - touch-action: pan-y; - -webkit-tap-highlight-color: transparent; -} - -.slick-list { - position: relative; - - display: block; - overflow: hidden; - - margin: 0; - padding: 0; -} - -.slick-list:focus { - outline: none; -} - -.slick-list.dragging { - cursor: pointer; -} - -.slick-slider .slick-track, -.slick-slider .slick-list { - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); -} - -.slick-track { - position: relative; - top: 0; - left: 0; - - display: block; - margin-left: auto; - margin-right: auto; -} - -.slick-track:before, -.slick-track:after { - display: table; - - content: ''; -} - -.slick-track:after { - clear: both; -} - -.slick-loading .slick-track { - visibility: hidden; -} - -.slick-slide { - display: none; - float: left; - - height: 100%; - min-height: 1px; -} - -[dir='rtl'] .slick-slide { - float: right; -} - -.slick-slide img { - display: block; -} - -.slick-slide.slick-loading img { - display: none; -} - -.slick-slide.dragging img { - pointer-events: none; -} - -.slick-initialized .slick-slide { - display: block; -} - -.slick-loading .slick-slide { - visibility: hidden; -} - -.slick-vertical .slick-slide { - display: block; - - height: auto; - - border: 1px solid transparent; -} - -.slick-arrow.slick-hidden { - display: none; -} - - -.widget_polylang select { - max-width: 400px; - position: relative; - padding: 10px 32px 10px 8px; - display: flex; - cursor: pointer; - width: 100%; - border: 1px solid silver; - -webkit-appearance: none; - border-radius: 0px; - background-color: rgba(0, 0, 0, 0); - text-transform: uppercase; -} - -.widget_polylang select:before { - border-bottom: 1px solid silver !important; - border-right: 1px solid silver !important; - content: ''; - background-size: contain; - height: 12px; - width: 12px; - position: absolute; - right: 12px; - top: 12px; - transition: .2s ease-out; - border-bottom: 1px solid gray; - border-right: 1px solid gray; - transform: rotate(45deg); - color: silver; -} - -#redirect-notice { - position: fixed; - z-index: 999; - background: white; - bottom: 0px; - margin: 20px; - width: calc(100% - 40px); - max-width: 1100px; - padding: 20px; - left: calc(50% - 20px); - transform: translateX(-50%); - box-shadow: 0px 0px 20px -5px rgba(0, 0, 0, 0.3); - -webkit-box-shadow: 0px 0px 20px -5px rgba(0, 0, 0, 0.3); - -moz-box-shadow: 0px 0px 20px -5px rgba(0, 0, 0, 0.3); -} - -.cookies-not-set #redirect-notice { - margin: 20px 20px 80px !important; -} - -#redirect-notice.hide { - display: none !important; -} diff --git a/bbfd/docs/css/iopsys-white.svg b/bbfd/docs/css/iopsys-white.svg deleted file mode 100644 index c201c2b4..00000000 --- a/bbfd/docs/css/iopsys-white.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/bbfd/docs/css/pdf.css b/bbfd/docs/css/pdf.css deleted file mode 100644 index bcae0358..00000000 --- a/bbfd/docs/css/pdf.css +++ /dev/null @@ -1,17 +0,0 @@ -@page { - size: a4 portrait; - margin: 25mm 10mm 25mm 10mm; - counter-increment: page; - font-family: 'Madera', 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; - white-space: pre; - color: grey; - @top-left { - content: '© 2022 IOPSYS'; - } - @top-center { - content: string(chapter); - } - @top-right { - content: 'Page ' counter(page); - } -} \ No newline at end of file diff --git a/bbfd/docs/guide/.pages b/bbfd/docs/guide/.pages deleted file mode 100644 index 0cf2afc8..00000000 --- a/bbfd/docs/guide/.pages +++ /dev/null @@ -1,4 +0,0 @@ -title: "USP Daemon Developer Guide" - -nav: - - "..." diff --git a/bbfd/docs/guide/data_model_integration.md b/bbfd/docs/guide/data_model_integration.md deleted file mode 100644 index 237c12b7..00000000 --- a/bbfd/docs/guide/data_model_integration.md +++ /dev/null @@ -1,326 +0,0 @@ -# Third party data model integration - -It is also possible to itegrate thrid party data model to the uspd to expose it to the ubus. To do so certain APIs in data model library needs to be implemented to make the data model compatible with uspd. APIs are described below. - - -## List of libbbf methods used in uspd to integrate third party data model - -### Refernces -Deatils of bbf data model librabry can be found at [link](https://dev.iopsys.eu/iopsys/bbf/-/tree/devel/docs) - -following are the libbbf methods used in uspd to access the data model defined in libbbf - -``` dm_get_supported_dm - dm_entry_param_method - dm_entry_apply - dm_ctx_init - dm_ctx_init_sub - dm_ctx_clean - dm_ctx_clean_sub - set_bbfdatamodel_type - dm_entry_restart_services - dm_entry_revert_changes - dm_debug_browse_path - get_dm_type - dm_entry_manage_services - dm_config_ubus - - -``` - -## Methods -Description of the methods are given below - -### dm_get_supported_dm - -used to get the complete data model schema in one browse - -``` -int dm_get_supported_dm(struct dmctx *ctx, char *path, bool first_level, schema_type_t schema_type) - -inputs - struct dmctx *ctx - pointer to struct dmctx strunture. The list of parameters will be updated in ctx.list_parameter. each node in the list is of type - struct dm_parameter which contains char *name (name of the parameter), char *data, char *type and char *additional_data; - the content of fields are as follows- - - | Type | Data | Addtional Data | - |------------- |------------ |--------------------- | - |DMT_COMMAND |in parameters |command type(sync/async) | - | |out parameter | | - |DMT_EVENT |in parameters |NA | - |$ref(type) |writable(0/1) |unique keys | - | | | | - - char * path - Complete object element path for which the data model schema is to be read. default path is "Device." - - bool first_level - if true, read only paramters at next level to path - - schem_type_t schema_type - enumeration to type of the schema to be get. Possible values are - ALL_SCHEMA - Complete schema - PARAM_ONLY - Parameters only - EVENT_ONLY - Events only - COMMAND_ONLY - Commands only - -return - int fault - contains the fault code if API is not able to read the data model. -``` -### dm_entry_param_method - -used to read the data model based on the input given - -``` -int dm_entry_param_method(struct dmctx *ctx, int cmd, char *inparam, char *arg1, char *arg2) - -inputs - struct dmctx *ctx - pointer to struct dmctx strunture. The list of parameter will be updated in ctx.list_parameter. each node in the list is of type - struct dm_parameter which contains char *name, char *data, char *type and char *additional_data; - the content of fields are updated based on the cmd and are as follows- - cmd | Name | Type | Data | Addtional Data | - |------------- |------------- |------------- |------------ |--------------------- | - |CMD_GET_VALUE |Parameter |$ref(type) |Value | NA | - |CMD_GET_NAME |Parameter |$ref(type) |writable(0/1) | NA | - |CMD_SET_VALUE |path | NA | NA | NA | - |CMD_ADD_OBJECT |path | NA | NA | NA | - |CMD_DEL_OBJECT |path | NA | NA | NA | - |CMD_USP_OPERATE |path | NA | NA | NA | - |CMD_USP_LIST_OPERATE |parameter |DMT_COMMAND |in/out parameters |cmd type (sync/async) | - |CMD_USP_LIST_EVENT |paramter |DMT_EVENT |in parameters |NA | - |CMD_GET_SCHEMA |paramter ||$ref(type) |writable(0/1) |unique keys | - |CMD_GET_INSTANCES |parameter | NA |NA |NA | - - int cmd - command to API to tell how the data model is to be read, possible values are - CMD_GET_VALUE - Read the values of the parameters from data model - CMD_GET_NAME - Read the names of the parameters from data model - CMD_SET_VALUE - Set value of specified parameters in the data model - CMD_ADD_OBJECT - Add object in a multi instance parameter in the data model - CMD_DEL_OBJECT - Delete object from a multi instance parameter in the data model - CMD_USP_OPERATE - execute the specified command - CMD_USP_LIST_OPERATE - Read all the command type parameter from data model. - CMD_USP_LIST_EVENT - Read all the event type parameter from data model. - CMD_GET_SCHEMA - Read all the parameter type parameter from data model. - CMD_GET_INSTANCES - Read all the instance of multi instance parameter from data model. - - char * inparam - Complete object element path for which the data model schema is to be read. default path is "Device." - - char *arg1 and char *arg2 - arguments specific to commands. - -return - int fault - contains the fault code if API is not able to read the data model. returns 0 on success. -``` -### dm_entry_apply - -This method is called to apply the changes done to data model. used with set_value - -``` -int dm_entry_apply(struct dmctx *ctx, int cmd) - -inputs - struct dmctx *ctx - pointer to struct dmctx strunture. The list of parameter will be updated in ctx.list_parameter - - int cmd - command to API to tell how the data model is to be read, possible values are - - CMD_SET_VALUE - Set value of specified parameters in the data model - - char *arg1 - -return - int fault - contains the fault code if API is not able to read the data model. -``` -### dm_ctx_init - -This method is used to initialize the dmctx structure object to read the data model. - -``` -int dm_ctx_init(struct dmctx *ctx, unsigned int instance_mode) -inputs - struct dmctx *ctx - pointer to struct dmctx strunture to be initialized. - - unsigned int instance_mode - instance mode of the dmctx to be set. -return - int fault - returns 0 on success. -``` - -### dm_ctx_init_sub - -This method is an extension of dm_ctx_init method. only difference it only intializes dmctx structure object and does not intializes other resources used in reading data model - -``` -int dm_ctx_init_sub(struct dmctx *ctx, unsigned int instance_mode) -inputs - struct dmctx *ctx - pointer to struct dmctx strunture to be initialized. - - unsigned int instance_mode - instance mode of the dmctx to be set. -return - int fault - returns 0 on success. -``` - - -### dm_ctx_clean - -This method is used to free the dmctx structure object and other resources post reading the data model. - -``` -int dm_ctx_clean(struct dmctx *ctx) - -input - struct dmctx *ctx - pointer to struct dmctx strunture to be freed. - -return - int fault - returns 0 on success. - -``` - -### dm_ctx_clean_sub - -This method is an extension of dm_ctx_clean method. only difference is it frees the dmctx structure and does not free other resources used in reading data model - -``` -int dm_ctx_clean_sub(struct dmctx *ctx) - -input - struct dmctx *ctx - pointer to struct dmctx strunture to be freed. - -return - int fault - returns 0 on success. - -``` -### set_bbfdatamodel_type - -This method is used to set the type of protocol for which the data model is to be read -``` -int set_bbfdatamodel_type(int bbf_type) - -input - int cmd - the protocol through which the data model is to be read, possible values are - BBFDM_USP - Protocol USP - BBFDM_CWMP - Protocol CWMP - BBFDM_BOTH - Both USP and CWMP - -return - int - returns 0 on success. -``` -### dm_entry_restart_services - -This method is used to restart the state of data model whenever its state is changed - -``` -int dm_entry_restart_services(void) - -input - None - -return - int - returns 0 on success. -``` -### dm_entry_revert_changes - -This method is used to restart the state of data model whenever its state is changed - -``` -int dm_entry_revert_changes(void) - -input - None - -return - int - returns 0 on success. -``` - - -### dm_debug_browse_path - -This method returns the last accessed path in the data model - -``` -int dm_debug_browse_path(char *buff, size_t len) -input - char *buff - pointer to the buffer in which the path will be returned - size_t len - length of the buffer -return - int - returns 0 on success. -``` - - -### get_dm_type - -This method is used to get the type assigned to the data model parameter. - -``` -int get_dm_type(char *dm_str) - -input - char *dm_str - data model parameter type, eg. xsd:string, xsd:unit etc. - -return - int - type of data model assigned to the object eg. DMT_STRING, DMT_UNINT etc. - -``` - -### dm_entry_manage_services - This method is used to commit the changes made to the data model using either ubus call or uci commit. - -``` -int dm_entry_manage_services(struct blob_buf *bb, bool restart) - -input - struct blob_buf *bb - pointer to the struct blob_buf object. contains all the packages updated. - bool restart - if true packages will be updated through ubus call. - if false packages will be updated through uci. - -return - int - returns 0 on success. -``` - -### dm_entry_restart_services - -this method is used to commit all the changes made to the data model. - -``` -int dm_entry_restart_services(void) - -return - int - returns 0 on success. -``` -### dm_config_ubus -This method is used to configure ubus. - -``` -void dm_config_ubus(struct ubus_context *ctx) - -input - struct ubus_context *ctx - pointer to struct ubus_context object to be intialized. diff --git a/bbfd/docs/guide/ubus_errors.md b/bbfd/docs/guide/ubus_errors.md deleted file mode 100644 index 6e137c62..00000000 --- a/bbfd/docs/guide/ubus_errors.md +++ /dev/null @@ -1,115 +0,0 @@ -# UBUS Errors - -## Path syntax and possible error cases - -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." - -```console -root@iopsys:~# ubus call usp.raw get '{"path":"Users.User."}' -{ - "fault": 7026 -} -``` - -2. The path parameter must end with a '.' if the path element is not a leaf element e.g., - 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. - -```console -root@iopsys:~# -root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.4"}' -{ - "fault": 7026 -} -root@iopsys:~# -root@iopsys:~# ubus call usp get '{"path":"Device.Users.User"}' -{ - "fault": 9005 -} -root@iopsys:~# -root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.*"}' -{ - "fault": 7026 -} -root@iopsys:~# -root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.4.Alias"}' -{ - "Alias": "cpe-4" -} -``` - -3. In path parameter value below, note that, the first search expression 'Type==Normal' is string which should be used as : Type==\"Normal\" - -```console -root@iopsys:~# ubus call usp get '{"path":"Device.IP.Interface.[Type==Normal].IPv4Address.[AddressingType==\"Static\"].IPAddress"}' -{ - "fault": 7008 -} -root@iopsys:~# -root@iopsys:~# ubus call usp get '{"path":"Device.IP.Interface.[Type==\"Normal\"].IPv4Address.[AddressingType==\"Static\"].IPAddress"}' -{ - "Interface": [ - { - "IPv4Address": [ - { - "IPAddress": "2.0.0.3" - } - ] - } - ] -} -``` - -4. The path parameter value must not have an empty search expression - -```console -root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.[]."}' -{ - "fault": 9005 -} -``` - -5. The path parameter value must use proper '.' separated path search expression. Note that a '.' is missing between User and * - -```console -root@iopsys:~# ubus call usp get '{"path":"Device.Users.User*."}' -{ - "fault": 7026 -} -``` - -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}. - -```console -root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.1.SSID"}' -{ - "fault": 7026 -} -``` - -7. Please note that in search expression, string comparison only work with "==" or "!=". Whereas in command below its = - -```console -root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.[Username=\"user\"].Alias"}' -{ - "fault": 7008 -} -``` - -#### Errors Codes - -| Error Code | Meaning | -|------------|--------------------------------------------------------------| -| 7003 | Message failed due to an internal error. | -| 7004 | Message failed due to invalid values in the request elements and/or failure to update one or more parameters during Add or Set requests. | -| 7005 | Message failed due to memory or processing limitations. | -| 7008 | Requested path was invalid or a reference was invalid. | -| 7010 | Requested Path Name associated with this ParamError did not match any instantiated parameters. | -| 7011 | Unable to convert string value to correct data type. | -| 7012 | Out of range or invalid enumeration. | -| 7022 | Command failed to operate. | -| 7026 | Path is not present in the data model schema. | - - diff --git a/bbfd/docs/guide/ubus_example.md b/bbfd/docs/guide/ubus_example.md deleted file mode 100644 index 8a3efe02..00000000 --- a/bbfd/docs/guide/ubus_example.md +++ /dev/null @@ -1,205 +0,0 @@ -# UBUS examples - -```console - -root@iopsys:~# ubus call usp get '{"path":"Device.WiFi.SSID.*.SSID"}' -{ - "SSID": [ - { - "SSID": "NORRLAND-34E380760120" - }, - { - "SSID": "NORRLAND-34E380760120" - } - ] -} - -root@iopsys:~# ubus call usp get '{"path":"Device.WiFi.SSID.*.BSSID"}' -{ - "SSID": [ - { - "BSSID": "34:E3:80:76:01:22" - }, - { - "BSSID": "34:E3:80:76:01:23" - } - ] -} - -root@iopsys:~# ubus call usp get '{"path":"Device.WiFi.SSID.[BSSID==\"34:E3:80:76:01:22\"].SSID"}' -{ - "SSID": [ - { - "SSID": "NORRLAND-34E380760120" - } - ] -} - -root@iopsys:~# ubus call usp get '{"path":"Device.IP.Interface.[Status==\"Up\"].IPv4Address.[AddressingType==\"DHCP\"].IPAddress"}' -{ - "Interface": [ - { - "IPv4Address": [ - { - "IPAddress": "192.168.0.96" - } - ] - } - ] -} - -root@iopsys:~# ubus call usp get '{"path":"Device.IP.Interface.[Status==\"Up\"].IPv4Address.[AddressingType==\"DHCP\"&&Status==\"Up\"]."}' -{ - "Interface": [ - { - "IPv4Address": [ - { - "AddressingType": "DHCP", - "Alias": "cpe-2", - "Enable": true, - "IPAddress": "192.168.0.96", - "Status": "Up", - "SubnetMask": "255.255.255.0", - "X_IOPSYS_EU_FirewallEnabled": true - } - ] - } - ] -} - -root@iopsys:~# ubus call usp get '{"path":"Device.IP.Interface.[Type==\"Normal\"&&Stats.PacketsSent<=500].IPv4Address.[AddressingType==\"Static\"].IPAddress"}' -{ - "Interface": [ - { - "IPv4Address": [ - { - "IPAddress": "192.168.1.1" - } - ] - } - ] -} - -root@iopsys:~# ubus call usp get '{"path":"Device.WiFi.AccessPoint.[SSIDReference+.SSID==\"NORRLAND-34E380760120\"].AssociatedDevice.[Noise>15].SignalStrength"} -' -{ - "AccessPoint": [ - { - "AssociatedDevice": [ - { - "SignalStrength": -31 - } - ] - } - ] -} - - -root@iopsys:~# ubus call usp get '{"path":"Device.WiFi.SSID.*.LowerLayers#1+.Name"}' -{ - { - "Name": "wlan0", - "Name": "wlan2" - } -} - - - -root@iopsys:~# ubus call usp get '{"path":"Device.Users.User.*.Username"}' -{ - "User": [ - { - "Username": "user" - }, - { - "Username": "support" - }, - { - "Username": "admin" - } - ] -} - -root@iopsys:~# ubus call usp.raw set '{"path":"Device.IP.Diagnostics.IPPing.DiagnosticsState", "value":"Requested", "proto":"cwmp"}' -{ - "parameters": [ - { - "path": "Device.IP.Diagnostics.IPPing.DiagnosticsState", - "status": true, - } - ] -} - -root@iopsys:~# ubus call usp.raw set '{"path":"Device.Users.User.2.Username", "value":"abc", "proto":"cwmp"}' -{ - "parameters": [ - { - "path": "Device.Users.User.2.Username", - "status": true, - } - ] -} - -root@iopsys:~# ubus call usp.raw set '{"path":"Device.Users.User.2.Username", "value":"abc", "proto":"usp"}' -{ - "parameters": [ - { - "path": "Device.Users.User.2.Username", - "status": true - } - ] -} - -root@iopsys:~# ubus call usp.raw set '{"path":"Device.Users.User.2.Username", "value":"abc"}' -{ - "parameters": [ - { - "path": "Device.Users.User.2.Username", - "status": true - } - ] -} - -root@iopsys:~# -root@iopsys:~# ubus call usp set '{"path":"Device.Users.User.[Username==\"xyz1\"].", "values":{"Username":"xyz1", "Enable":"dummy", "Password":"yzssssx"}, "proto":"usp"}' -{ - "parameters": [ - { - "path": "Device.Users.User.2.Username", - "status": true - }, - { - "path": "Device.Users.User.2.Enable", - "status": false, - "fault": 7012 - }, - { - "path": "Device.Users.User.2.Password", - "status": true - } - ] -} -root@iopsys:~# -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":"1"}, {"path":"Device.Users.User.2.Password", "value":"zzzzzzz"}], "proto":"usp"}' -{ - "parameters": [ - { - "path": "Device.Users.User.2.Username", - "status": true - }, - { - "path": "Device.Users.User.2.RemoteAccessCapable", - "status": false, - "fault": 7012 - }, - { - "path": "Device.Users.User.2.Password", - "status": true - } - ] -} -``` - -- For more info on the usp ubus API see [link](../api/ubus/usp.md) -- For more info on the usp.raw ubus API see [link](../api/ubus/usp.raw.md) - diff --git a/bbfd/docs/guide/ubus_methods.md b/bbfd/docs/guide/ubus_methods.md deleted file mode 100644 index 8306d1ac..00000000 --- a/bbfd/docs/guide/ubus_methods.md +++ /dev/null @@ -1,874 +0,0 @@ -# UBUS Methods - -`uspd` needs to be started on startup after `ubusd`, as it exposes the data-model -objects over `ubus`. By default(when granularity is not set in `uci`), `uspd` registers -below two namespaces with `ubus`. - -```console -root@iopsys:~# ubus list |grep usp -usp -usp.raw -``` - -`usp` namespace is to provide the output as required by `End User` or in pretty format, -whereas `usp.raw` namespace is to provide output in raw JSON format for easy API integration, -which can be used by other USP front-end applications(like: `obuspa`, `icwmp`). -`usp` namespace has fewer methods defined to provide a simple interface to `end users`, -whereas `usp.raw` has more features/methods to provide more customization options. - -Default namespace with functionalities: - -```console -root@iopsys:~# ubus -v list usp -'usp' @78f3eaca - "list_operate":{} - "get":{"path":"String","proto":"String","maxdepth":"Integer","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"} - "set":{"path":"String","value":"String","values":"Table","proto":"String","instance_mode":"Integer"} - "operate":{"path":"String","action":"String","input":"Table","proto":"String","instance_mode":"Integer"} - "add_object":{"path":"String","proto":"String","instance_mode":"Integer"} - "del_object":{"path":"String","proto":"String","instance_mode":"Integer"} -root@iopsys:~# -root@iopsys:~# ubus -v list usp.raw -'usp.raw' @08a13407 - "dump_schema":{} - "list_operate":{} - "list_events":{} - "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"} - "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"} - "transaction_start":{"app":"String","max_timeout":"Integer"} - "set":{"path":"String","value":"String","values":"Table","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "operate":{"path":"String","action":"String","input":"Table","proto":"String","instance_mode":"Integer"} - "add_object":{"path":"String","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "del_object":{"path":"String","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "setm_values":{"pv_tuple":"Array","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "transaction_commit":{"transaction_id":"Integer"} - "transaction_abort":{"transaction_id":"Integer"} - "transaction_status":{"transaction_id":"Integer"} - "notify_event":{"name":"String","input":"Table"} -root@iopsys:~# -``` - -> Note1: `proto` in each method specify the data-model prototype('cwmp', 'usp') to use, if not provided default data-model will be used. - -> Note2: `instance_mode` could be 0 or 1, for instance number, instance alias respectively. - -> Note3: `next-level` true means only get next level objects and false means get all objects recursively - -> Note4: `maxdepth` is measured on max number of .(Dot) present in object name - -> Note5: `key` is used specifically for cwmp param_key - -The objects registered with the above namespaces can be called with appropriate -parameters to perform a USP `Get/Set/Operate/Add Object/Delete Object` operation as below. - -## Granularity - -Granularity feature is basically exposes the same USP functionality by registering -additional ubus namespaces to reduce the `path` length in ubus parameter. -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 - -```console -root@iopsys:~# ubus list|grep usp -usp -usp.Device. -usp.raw -``` - - - When Granularity is set to 2, exposed ubus namespaces are - -```console -root@iopsys:~# ubus list|grep usp -usp -usp.Device. -usp.Device.Bridging. -usp.Device.DHCPv4. -usp.Device.DHCPv6. -usp.Device.DNS. -usp.Device.DeviceInfo. -usp.Device.DynamicDNS. -usp.Device.Ethernet. -usp.Device.Firewall. -usp.Device.Hosts. -usp.Device.IP. -usp.raw -root@iopsys:~# -``` - -These granular ubus objects provides the same functionality as of `usp` ubus namespace - -```console -root@iopsys:~# ubus -v list usp.Device.WiFi. -'usp.Device.WiFi.' @6fd43aca - "list_operate":{} - "get":{"path":"String","proto":"String","maxdepth":"Integer","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"} - "set":{"path":"String","value":"String","values":"Table","proto":"String","instance_mode":"Integer"} - "operate":{"path":"String","action":"String","input":"Table","proto":"String","instance_mode":"Integer"} - "add_object":{"path":"String","proto":"String","instance_mode":"Integer"} - "del_object":{"path":"String","proto":"String","instance_mode":"Integer"} -root@iopsys:~# -``` - -Registered method can be called with appropriate parameters, like: - -```console -root@iopsys:~# ubus call usp.Device. get '{"path":"Users."}' -{ - "Users": { - "User": [ - { - "Alias": "cpe-1", - "Enable": true, - "Language": "", - "Password": "", - "RemoteAccessCapable": true, - "Username": "user" - }, - { - "Alias": "cpe-2", - "Enable": true, - "Language": "", - "Password": "", - "RemoteAccessCapable": true, - "Username": "support" - }, - { - "Alias": "cpe-3", - "Enable": true, - "Language": "", - "Password": "", - "RemoteAccessCapable": true, - "Username": "admin" - } - ], - "UserNumberOfEntries": 3 - } -} -root@iopsys:~# -``` - -## Overview - -`uspd` provides below commands in pretty(usp) or raw(usp.raw) formats, some methods only available for API integration in usp.raw namespace: - - - 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. - -### Get -API to query the value of a specific object. - -```console -root@iopsys:~# ubus call usp get '{"path":"Device.IP.Diagnostics.", "proto":"usp"}' -{ - "Diagnostics": { - "IPv4DownloadDiagnosticsSupported": true, - "IPv4PingSupported": true, - "IPv4ServerSelectionDiagnosticsSupported": true, - "IPv4TraceRouteSupported": true, - "IPv4UDPEchoDiagnosticsSupported": true, - "IPv4UploadDiagnosticsSupported": true, - "IPv6DownloadDiagnosticsSupported": true, - "IPv6PingSupported": true, - "IPv6ServerSelectionDiagnosticsSupported": true, - "IPv6TraceRouteSupported": true, - "IPv6UDPEchoDiagnosticsSupported": true, - "IPv6UploadDiagnosticsSupported": true - } -} -root@iopsys:~# -root@iopsys:~# ubus call usp get '{"path":"Device.IP.Diagnostics.", "proto":"cwmp"}' -{ - "Diagnostics": { - "DownloadDiagnostics": { - "BOMTime": "0", - "DSCP": 0, - "DiagnosticsState": "None", - "DownloadDiagnosticMaxConnections": 1, - "TotalBytesSent": 0, - "TotalBytesSentUnderFullLoading": 0 - }, - "IPPing": { - "AverageResponseTime": 0, - "AverageResponseTimeDetailed": 0, - "DSCP": 0, - "DataBlockSize": 64, - "ProtocolVersion": "Any", - "SuccessCount": 0, - "Timeout": 1000 - }, - "IPv4DownloadDiagnosticsSupported": true, - "IPv4PingSupported": true, - "IPv4ServerSelectionDiagnosticsSupported": true, - "IPv6UDPEchoDiagnosticsSupported": true, - "IPv6UploadDiagnosticsSupported": true, - } - } -} -root@iopsys:~# -root@iopsys:~# ubus call usp get '{"path":"Device.Users."}' -{ - "Users": { - "User": [ - { - "Alias": "cpe-1", - "Enable": true, - "Language": "", - "Password": "", - "RemoteAccessCapable": true, - "Username": "user" - }, - { - "Alias": "cpe-2", - "Enable": true, - "Language": "", - "Password": "", - "RemoteAccessCapable": true, - "Username": "support" - }, - { - "Alias": "cpe-3", - "Enable": true, - "Language": "", - "Password": "", - "RemoteAccessCapable": true, - "Username": "admin" - } - ], - "UserNumberOfEntries": 3 - } -} -root@iopsys:~# -root@iopsys:~# ubus call usp.raw get '{"path":"Device.Users."}' -{ - "parameters": [ - { - "parameter": "Device.Users.User.1.Alias", - "value": "cpe-1", - "type": "xsd:string" - }, - { - "parameter": "Device.Users.User.1.Enable", - "value": "1", - "type": "xsd:boolean" - }, - { - "parameter": "Device.Users.User.1.Language", - "value": "", - "type": "xsd:string" - }, - { - "parameter": "Device.Users.User.1.Password", - "value": "", - "type": "xsd:string" - } - ] -} - -``` - -- For more info on the `usp` ubus API see [link](../api/ubus/usp.md#get) -- For more info on the `usp.raw` ubus API see [link](../api/ubus/usp.raw.md#get) - -### 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. - -```console -root@iopsys:~# ubus call usp.raw getm_values '{"paths":["Device.Users.User.1.Username","Device.DeviceInfo.SerialNumber"]}' -{ - "parameters": [ - { - "parameter": "Device.Users.User.1.Username", - "value": "user", - "type": "xsd:string" - }, - { - "parameter": "Device.DeviceInfo.SerialNumber", - "value": "E40A24H185027824", - "type": "xsd:string" - } - ] -} -``` - -### Get multiple objects -API to get multiple objects from multiple paths at once. - -> Note: This method only available in `usp.raw` namespace - -```console -root@iopsys:~# ubus call usp.raw getm_names '{"paths":["Device.Users.User.1.","Device.DeviceInfo.SerialNumber"]}' -{ - "parameters": [ - { - "parameter": "Device.Users.User.1.", - "value": "1", - "type": "xsd:object" - }, - { - "parameter": "Device.Users.User.1.Alias", - "value": "1", - "type": "xsd:string" - }, - { - "parameter": "Device.Users.User.1.Enable", - "value": "1", - "type": "xsd:boolean" - }, - { - "parameter": "Device.Users.User.1.Language", - "value": "1", - "type": "xsd:string" - }, - { - "parameter": "Device.Users.User.1.Password", - "value": "1", - "type": "xsd:string" - }, - { - "parameter": "Device.Users.User.1.RemoteAccessCapable", - "value": "1", - "type": "xsd:boolean" - }, - { - "parameter": "Device.Users.User.1.Username", - "value": "1", - "type": "xsd:string" - }, - { - "parameter": "Device.DeviceInfo.SerialNumber", - "value": "0", - "type": "xsd:string" - } - ] -} -root@iopsys:~# -``` - -### 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. - -```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 -} -root@iopsys:/tmp# ubus call usp.raw set '{"path":"Device.WiFi.SSID.[BSSID==\"00:22:07:ae:ee:03\"].SSID", "value":"test-2g", "transaction_id":12345}' -{ - "status": true -} -root@iopsys:~# ubus call usp get '{"path":"Device.WiFi.SSID.[BSSID==\"00:22:07:ae:ee:03\"].SSID"}' -{ - "SSID": [ - { - "SSID": "test-2g" - } - ] -} -``` - -- For more info on the `usp` ubus API see [link](../api/ubus/usp.md#set) -- For more info on the `usp.raw` ubus API see [link](../api/ubus/usp.raw.md#set) - -### Operate -API to run operate/diagnostics commands as defined in TR-369 - -```console -root@iopsys:~# ubus call usp operate '{"path":"Device.IP.Diagnostics.", "action":"IPPing()","input":{"Host":"iopsys.eu"}}' -{ - "Results": [ - { - "path": "Device.IP.Diagnostics.IPPing", - "result": [ - { - "AverageResponseTime": 0, - "AverageResponseTimeDetailed": 0, - "FailureCount": 3, - "MaximumResponseTime": 0, - "MaximumResponseTimeDetailed": 0, - "MinimumResponseTime": 9999, - "MinimumResponseTimeDetailed": 999999999, - "SuccessCount": 0 - } - ] - } - ] -} - -root@iopsys:~# ubus call usp.raw operate '{"path":"Device.IP.Diagnostics.", "action":"IPPing()","input":{"Host":"iopsys.eu"}}' -{ - "Results": [ - { - "path": "Device.IP.Diagnostics.IPPing", - "parameters": [ - { - "parameter": "AverageResponseTime", - "value": "0", - "type": "xsd:unsignedInt" - }, - { - "parameter": "AverageResponseTimeDetailed", - "value": "0", - "type": "xsd:unsignedInt" - }, - { - "parameter": "FailureCount", - "value": "3", - "type": "xsd:unsignedInt" - }, - { - } - ] -} - -root@iopsys:~# ubus call usp operate '{"path":"Device.IP.Interface.[Name==\"wan\"].", "action":"Reset()"}' -{ - "Results": [ - { - "path": "Device.IP.Interface.2.Reset", - "result": [ - { - - } - ] - } - ] -} - -root@iopsys:~# ubus call usp.raw operate '{"path":"Device.IP.Interface.[Name==\"wan\"].", "action":"Reset()"}' -{ - "Results": [ - { - "path": "Device.IP.Interface.2.Reset", - "parameters": [ - - ] - } - ] -} -``` - -- For more info on the `usp` ubus API see [link](../api/ubus/usp.md#operate) -- For more info on the `usp.raw` ubus API see [link](../api/ubus/usp.raw.md#operate) - -### 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. - -```console -root@iopsys:~# ubus call usp add_object '{"path":"Device.Users.User."}' -{ - "parameters": [ - { - "parameter": "Device.Users.User.", - "status": true, - "instance": "4" - } - ] -} -root@iopsys:~# ubus call usp.raw add_object '{"path":"Device.Users.User.", "transaction_id":12345}' -{ - "parameters": [ - { - "parameter": "Device.Users.User.", - "status": true, - "instance": "5" - } - ] -} -``` - -- For more info on the `usp` ubus API see [link](../api/ubus/usp.md#add_object) -- For more info on the `usp.raw` ubus API see [link](../api/ubus/usp.raw.md#add_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. - -```console -root@iopsys:/tmp# ubus call usp del_object '{"path":"Device.Users.User.4"}' -{ - "parameters": [ - { - "parameter": "Device.Users.User.4.", - "status": true - } - ] -} -root@iopsys:/tmp# ubus call usp.raw del_object '{"path":"Device.Users.User.3", "transaction_id": 12345}' -{ - "parameters": [ - { - "parameter": "Device.Users.User.3.", - "status": true - } - ] -} -``` - -- For more info on the `usp` ubus API see [link](../api/ubus/usp.md#del_object) -- For more info on the `usp.raw` ubus API see [link](../api/ubus/usp.raw.md#del_object) - -### Object names -API to get the available list of object names. - -```console -root@iopsys:~# ubus call usp object_names '{"path":"Device.DeviceInfo.SerialNumber"}' -{ - "parameters": [ - { - "parameter": "Device.DeviceInfo.SerialNumber", - "writable": "0", - "type": "xsd:string" - } - ] -} -root@iopsys:~# -root@iopsys:~# ubus call usp.raw object_names '{"path":"Device.Users.User.1."}' -{ - "parameters": [ - { - "parameter": "Device.Users.User.1.", - "writable": "1", - "type": "xsd:object" - }, - { - "parameter": "Device.Users.User.1.Alias", - "writable": "1", - "type": "xsd:string" - }, - { - "parameter": "Device.Users.User.1.Enable", - "writable": "1", - "type": "xsd:boolean" - }, - { - "parameter": "Device.Users.User.1.Language", - "writable": "1", - "type": "xsd:string" - }, - { - "parameter": "Device.Users.User.1.Password", - "writable": "1", - "type": "xsd:string" - }, - { - "parameter": "Device.Users.User.1.RemoteAccessCapable", - "writable": "1", - "type": "xsd:boolean" - }, - { - "parameter": "Device.Users.User.1.Username", - "writable": "1", - "type": "xsd:string" - } - ] -} -root@iopsys:~# -``` - -- For more info on the `usp` ubus API see [link](../api/ubus/usp.md) -- For more info on the `usp.raw` ubus API see [link](../api/ubus/usp.raw.md) - -### Instances -API to get the available instances of an multi-instance object. USP Instances method returns the registered instances. - -```console -root@iopsys:~# ubus call usp instances '{"path":"Device.IP.Interface.", "proto":"usp"}' -{ - "parameters": [ - { - "parameter": "Device.IP.Interface.1." - }, - { - "parameter": "Device.IP.Interface.1.IPv4Address.1." - }, - { - "parameter": "Device.IP.Interface.2." - }, - { - "parameter": "Device.IP.Interface.3." - }, - { - "parameter": "Device.IP.Interface.3.IPv4Address.1." - }, - { - "parameter": "Device.IP.Interface.3.IPv6Address.1." - }, - { - "parameter": "Device.IP.Interface.3.IPv6Prefix.1." - } - ] -} -``` - -- For more info on the `usp` ubus API see [link](../api/ubus/usp.md#instances) -- For more info on the `usp.raw` ubus API see [link](../api/ubus/usp.raw.md#instances) - -### 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. - -```console -root@iopsys:~# ubus call usp validate '{"path":"Device.DeviceInfo."}' -{ - "parameter": "Device.DeviceInfo" -} -root@iopsys:~# ubus call usp.raw validate '{"path":"invalid.object"}' -{ - "fault": 9005 -} -``` - -### List Operate -API to list all available operate commands with supported input and output parameters - - -```console -root@iopsys:~# ubus call usp list_operate -{ - "parameters": [ - { - "parameter": "Device.DHCPv4.Client.{i}.Renew()", - "type": "sync" - }, - { - "parameter": "Device.DNS.Diagnostics.NSLookupDiagnostics()", - "type": "async", - "in": [ - "HostName", - "Interface", - "DNSServer", - "Timeout", - "NumberOfRepetitions" - ], - "out": [ - "Status", - "AnswerType", - "HostNameReturned", - "IPAddresses", - "DNSServerIP", - "ResponseTime" - ] - }, - { - "parameter": "Device.DeviceInfo.FirmwareImage.{i}.Activate()", - "type": "async" - }, - { - "parameter": "Device.IP.Diagnostics.IPPing()", - "type": "async", - "in": [ - "Interface", - "ProtocolVersion", - "Host", - "NumberOfRepetitions", - "Timeout", - "DataBlockSize", - "DSCP" - ], - "out": [ - "Status", - "IPAddressUsed", - "SuccessCount", - "FailureCount", - "AverageResponseTime", - "MinimumResponseTime", - "MaximumResponseTime", - "AverageResponseTimeDetailed", - "MinimumResponseTimeDetailed", - "MaximumResponseTimeDetailed" - ] - }, - { -``` - -### Dump schema -API to dump all registered schema paths, - -```console -root@iopsys:~# ubus call usp dump_schema -{ - "parameters": [ - { - "parameter": "Device.ATM.Link.{i}.", - "writable": "1", - "type": "xsd:object" - }, - { - "parameter": "Device.ATM.Link.{i}.Alias", - "writable": "1", - "type": "xsd:string" - }, - { - "parameter": "Device.ATM.Link.{i}.DestinationAddress", - "writable": "1", - "type": "xsd:string" - }, - { - "parameter": "Device.ATM.Link.{i}.Enable", - "writable": "1", - "type": "xsd:boolean" - }, - { -``` - -### Set multiple values -API to set value of multiple parameters at once. - -> Note: This method only available in usp.raw namespace - -```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 -} -root@iopsys:~# -root@iopsys:~# -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":"dummy"}, {"path":"Device.Users.User.2.Password", "value":"zzzzzzz"}], "proto":"usp", "transaction_id":738335779}' -{ - "parameters": [ - { - "path": "Device.Users.User.2.RemoteAccessCapable", - "status": false, - "fault": 7012 - } - ] -} -``` - -### 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 - -```console -root@iopsys:~# ubus call usp.raw transaction_start '{"app":"test"}' -{ - "status": true, - "transaction_id": 955001092 -} -``` - -It's sometime required to have a per transaction timeout, which can be defined along with transaction_start -```bash -root@4949e4da3d27:~# ubus call usp.raw transaction_start '{"app":"test", "max_timeout":5000}' -{ - "status": true, - "transaction_id": 491944812 -} -``` -> Note: max_timeout is time in milliseconds, its an optional input argument if not provided, uci default (uspd.usp.transaction_timeout) is used which is defined in seconds -> If uci option uspd.usp.transaction_timeout not set than a default 10 second timeout is used for the transactions. - -### Get status of a transaction -API to get details and check status of a transaction id in usp.raw namespace - -```console -root@iopsys:~# ubus call usp.raw transaction_status '{"transaction_id":955001092}' -{ - "app": "test", - "status": "on-going", - "remaining_time": 634 -} -root@iopsys:~# -root@iopsys:~# ubus call usp.raw transaction_status '{"transaction_id":869066287}' -{ - "status": "not-exists" -} -root@iopsys:~# -``` - -### Transaction commit -API to commit an on-going transaction, on calling this api, uci changes shall -be committed and required services shall be restarted. - -```console -root@iopsys:~# ubus call usp.raw transaction_commit '{"transaction_id":955001092}' -{ - "status": true -} -root@iopsys:~# -``` - -### Transaction abort -API to abort an on-going transaction, on calling this api, staged changes in -uci shall be reverted to earlier values. - -```console -root@iopsys:~# ubus call usp.raw transaction_abort '{"transaction_id":955001092}' -{ - "status": true -} -root@iopsys:~# -``` - -### List supported usp events -API to list down the data-model events for usp notification supported by uspd. - -```console -root@iopsys:~# ubus call usp.raw list_events -{ - "parameters": [ - { - "parameter": "Device.LocalAgent.TransferComplete!", - "in": [ - "Command", - "CommandKey", - "Requestor", - "TransferType", - "Affected", - "TransferURL", - "StartTime", - "CompleteTime", - "FaultCode", - "FaultString" - ] - } - ] -} -``` - diff --git a/bbfd/docs/guide/ubus_parallel_call.md b/bbfd/docs/guide/ubus_parallel_call.md deleted file mode 100644 index 9367e1f3..00000000 --- a/bbfd/docs/guide/ubus_parallel_call.md +++ /dev/null @@ -1,20 +0,0 @@ -# Parallel UBUS calls - -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. - -```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 -user 0m 0.00s -sys 0m 0.00s -root@iopsys:~# -real 0m 1.86s -user 0m 0.05s -sys 0m 0.00s - -[1]+ Done time ubus call usp.raw get "{\"path\":\"Device.\"}" >/dev/null -root@iopsys:~# -``` - diff --git a/bbfd/docs/mkdocs.yml b/bbfd/docs/mkdocs.yml deleted file mode 100755 index a49000a6..00000000 --- a/bbfd/docs/mkdocs.yml +++ /dev/null @@ -1,90 +0,0 @@ -site_name: Documentation Instructions -site_url: https://docs.iopsys.se/portal2/uspd/ -edit_uri: "https://dev.iopsys.eu/docs/portal2/uspd" - -site_description: IOWRT Technical Documentation -site_author: IOPSYS - -docs_dir: '.' -site_dir: 'site' - - -theme: - name: material - include_sidebar: true - highlightjs: true - hljs_languages: - - yaml - - python - language: en - font: - text: Roboto - code: Roboto Mono - logo: iopsys-white.svg - icon: - logo: icon.png - repo: fontawesome/brands/gitlab - extra: - social: - - icon: fontawesome/brands/github-alt - link: https://github.com/squidfunk - features: - - toc.autohide - - navigation.tabs - - navigation.tabs.sticky - - navigation.top - - navigation.tracking - - navigation.expand - - palette: - # Primary color used for header, sidebar and links, default: indigo - primary: black - # Accent color for highlighting user interaction, default: indigo - accent: deep orange - -extra_css: - - css/extra.css - - https://unpkg.com/mermaid@8.5.1/dist/mermaid.css - - https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css - -extra_javascript: - - https://unpkg.com/mermaid/dist/mermaid.min.js - - https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js - - https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js - -markdown_extensions: - - meta - - admonition - - pymdownx.arithmatex - - pymdownx.betterem: - smart_enable: all - - pymdownx.caret - - pymdownx.critic - - pymdownx.details - - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg - - pymdownx.inlinehilite - - pymdownx.magiclink - - pymdownx.mark - - pymdownx.smartsymbols - - pymdownx.tasklist: - custom_checkbox: true - - pymdownx.tilde - - pymdownx.superfences: - # make exceptions to highlighting of code: - custom_fences: - - name: mermaid - class: mermaid - format: !!python/name:mermaid2.fence_mermaid - - fontawesome_markdown - -plugins: - - search: - lang: - - en - separator: '[\s\-\.]+' - - awesome-pages: - collapse_single_pages: true - - mermaid2 - - section-index diff --git a/bbfd/docs/preview.sh b/bbfd/docs/preview.sh deleted file mode 100755 index afe20843..00000000 --- a/bbfd/docs/preview.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Copy README.md as index.md and change links -pip install -r requirements.txt - -# Copy README.md as index.md and change links -sed -r -e 's![\.\/]*docs[\/]*!./!g' ../README.md > index.md - -# Start mkdocs local server -mkdocs serve -f mkdocs.yml diff --git a/bbfd/docs/requirements.txt b/bbfd/docs/requirements.txt deleted file mode 100755 index bbbcd25a..00000000 --- a/bbfd/docs/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -mkdocs -mkdocs-material -mkdocs-awesome-pages-plugin -mkdocs-section-index -fontawesome_markdown -mkdocs-print-site-plugin -mkdocs-mermaid2-plugin diff --git a/bbfd/docs/spec/.pages b/bbfd/docs/spec/.pages deleted file mode 100644 index 352e417e..00000000 --- a/bbfd/docs/spec/.pages +++ /dev/null @@ -1,4 +0,0 @@ -title: "USP Daemon Specification" - -nav: - - "..." diff --git a/bbfd/docs/spec/functionspec.md b/bbfd/docs/spec/functionspec.md deleted file mode 100644 index ed3bb3b0..00000000 --- a/bbfd/docs/spec/functionspec.md +++ /dev/null @@ -1,336 +0,0 @@ -# Function Specification - -The scope of uspd is to expose the datamodel provided by libbbfdm APIs over ubus, along with provididng the features deinfed by requirements R-ARC.7 to R-ARC.12 of USP protocol. - -``` -root@iopsys:~# ubus -v list usp -'usp' @232da280 - "list_operate":{} - "get_supported_dm":{"path":"String","next-level":"Boolean","schema_type":"Integer"} - "get":{"path":"String","proto":"String","maxdepth":"Integer","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"} - "set":{"path":"String","value":"String","values":"Table","proto":"String","instance_mode":"Integer"} - "operate":{"path":"String","action":"String","input":"Table","proto":"String","instance_mode":"Integer"} - "add_object":{"path":"String","proto":"String","instance_mode":"Integer"} - "del_object":{"path":"String","proto":"String","instance_mode":"Integer"} - -root@iopsys:~# -root@iopsys:~# ubus -v list usp.raw -'usp.raw' @4c9c3c6e - "dump_schema":{} - "list_operate":{} - "list_events":{} - "get_supported_dm":{"path":"String","next-level":"Boolean","schema_type":"Integer"} - "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"} - "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"} - "transaction_start":{"app":"String"} - "set":{"path":"String","value":"String","values":"Table","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "operate":{"path":"String","action":"String","input":"Table","proto":"String","instance_mode":"Integer"} - "add_object":{"path":"String","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "del_object":{"path":"String","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "setm_values":{"pv_tuple":"Array","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "transaction_commit":{"transaction_id":"Integer","restart_services":"Boolean"} - "transaction_abort":{"transaction_id":"Integer"} - "transaction_status":{"transaction_id":"Integer"} - "notify_event":{"name":"String","input":"Table"} - -``` - -# Contents -* [usp](#usp) -* [usp.raw](#uspraw) - -## APIs - -uspd publishes two different types UBUS objects, `usp`, `usp.raw`. USP object is meant for end users/CLI users -usp.raw is meant for API integration -usp.raw has more ganureality in the function to match the third party apllication requiremtns whereas usp obect take cares of cutomization internally to provide simple interface for the end users. - - -### usp - -An object that publishes device information. - -````bash - "list_operate":{} - "get_supported_dm":{"path":"String","next-level":"Boolean","schema_type":"Integer"} - "get":{"path":"String","proto":"String","maxdepth":"Integer","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"} - "set":{"path":"String","value":"String","values":"Table","proto":"String","instance_mode":"Integer"} - "operate":{"path":"String","action":"String","input":"Table","proto":"String","instance_mode":"Integer"} - "add_object":{"path":"String","proto":"String","instance_mode":"Integer"} - "del_object":{"path":"String","proto":"String","instance_mode":"Integer"} -```` - -| Method |Function ID | -| :--- | :--- | -| [list_operate](#list_operate) | 1 | -| [get_supported_dm](#get_supported_dm) | 2 | -| [get](#get) | 3 | -| [object_names](#object_names) | 4 | -| [instances](#instances) | 5 | -| [validate](#validate) | 6 | -| [set](#set) | 7 | -| [operate](#operate) | 8 | -| [add_object](#add_object) | 9 | -| [del_object](#del_object) | 10 | - -#### Methods - -Below methods are supported in usp methods. Method description of the `usp` object in succeding paragraphs . - - -##### list_operate - -Exposes various sync and async operations supported by datamodel. e.g., IPPing(), NeighbourDiagnostics() etc. - -* [list_operate documentation](../api/ubus/usp.md#list_operate) - -##### get_supported_dm - -This method exposes the all type of objects supported in the data model in one browse. it will expose name, type, cmd_type and writable properties of the object depending on the type of the parameters present in the data model. - -* [get_supported_dm documentation](../api/ubus/usp.md#get_supported_dm) - - -##### get - -This method exposes information regarding various schema parameters registered in the data model. - -* [get documentation](../api/ubus/usp.md#get) - -##### object_names - -This method exposes names of the object registered in the data model. - -* [object_names documentation](../api/ubus/usp.md#object_names) - -##### instances - -This method exposes information of all instances of various objects registered in the data model for specified schema path. - -* [disconnect documentation](../api/ubus/usp.md#instances) - -##### validate - -This method validates whether the path provided is valid as per registerd schema paths. - -* [validate documentation](../api/ubus/usp.md#validate) - -##### set - -This method is used to set information of various registered schema parameters. - -* [set documentation](../api/ubus/usp.md#set) - -##### operate - -This method is used to execute various sync/async operations e.g., IPPing(), NeighbourDiagnostics() etc. - -* [operate documentation](../api/ubus/usp.md#operate) - -##### add_object - -This method is used to add an object to specified multi instance object in registered schema. - -* [add_object neighbor documentation](../api/ubus/usp.md#add_object) - -##### del_object - -This method is used to delete an object from specified multi instance object in registered schema. - -* [del_object documentation](../api/ubus/usp.md#del_object) - - - -### usp.raw - -Object for device functionality. One object per device will be published to -ubus. - -````bash - "dump_schema":{} - "list_operate":{} - "list_events":{} - "get_supported_dm":{"path":"String","next-level":"Boolean","schema_type":"Integer"} - "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"} - "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"} - "transaction_start":{"app":"String"} - "set":{"path":"String","value":"String","values":"Table","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "operate":{"path":"String","action":"String","input":"Table","proto":"String","instance_mode":"Integer"} - "add_object":{"path":"String","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "del_object":{"path":"String","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "setm_values":{"pv_tuple":"Array","proto":"String","instance_mode":"Integer","transaction_id":"Integer"} - "transaction_commit":{"transaction_id":"Integer","restart_services":"Boolean"} - "transaction_abort":{"transaction_id":"Integer"} - "transaction_status":{"transaction_id":"Integer"} - "notify_event":{"name":"String","input":"Table"} - -```` - -| Method |Function ID | -| :--- | :--- | -| [dump_schema](#dump_schema_raw) | 1 | -| [list_operate](#list_operate_raw) | 2 | -| [list_events](#list_events_raw) | 3 | -| [get_supported_dm](#get_supported_dm_raw) | 4 | -| [get](#get_raw) | 5 | -| [getm_values](#getm_values_raw) | 6 | -| [getm_names](#getm_names_raw) | 7 | -| [object_names](#object_names_raw) | 8 | -| [instances](#instances_raw) | 9 | -| [validate](#validate_raw) | 10 | -| [transaction_start](#transaction_start_raw) | 11 | -| [set](#set_raw) | 12 | -| [operate](#operate_raw) | 13 | -| [add_object](#add_object_raw) | 14 | -| [del_object](#del_object_raw) | 15 | -| [setm_values](#setm_values_raw) | 16 | -| [transaction_commit](#transaction_commit_raw) | 17 | -| [transaction_abort](#transaction_abort_raw) | 18 | -| [transaction_status](#transaction_status_raw) | 19 | -| [notify_event](#notify_event_raw) | 20 | - - -#### Methods - -Below methods are supported in usp methods. Method description of the `usp` object in succeding paragraphs . - - -##### dump_schema_raw - -This method exposes schema registered in the data model . - -* [dump_schema documentation](../api/ubus/usp.raw.md#dump_schema) - -##### list_operate_raw - -Exposes various sync and async operations supported by datamodel. e.g., IPPing(), NeighbourDiagnostics() etc. - -* [list_operate documentation](../api/ubus/usp.raw.md#list_operate) - -##### list_events_raw - -Exposes various events registered in the datamodel. - -* [list_events documentation](../api/ubus/usp.raw.md#list_events) - -##### get_supported_dm_raw - -This method exposes the all type of objects supported in the data model in one browse. it will expose name, type, cmd_type and writable properties of the object depending on the type of the parameters present in the data model. - -* [get_supported_dm documentation](../api/ubus/usp.md#get_supported_dm) - - -##### get_raw - -This method exposes information of various schema parameters registered in the data model. - -* [get documentation](../api/ubus/usp.raw.md#get) - -##### getm_values_raw - -This method is an extension to get method, this method can be use to get parameter values for multiple query paths at once. - -* [getm_values documentation](../api/ubus/usp.raw.md#getm_values) - -##### getm_names_raw - -This method is an extension to get method, this method can be use to get parameter names for multiple query paths at once. - -* [getm_names documentation](../api/ubus/usp.raw.md#getm_names) - - -##### object_names_raw - -This method exposes names of the objects in the spectified query path registered in the data model. - -* [object_names documentation](../api/ubus/usp.raw.md#object_names) - -##### instances_raw - -Get all the instances for specified schema path. - -* [disconnect documentation](../api/ubus/usp.raw.md#instances) - -##### validate_raw - -This method validates whether the path provided is valid as per registerd schema paths. - -* [validate documentation](../api/ubus/usp.raw.md#validate) - - -##### transaction_start - -This method starts a transaction with the name provided. - -* [transaction_start documentation](../api/ubus/usp.raw.md#transaction_start) - - -##### set_raw - -This method is used to set information of various registered schema parameters. - -* [set documentation](../api/ubus/usp.raw.md#set) - -##### operate_raw - -This method is used to execute various sync/async operations e.g., IPPing(), NeighbourDiagnostics() etc. - -* [operate documentation](../api/ubus/usp.raw.md#operate) - -##### add_object_raw - -This method is used to add an object to specified multi instance object in registered schema. - -* [add_object neighbor documentation](../api/ubus/usp.raw.md#add_object) - -##### del_object_raw - -This method is used to delete an object from specified multi instance object in registered schema. - -* [del_object documentation](../api/ubus/usp.raw.md#del_object) - -##### setm_values_raw - -This method is an extension to set method, this method can be use to set parameter values for multiple query paths at once. - -* [setm_values documentation](../api/ubus/usp.raw.md#setm_values) - - -##### transaction_commit - -This method commits the changes made by an ongoing transaction. - -* [transaction_commit documentation](../api/ubus/usp.raw.md#transaction_commit) - - -##### transaction_abort - -This method aborts an ongoing transaction. - -* [transaction_abort documentation](../api/ubus/usp.raw.md#transaction_abort) - -##### transaction_status - -This method provides with the status of an ongoing transaction. - -* [transaction_status documentation](../api/ubus/usp.raw.md#transaction_status) - -##### notify_event - -This method is used to get notified whenever the specified event occurs - -* [notify_event documentation](../api/ubus/usp.raw.md#notify_event) diff --git a/bbfd/docs/spec/testspec.md b/bbfd/docs/spec/testspec.md deleted file mode 100644 index 6b35171a..00000000 --- a/bbfd/docs/spec/testspec.md +++ /dev/null @@ -1,464 +0,0 @@ -# Test Specification - -Most of the functionalities in uspd can be tested via its ubus API. Each -API can be broken down into an individual test case to show full coverage is -achieved. - -# Sections -* [Preqreuisites](#prerequisites) -* [Test Suites](#test-suites) -* [Functional API Tests](#functional-api-tests) -* [Unit Tests](#unit-tests) -* [Functional Tests](#functional-tests) - - -## Prerequisites - -The prerequisite for the uspd test suites is that libbbfdm and ubusd has to be -built for the TEST platform, a version prepared to publish dummy data for get -API, and record set API to a test logfile at `/tmp/test.log`. - -| Dependency | Link | License | -| :--- | :--- | :--- | -| ---------- | ---------------------------------------- | -------- | -| ubusd | https://git.openwrt.org/project/ubus.git | LGPL 2.1 | -| libbbfdm | https://dev.iopsys.eu/iopsys/bbf.git | LGPL 2.1 | - - -## Test Suites - -The uspd build pipe has three test suites, a functional-api suite, unit test suite -and functional test suite. - -### Functional API Tests - -The functional API tests consists of two individual test suites, one per object -Ubus under test. The functional API tests use the Ubus-API-validation -command-line interface tool to invoke a method, programmatically through -libubus, and validates it against the objects json-schema. - -#### usp - -| Execution ID | Method | Description | Function ID Coverage | -| :--- | :--- | :--- | :--- | -| 1 | list_operate | No argument | [1](./functionspec.md#list_operate) | -| 2 | get_supported_dm \ with path argument | [2](./functionspec.md#get_supported_dm) | -| 3 | get | With path argument | [3](./functionspec.md#get) | -| 4 | object_names | With path argument | [4](./functionspec.md#object_names) | -| 5 | instances | With path argument | [5](./functionspec.md#instances) | -| 6 | validate | With path argument | [6](./functionspec.md#validate) | -| 7 | set | With path and value arguments | [7](./functionspec.md#set) | -| 8 | operate | With path, action and input arguments | [8](./functionspec.md#operate) | -| 9 | add_object | With path argument | [9](./functionspec.md#add_object) | -| 10 | del_object | With path argument | [10](./functionspec.md#del_object) | - - -#### usp.raw - -| Execution ID | Method | Description | Function ID Coverage | -| :--- | :--- | :--- | :--- | -| 1 | dump_schema | No argument | [15](./functionspec.md#dump_schema_raw) | -| 2 | list_operate | No argument | [16](./functionspec.md#list_operate_raw) | -| 3 | list_events | No argument | [16](./functionspec.md#list_events) | -| 4 | get_supported_dm | with path argument | [2](./functionspec.md#get_supported_dm) | -| 5 | get | With path argument | [17](./functionspec.md#get_raw) | -| 6 | getm_values | With paths array argument | [25](./functionspec.md#getm_values_raw) | -| 7 | getm_name | With paths array argument | [26](./functionspec.md#getm_names_raw) | -| 8 | object_names | With path argument | [18](./functionspec.md#object_names_raw) | -| 9 | instances | With path argument | [19](./functionspec.md#instances_raw) | -| 10 | validate | With path argument | [20](./functionspec.md#validate_raw) | -| 11 | transaction_start | With app argument | [17](./functionspec.md#transaction_start) | -| 12 | set | With path and value arguments | [21](./functionspec.md#set_raw) | -| 13 | operate | With path, action and input arguments | [22](./functionspec.md#operate_raw) | -| 14 | add_object | With path argument | [23](./functionspec.md#add_object_raw) | -| 15 | del_object | With path argument | [24](./functionspec.md#del_object_raw) | -| 16 | setm_values | With pv_tuple and transaction_id argument | [17](./functionspec.md#setm_val) | -| 17 | transaction_commit | With transaction_id argument | [17](./functionspec.md#transaction_commit) | -| 18 | transaction_abort | With transaction_id argument | [17](./functionspec.md#transaction_abort) | -| 19 | transaction_status | With transaction_id argument | [17](./functionspec.md#transaction_status) | -| 20 | notify_event | With ***** argument | [17](./functionspec.md#notify_event) | - - -### Unit Tests - -The uspd unit tests are written in cmocka, invoking the ubus callbacks -directly from the source code, which is compiled into a shared library. -This means mocking the arguments of a cli or libubus invoke in a -`struct blob_attr *`. The results of the call will be logged to the logfile at -`/tmp/test.log`. - -| Execution ID | Method | Test Case Name | Function ID Coverage | -| :--- | :--- | :--- | :--- | -| 1 | dump_schema | [test_api_usp_raw_dump_schema](#test_api_usp_raw_dump_schema) | [1](./functionspec.md#dump_schema_raw) -| 2 | list_operate | [test_api_usp_list_operate](#test_api_usp_list_operate) | [2](./functionspec.md#list_operate) | -| 3 | get | [test_api_usp_get](#test_api_usp_get) | [3](./functionspec.md#get) | -| 4 | object_names | [test_api_usp_object_name](#test_api_usp_object_name) | [4](./functionspec.md#object_names) | -| 5 | instances | [test_api_usp_instances](#test_api_usp_instances) | [5](./functionspec.md#instances) | -| 6 | validate | [test_api_usp_resolve](#test_api_usp_resolve) | [6](./functionspec.md#validate) | -| 7 | set | [test_api_usp_set](#test_api_usp_set) | [7](./functionspec.md#set) | -| 8 | add_object | [test_api_usp_add_object](#test_api_usp_add_object) | [9](./functionspec.md#add_object) | -| 9 | del_object | [test_api_usp_del](#test_api_usp_del_object) | [10](./functionspec.md#del_object) | -| 10 | getm_values | [test_api_usp_get_safe_values](#test_api_usp_get_safe_values) | [11](./functionspec.md#getm_values) | -| 11 | getm_name | [test_api_usp_get_safe_names](#test_api_usp_get_safe_names) | [12](./functionspec.md#getm_names) | - -#### test_api_usp_dump_schema - -##### Description - -Tests the uspd ubus API callback `dump_schema`, publishing the method -[dump_schema](./functionspec.md#dump_schema). - -##### Test Steps - -Issuing a dump_schema to a client from the uspd test platform. - -Read the logfile and verify that the `schema` argument was -accurately logged. - -##### Test Expected Results - -The expected result is for the log file to have recorded a call to the -dump_schema function. - -````bash -{ - "parameters": [ - { - "parameter": "Device.ATM.Link.{i}.", - "writable": "1", - "type": "xsd:object" - }, - { - "parameter": "Device.ATM.Link.{i}.Alias", - "writable": "1", - "type": "xsd:string" - }, - { - "parameter": "Device.ATM.Link.{i}.DestinationAddress", - "writable": "1", - "type": "xsd:string" - }, - { - "parameter": "Device.ATM.Link.{i}.Enable", - "writable": "1", - "type": "xsd:boolean" - }, - { -... -} -``` - -#### test_api_usp_list_operate - -##### Description - -Tests the uspd ubus API `list_operate`, publishing the method -[list_operate](./functionspec.md#list_operate). - -##### Test Steps - -Issuing a list_operate to a client from the uspd test platform. - -Read the logfile and verify that the `list_operate` argument was -accurately logged. - -##### Test Expected Results - -````bash -{ - "parameters": [ - { - "parameter": "Device.DHCPv4.Client.{i}.Renew()", - "type": "sync" - }, - { - "parameter": "Device.DNS.Diagnostics.NSLookupDiagnostics()", - "type": "async" - }, - { - { - "parameter": "Device.IP.Diagnostics.IPPing()", - "type": "async" - }, - { - "parameter": "Device.IP.Diagnostics.TraceRoute()", - "type": "async" - }, - { - "parameter": "Device.IP.Diagnostics.UDPEchoDiagnostics()", - "type": "async" - }, - { - "parameter": "Device.IP.Interface.{i}.Reset()", - "type": "sync" - }, - { - "parameter": "Device.Reboot()", - "type": "sync" - }, - { - -``` - -#### test_api_usp_get - -##### Description - -Tests the uspd ubus API get, publishing the method -[get](./functionspec.md#get). - -##### Test Steps - -Prepare the arguments as: - -````bash -{"path":"Device.IP.Diagnostics.", "proto":"usp"} -``` - -Requesting the libbfdm with the path `Device.IP.Diagnostics.`. - -Read the logfile and verify that the interface and arguments were accurately -logged. - -##### Test Expected Results - -The expected result is for the log file to have recorded a call to the -`libbbfdm`, through ubus and with the argument `path` as `Device.IP.Diagnostics.` -`proto` as `usp`. - -````bash -{ - "Diagnostics": { - "IPv4DownloadDiagnosticsSupported": true, - "IPv4PingSupported": true, - "IPv4ServerSelectionDiagnosticsSupported": true, - "IPv4TraceRouteSupported": true, - "IPv6UploadDiagnosticsSupported": true, - "UDPEchoConfig": { - "BytesReceived": 0, - "BytesResponded": 0, - "TimeFirstPacketReceived": "0", - "TimeLastPacketReceived": "0", - "UDPPort": 0 - } - } -} -``` - -#### test_api_usp_instances - -##### Description - -Tests the uspd ubus API instances, publishing the method -[instances](./functionspec.md#instances). - -##### Test Steps - -Prepare the arguments as: - -````bash -{"path":"Device.IP.Interface.", "proto":"usp"} -``` - -Requesting the libbfdm with the path `Device.IP.Interface.`. - -Read the logfile and verify that the interface and arguments were accurately -logged. - -##### Test Expected Results - -The expected result is for the log file to have recorded a call to the -`libbbfdm`, through ubus and with the argument `path` as `Device.IP.Interface.` -`proto` as `usp`. - -````bash -{ - "parameters": [ - { - "parameter": "Device.IP.Interface.1." - }, - { - "parameter": "Device.IP.Interface.1.IPv4Address.1." - }, - { - "parameter": "Device.IP.Interface.2." - }, - { - "parameter": "Device.IP.Interface.3." - }, - { - "parameter": "Device.IP.Interface.3.IPv4Address.1." - }, - { - "parameter": "Device.IP.Interface.3.IPv6Address.1." - }, - { - "parameter": "Device.IP.Interface.3.IPv6Prefix.1." - } - ] -} -``` - -#### test_api_usp_instances - -##### Description - -Tests the uspd ubus API instances, publishing the method -[instances](./functionspec.md#instances). - -##### Test Steps - -Prepare the arguments as: - -````bash -{"path":"Device.IP.Interface.", "proto":"usp"} -```` - -Requesting the libbfdm with the path `Device.IP.Interface.`. - -Read the logfile and verify that the interface and arguments were accurately -logged. - -##### Test Expected Results - -The expected result is for the log file to have recorded a call to the -`libbbfdm`, through ubus and with the argument `path` as `Device.IP.Interface.` -`proto` as `usp`. - -```bash -{ - "parameters": [ - { - "parameter": "Device.IP.Interface.1." - }, - { - "parameter": "Device.IP.Interface.1.IPv4Address.1." - }, - { - "parameter": "Device.IP.Interface.2." - }, - { - "parameter": "Device.IP.Interface.3." - }, - { - "parameter": "Device.IP.Interface.3.IPv4Address.1." - }, - { - "parameter": "Device.IP.Interface.3.IPv6Address.1." - }, - { - "parameter": "Device.IP.Interface.3.IPv6Prefix.1." - } - ] -} -``` - - -### Functional Tests - - -#### test_func_ref_follow - -##### Description - -Tests the reference follow for search path. Reference follow is basically -quering a search path, which is referenced by the path queried for. - -##### Test Steps - -Prepare the arguments as: - -````bash -{"path":"Device.WiFi.SSID.1.LowerLayers+.Alias", "proto":"usp"} -``` - -##### Test Expected Results - -The expected result is for the log file to have recorded a call to the -`libbbfdm`, through ubus and with the argument `path` as `Device.WiFi.SSID.1.LowerLayers+.Alias` and `proto` as `usp`. - -````bash -{ - "Device": { - "WiFi": { - "Radio": [ - { - "Alias": "cpe-1" - } - ] - } - } -} -``` - -#### test_func_list_of_ref - -##### Description - -Tests the list of reference following for search path. Reference follow is basically -quering a search path, which is referenced by the path queried for. - -##### Test Steps - -Prepare the arguments as: - -````bash -{"path":"Device.WiFi.SSID.1.LowerLayers#1+.Name"} -``` - -##### Test Expected Results - -The expected result is for the log file to have recorded a call to the -`libbbfdm`, through ubus and with the argument `path` as `Device.WiFi.SSID.1.LowerLayers#1+.Name` and `proto` as `usp`. - -````bash -{ - "Device": { - "WiFi": { - "Radio": [ - { - "Name": "wl0" - } - ] - } - } -} -``` - -#### test_func_search_expr - -##### Description - -Testing search path, this is a path Name that contains search criteria for addressing a -set of Multi-Instance Objects and/or their parameters. A Search path may contain a -Search Expression or Wildcard. - -##### Test Steps - -Prepare the arguments as: - -````bash -{"path":"Device.WiFi.SSID.[Status==\"Up\"].Alias"} -``` - -##### Test Expected Results - -In the above bash parameter path we can identify the square brackets as search path. So basically through this search path we are querying 'Alias' for any WiFi.SSID instance having -`Up` Status. - -The expected result is for the log file to have recorded a call to the -`libbbfdm`, through ubus and with the argument `path` as `Device.WiFi.SSID.1.LowerLayers#1+.Name` and `proto` as `usp`. - -````bash -{ - "SSID": [ - { - "Alias": "cpe-1" - }, - { - "Alias": "cpe-2" - } - ] -} -``` - diff --git a/bbfd/src/events.c b/bbfd/events.c similarity index 100% rename from bbfd/src/events.c rename to bbfd/events.c diff --git a/bbfd/src/events.h b/bbfd/events.h similarity index 100% rename from bbfd/src/events.h rename to bbfd/events.h diff --git a/bbfd/src/get.c b/bbfd/get.c similarity index 100% rename from bbfd/src/get.c rename to bbfd/get.c diff --git a/bbfd/src/get.h b/bbfd/get.h similarity index 100% rename from bbfd/src/get.h rename to bbfd/get.h diff --git a/bbfd/src/get_helper.c b/bbfd/get_helper.c similarity index 100% rename from bbfd/src/get_helper.c rename to bbfd/get_helper.c diff --git a/bbfd/src/get_helper.h b/bbfd/get_helper.h similarity index 100% rename from bbfd/src/get_helper.h rename to bbfd/get_helper.h diff --git a/bbfd/gitlab-ci/functional-api-test.sh b/bbfd/gitlab-ci/functional-api-test.sh deleted file mode 100755 index f9d1c8f8..00000000 --- a/bbfd/gitlab-ci/functional-api-test.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -echo "$0 preparation script" -pwd - -source ./gitlab-ci/shared.sh - -trap cleanup EXIT -trap cleanup SIGINT - -# clean and make -make clean -CFLAGS="-g -Os -fprofile-arcs -ftest-coverage -DUSPD_MAX_MSG_LEN=1048576" LDFLAGS="--coverage" make func-test -C ./ -check_ret $? - -supervisorctl update -supervisorctl restart all -supervisorctl status all -exec_cmd ubus wait_for usp.raw usp -supervisorctl status all - -# debug logging -echo "Checking ubus status [$(date '+%d/%m/%Y %H:%M:%S')]" -ubus list -ubus -v list usp.raw -ubus -v list usp - -echo "Checking system resources" -free -h -df -h -sleep 5 -# run functional on usp object validation -if [ -f "/usr/share/rpcd/schemas/usp*.json" ]; then - rm /usr/share/rpcd/schemas/usp*.json -fi - -cp -r ./schemas/ubus/usp.json /usr/share/rpcd/schemas -ubus-api-validator -t 5 -f ./test/api/json/usp.validation.json > ./api-result.log -generate_report usp_api api-result.log - -# run functional on usp object validation -if [ -f "/usr/share/rpcd/schemas/usp*.json" ]; then - rm /usr/share/rpcd/schemas/usp*.json -fi - -cp -r ./schemas/ubus/usp.raw.json /usr/share/rpcd/schemas -ubus-api-validator -t 5 -f ./test/api/json/usp.raw.validation.json >> ./api-result.log -generate_report usp_raw_api api-result.log - -supervisorctl status all -supervisorctl stop all -supervisorctl status - -#report part -date +%s > timestamp.log -gcovr -r . --xml -o ./api-test-coverage.xml -gcovr -r . - -echo "Checking memory leaks..." -grep -q "Leak" memory-report.xml -error_on_zero $? - -echo "Functional ubus API test :: PASS" diff --git a/bbfd/gitlab-ci/functional-test.sh b/bbfd/gitlab-ci/functional-test.sh deleted file mode 100755 index a3bb4504..00000000 --- a/bbfd/gitlab-ci/functional-test.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash - -echo "$0 preparation script" -pwd - -source ./gitlab-ci/shared.sh - -trap cleanup EXIT -trap cleanup SIGINT - -make clean -CFLAGS="-g -Os -fprofile-arcs -ftest-coverage -DUSPD_MAX_MSG_LEN=1048576" LDFLAGS="--coverage" make func-test -C ./ -check_ret $? -ls - -supervisorctl update -supervisorctl restart all -supervisorctl status all -exec_cmd ubus wait_for usp.raw usp -supervisorctl status all - -# debug logging -echo "Checking ubus status [$(date '+%d/%m/%Y %H:%M:%S')]" -ubus list -ubus -v list usp.raw -ubus -v list usp - -echo "Checking system resources" -free -h -df -h - -echo "## Preparing shared library for uspd msglen test ##" -exec_cmd make -C ./test - -echo "## Running python based verification of functionalities ##" -echo > ./funl-result.log -num=0 -for test in `ls -1 ./test/python/*.py` -do - num=$(( num + 1 )) - sleep 1 - $test - if [ $? -eq 0 ]; then - echo "ok ${num} - $test" >> ./funl-result.log - - else - echo "not ok ${num} - $test" >> ./funl-result.log - fi -done - -echo "1..${num}" >> ./funl-result.log -generate_report python_test ./funl-result.log - -# run functional on usp object validation -if [ -f "/usr/share/rpcd/schemas/usp*.json" ]; then - rm /usr/share/rpcd/schemas/usp*.json -fi - -fault=0 -# run functional on usp object validation -cp -r ./test/funl/schema/usp_test_positive.json /usr/share/rpcd/schemas/usp.json -ubus-api-validator -t 5 -f ./test/funl/validation/usp.validation.positive.json > ./funl-result.log -fault=$? -generate_report usp_positive ./funl-result.log - -cp -r ./test/funl/schema/usp_test_negative.json /usr/share/rpcd/schemas/usp.json -ubus-api-validator -t 5 -f ./test/funl/validation/usp.validation.negative.json > ./funl-result.log -fault=$(( $fault + $? )) -generate_report usp_negative ./funl-result.log - -# run functional on usp.raw object validation -rm /usr/share/rpcd/schemas/usp*.json -cp -r ./test/funl/schema/usp.raw_test_positive.json /usr/share/rpcd/schemas/usp.raw.json -ubus-api-validator -t 5 -f ./test/funl/validation/usp.raw.validation.positive.json > ./funl-result.log -fault=$(( $fault + $? )) -generate_report usp_raw_positive ./funl-result.log - -#test usp.raw for negative test cases -cp -r ./test/funl/schema/usp.raw_test_negative.json /usr/share/rpcd/schemas/usp.raw.json -ubus-api-validator -t 5 -f ./test/funl/validation/usp.raw.validation.negative.json > ./funl-result.log -fault=$(( $fault + $? )) -generate_report usp_raw_negative ./funl-result.log - -# TODO: add for granularity ubus objects -#uci set uspd.usp.granularitylevel='1' -#uci commit - -#ubus-api-validator -f ./test/funl/json/gran/gran.validation.json >> ./funl-result.log -#fault=$? - -#uci set uspd.usp.granularitylevel='0' -#uci commit - -supervisorctl stop all -supervisorctl status - -#report part -gcovr -r . --xml -o ./funl-test-coverage.xml -gcovr -r . -date +%s > timestamp.log - -echo "Checking memory leaks..." -grep -q "Leak" memory-report.xml -error_on_zero $? - -if [ "${fault}" -ne 0 ]; then - echo "Failed running ubus-api-validator fault[$fault]" - exit $fault -fi - -echo "Functional Test :: PASS" diff --git a/bbfd/gitlab-ci/install-dependencies.sh b/bbfd/gitlab-ci/install-dependencies.sh deleted file mode 100755 index 820fd4e0..00000000 --- a/bbfd/gitlab-ci/install-dependencies.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -echo "install dependencies of uspd" -pwd - -source ./gitlab-ci/shared.sh - -# install required packages -exec_cmd apt update -exec_cmd apt install -y python3-pip -exec_cmd pip3 install pexpect ubus -git config --global --add safe.directory ${PWD} -branch="$(git branch --show-current)" - -# install libbbf -cd /opt/dev -rm -rf bbf - -if [ -z "${BBF_TAR_URL}" ]; then - if ! git clone -b ${branch} https://dev.iopsys.eu/iopsys/bbf.git; then - exec_cmd git clone https://dev.iopsys.eu/iopsys/bbf.git - fi - - cd bbf - echo "BBF Upstream Hash ${UPSTREAM_BBF_SHA}, uspd branch ${branch}" - if [ -n "${UPSTREAM_BBF_SHA}" ]; then - exec_cmd git checkout ${UPSTREAM_BBF_SHA} - fi - - git log -1 - source ./gitlab-ci/shared.sh - install_libbbf - ./gitlab-ci/setup.sh -else - echo "## Installing upstream libbbf release from [${BBF_TAR_URL}] ##" - mkdir -p bbf - cd bbf - exec_cmd wget -q ${BBF_TAR_URL} -O bbf.sh - chmod +x bbf.sh - ./bbf.sh --prefix=/ --exclude-subdir --skip-license - ldconfig - cd .. -fi - -cd - -# install usermngr plugin -rm -rf /opt/dev/usermngr -exec_cmd git clone https://dev.iopsys.eu/iopsys/usermngr.git /opt/dev/usermngr - -echo "Compiling libusermngr" -make clean -C /opt/dev/usermngr/src -make -C /opt/dev/usermngr/src - -echo "Installing libusermngr" -cp -f /opt/dev/usermngr/src/libusermngr.so /usr/lib/bbfdm - diff --git a/bbfd/gitlab-ci/iopsys-supervisord.conf b/bbfd/gitlab-ci/iopsys-supervisord.conf deleted file mode 100644 index 7426d91c..00000000 --- a/bbfd/gitlab-ci/iopsys-supervisord.conf +++ /dev/null @@ -1,15 +0,0 @@ -[program:ubusd] -autorestart=false -priority=1 -command=/bin/bash -c "/usr/sbin/ubusd" - -[program:rpcd] -autorestart=false -priority=2 -command=/bin/bash -c "/usr/sbin/rpcd" - -[program:uspd] -autorestart=false -priority=3 -command=/bin/bash -c "/usr/bin/valgrind --xml=yes --xml-file=/builds/iopsys/uspd/memory-report.xml --leak-check=full --show-reachable=yes --show-leak-kinds=all --errors-for-leak-kinds=all --error-exitcode=1 --track-origins=yes --leak-resolution=high --show-error-list=yes --child-silent-after-fork=yes /builds/iopsys/uspd/uspd" - diff --git a/bbfd/gitlab-ci/setup.sh b/bbfd/gitlab-ci/setup.sh deleted file mode 100755 index 149eb766..00000000 --- a/bbfd/gitlab-ci/setup.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -echo "preparation script" -pwd - -cp -r ./test/files/* / -cp ./gitlab-ci/iopsys-supervisord.conf /etc/supervisor/conf.d/ - -ls /etc/config/ -ls /usr/share/rpcd/schemas/ -ls /etc/supervisor/conf.d/ - -supervisorctl shutdown -supervisord -c /etc/supervisor/supervisord.conf diff --git a/bbfd/gitlab-ci/shared.sh b/bbfd/gitlab-ci/shared.sh deleted file mode 100644 index 43f1275c..00000000 --- a/bbfd/gitlab-ci/shared.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -function cleanup() -{ - echo "" -} - -function check_ret() -{ - ret=$1 - if [ "$ret" -ne 0 ]; then - echo "Validation of last command failed, ret(${ret})" - exit $ret - fi - -} - -function error_on_zero() -{ - ret=$1 - if [ "$ret" -eq 0 ]; then - echo "Validation of last command failed, ret(${ret})" - exit $ret - fi - -} - -function exec_cmd() -{ - echo "executing $@" - $@ >/dev/null 2>&1 - - if [ $? -ne 0 ]; then - echo "Failed to execute $@" - exit 1 - fi -} - -function generate_report() -{ - exec_cmd tap-junit --name "${1}" --input "${2}" --output report - sync -} - diff --git a/bbfd/gitlab-ci/unit-test.sh b/bbfd/gitlab-ci/unit-test.sh deleted file mode 100755 index 73c02462..00000000 --- a/bbfd/gitlab-ci/unit-test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -echo "preparation script" -pwd -source ./gitlab-ci/shared.sh - -trap cleanup EXIT -trap cleanup SIGINT - -echo "Running the unit test cases" -make clean -make unit-test -C ./src/ -check_ret $? - -#report part -#GitLab-CI output -gcovr -r . -# Artefact -gcovr -r . --xml -o ./unit-test-coverage.xml -date +%s > timestamp.log - -echo "Unit test PASS" diff --git a/bbfd/src/ipc.h b/bbfd/ipc.h similarity index 100% rename from bbfd/src/ipc.h rename to bbfd/ipc.h diff --git a/bbfd/openwrt/uspd/Makefile b/bbfd/openwrt/uspd/Makefile deleted file mode 100644 index 42b2ef25..00000000 --- a/bbfd/openwrt/uspd/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=uspd -PKG_VERSION:=1.0.5 -PKG_RELEASE:=$(PKG_SOURCE_VERSION) - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git -PKG_SOURCE_VERSION=x -PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz - -PKG_MAINTAINER:=IOPSYS Dev - -CONFIG_SRC_TREE_OVERRIDE:=y - -include $(INCLUDE_DIR)/package.mk - -define Package/uspd - SECTION:=iopsys - CATEGORY:=IOPSYS - TITLE:=USP ubus backend - DEPENDS:=+libubox +ubus +libbbfdm -endef - -define Package/uspd/description - Ubus based backend for TR-369/USP which can be used by other USP agents - running on top of it. -endef - -TARGET_CFLAGS += \ - -I$(STAGING_DIR)/usr/include \ - -D_GNU_SOURCE - -define Package/uspd/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_BIN) ./files/uspd.init $(1)/etc/init.d/uspd - $(INSTALL_CONF) ./files/uspd.config $(1)/etc/config/uspd - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/uspd $(1)/usr/sbin/ -endef - -$(eval $(call BuildPackage,uspd)) diff --git a/bbfd/openwrt/uspd/files/uspd.config b/bbfd/openwrt/uspd/files/uspd.config deleted file mode 100644 index d8b3621c..00000000 --- a/bbfd/openwrt/uspd/files/uspd.config +++ /dev/null @@ -1,2 +0,0 @@ -config uspd 'usp' - option granularitylevel '0' diff --git a/bbfd/openwrt/uspd/files/uspd.init b/bbfd/openwrt/uspd/files/uspd.init deleted file mode 100644 index 2f788976..00000000 --- a/bbfd/openwrt/uspd/files/uspd.init +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=94 -STOP=10 - -USE_PROCD=1 -PROG=/usr/sbin/uspd - -start_service() { - procd_open_instance - procd_set_param command ${PROG} - procd_set_param respawn - procd_close_instance -} - -reload_service() { - stop - start -} - -service_triggers() -{ - procd_add_reload_trigger "cwmp" - procd_add_config_trigger "config.change" "uspd" /etc/init.d/uspd restart -} diff --git a/bbfd/openwrt/uspd/git-src b/bbfd/openwrt/uspd/git-src deleted file mode 120000 index a49c86c1..00000000 --- a/bbfd/openwrt/uspd/git-src +++ /dev/null @@ -1 +0,0 @@ -../../.git/ \ No newline at end of file diff --git a/bbfd/src/operate.c b/bbfd/operate.c similarity index 100% rename from bbfd/src/operate.c rename to bbfd/operate.c diff --git a/bbfd/src/operate.h b/bbfd/operate.h similarity index 100% rename from bbfd/src/operate.h rename to bbfd/operate.h diff --git a/bbfd/src/pretty_print.c b/bbfd/pretty_print.c similarity index 100% rename from bbfd/src/pretty_print.c rename to bbfd/pretty_print.c diff --git a/bbfd/src/pretty_print.h b/bbfd/pretty_print.h similarity index 100% rename from bbfd/src/pretty_print.h rename to bbfd/pretty_print.h diff --git a/bbfd/schemas/ubus/usp.json b/bbfd/schemas/ubus/usp.json deleted file mode 100644 index d19d5027..00000000 --- a/bbfd/schemas/ubus/usp.json +++ /dev/null @@ -1,791 +0,0 @@ -{ - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": [ - "Device.", - "Device.DeviceInfo.Manufacturer", - "Device.WiFi.SSID.1.", - "Device.WiFi." - ] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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 - } - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://dev.iopsys.eu/iopsys/uspd/-/blob/devel/docs/api/usp.md", - "type": "object", - "title": "usp", - "object": "usp", - "additionalProperties": false, - "properties": { - "get_supported_dm": { - "title": "Get list of supported datamodel parameters", - "description": "Schema will have all the nodes/objects supported by libbbf", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "schema_type": { - "type": "integer", - "minimum": 0, - "maximum": 3, - "description": "0-All, 1-Parameter only 2- Event only 3- operate only" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "type", - "writable" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "cmd_type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - }, - "out": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - } - } - } - ] - } - } - } - ] - } - } - }, - "list_operate": { - "title": "List down supported usp operate commands", - "description": "Commands will be shown in schema format", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "required": [ - "parameter", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/operate_path_t" - }, - "type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "items": { - "type": "string" - } - }, - "out": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "get": { - "title": "Get handler", - "description": "Query the datamodel object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code in fault_t" - } - }, - { - "type": "object", - "properties": {}, - "examples": [ - "root@iopsys:/tmp# ubus call usp get '{\"path\":\"Device.Users.User.2.\"}'\n{\n\t\"User\": [\n\t\t{\n\t\t\t\"Alias\": \"\",\n\t\t\t\"Enable\": true,\n\t\t\t\"Language\": \"\",\n\t\t\t\"Password\": \"\",\n\t\t\t\"RemoteAccessCapable\": false,\n\t\t\t\"Username\": \"user_2\"\n\t\t}\n\t]\n}", - "root@iopsys:/tmp# ubus call usp get '{\"path\":\"Device.Users.\"}'\n{\n\t\"Users\": {\n\t\t\"User\": [\n\t\t\t{\n\t\t\t\t\"Alias\": \"\",\n\t\t\t\t\"Enable\": true,\n\t\t\t\t\"Language\": \"\",\n\t\t\t\t\"Password\": \"\",\n\t\t\t\t\"RemoteAccessCapable\": true,\n\t\t\t\t\"Username\": \"user\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Alias\": \"\",\n\t\t\t\t\"Enable\": true,\n\t\t\t\t\"Language\": \"\",\n\t\t\t\t\"Password\": \"\",\n\t\t\t\t\"RemoteAccessCapable\": false,\n\t\t\t\t\"Username\": \"user_2\"\n\t\t\t}\n\t\t],\n\t\t\"UserNumberOfEntries\": 2\n\t}\n}" - ] - } - ] - } - } - }, - "set": { - "title": "Set handler", - "description": "Set values of datamodel object element", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "value" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "value": { - "description": "value of the object element provided in path, path should contains valid writable object element", - "type": "string", - "examples": [ - "{\"path\":\"Device.WiFi.SSID.1.SSID\", \"value\":\"test_ssid\"}", - "{\"path\":\"Device.WiFi.SSID.2.Enable\", \"value\":\"true\"}", - "{\"path\":\"Device.WiFi.SSID.1.Enable\", \"value\":\"0\"}" - ] - }, - "values": { - "description": "To set multiple values at once, path should be relative to object elements", - "examples": [ - "{\"path\":\"Device.WiFi.SSID.1\", \"values\":{\".SSID\":\"test_ssid\",\".Name\":\"test_name\"}}", - "{\"path\":\"Device.WiFi.SSID.2\", \"values\":{\".SSID\":\"test_ssid\"}}" - ], - "type": "object", - "properties": {} - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "oneof": [ - { - "type": "object", - "properties": { - "status": { - "const": "1" - } - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "status": { - "const": "0" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - } - } - } - ] - } - } - }, - "add_object": { - "title": "Add a new object instance", - "description": "Add a new object in multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "required": [ - "parameter", - "status" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "instance": { - "type": "string" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - } - } - } - } - }, - "del_object": { - "title": "Delete object instance", - "description": "Delete a object instance from multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "required": [ - "parameter", - "status" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - } - } - } - } - }, - "validate": { - "title": "Validate a datamodel object", - "description": "API to check if a datamodel object is available", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "type": "object", - "properties": { - "parameter": { - "type": "string" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - } - }, - "instances": { - "title": "Instance query handler", - "description": "Get the instances of multi object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code in fault_t" - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/instance_t" - } - } - } - } - } - } - ] - } - } - }, - "object_names": { - "title": "Get objects names", - "description": "Get names of all the objects below input object path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code in fault_t" - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": { - "$ref": "#/definitions/type_t" - }, - "required": [ - "parameter", - "type", - "writable" - ], - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - } - } - } - } - } - } - ] - } - } - }, - "operate": { - "title": "Operate handler", - "description": "Operate on object element provided in path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "action" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "instance-mode": { - "type": "integer", - "description": "" - }, - "action": { - "description": "Opreate command as defined in TR-369, TR-181-2.13", - "type": "string", - "examples": [ - "{\"path\":\"Device.WiFi.\", \"action\":\"Reset\\(\\)\"}" - ], - "pattern": "[a-zA-Z]+\\(\\)" - }, - "input": { - "description": "Input arguments for the operate command as defined in TR-181-2.13", - "examples": [ - "{\"path\":\"Device.IP.Diagnostics\", \"action\":\"IPPing\\(\\)\", \"input\":{\"Host\":\"iopsys.eu\"}}" - ], - "type": "object", - "properties": {} - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code in fault_t" - } - }, - { - "description": "Output will have status for sync commands and for async commands parameters as defined in TR-181-2.13", - "type": "object", - "required": [ - "Results" - ], - "properties": { - "Results": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "result": { - "type": "array", - "items": { - "type": "object", - "properties": { - "Result": { - "type": "string", - "Description": "Success or Failure" - } - } - } - } - } - } - } - }, - "examples": [ - "{\n\t\"status\": true}", - "{\n\t\"AverageResponseTime\": \"0\",\n\t\"AverageResponseTimeDetailed\": \"130\",\n\t\"FailureCount\": \"0\",\n\t\"MaximumResponseTime\": \"0\",\n\t\"MaximumResponseTimeDetailed\": \"140\",\n\t\"MinimumResponseTime\": \"0\",\n\t\"MinimumResponseTimeDetailed\": \"120\",\n\t\"SuccessCount\": \"3\"}" - ] - } - ] - } - } - } - } -} diff --git a/bbfd/schemas/ubus/usp.raw.json b/bbfd/schemas/ubus/usp.raw.json deleted file mode 100644 index 3393e1b6..00000000 --- a/bbfd/schemas/ubus/usp.raw.json +++ /dev/null @@ -1,1420 +0,0 @@ -{ - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": [ - "Device.", - "Device.DeviceInfo.Manufacturer", - "Device.WiFi.SSID.1.", - "Device.WiFi." - ] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://dev.iopsys.eu/iopsys/uspd/-/blob/devel/docs/api/usp.raw.md", - "type": "object", - "title": "usp.raw", - "object": "usp.raw", - "additionalProperties": false, - "properties": { - "get_supported_dm": { - "title": "Get list of supported datamodel parameters", - "description": "Schema will have all the nodes/objects supported by libbbf", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "schema_type": { - "type": "integer", - "minimum": 0, - "maximum": 3, - "description": "0-All, 1-Parameter only 2- Event only 3- operate only" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "cmd_type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - }, - "out": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - } - }, - "required": [ - "parameter", - "type" - ] - } - ] - } - } - } - ] - } - } - }, - "dump_schema": { - "title": "Get available datamodel schema from Device", - "description": "Schema will have all the nodes/objects supported by data model", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "unique_keys": { - "type": "array", - "uniqueItems": true, - "maxItems": 8, - "items": [ - { - "type": "string" - } - ] - } - }, - "required": [ - "parameter", - "writable", - "type" - ] - }, - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - } - }, - "required": [ - "parameter", - "writable", - "type" - ] - } - ] - } - }, - "required": [ - "parameters" - ] - } - } - }, - "list_operate": { - "title": "List down supported usp operate commands", - "description": "Commands will be shown in schema format", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/operate_path_t" - }, - "type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - }, - "out": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - } - } - ] - } - } - } - } - }, - "list_events": { - "title": "List down supported usp events", - "description": "events will be shown in schema format", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/operate_path_t" - }, - "type": { - "type": "string", - "pattern": "xsd:event" - }, - "in": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - } - } - ] - } - } - } - } - }, - "get": { - "title": "Get handler", - "description": "Query the datamodel object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "value", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ] - } - } - } - ] - } - } - }, - "getm_values": { - "title": "Get multiple values", - "description": "Query multiple paths at once", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "paths" - ], - "properties": { - "paths": { - "type": "array", - "items": [ - { - "$ref": "#/definitions/path_t" - } - ] - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - } - } - ] - } - } - } - } - }, - "getm_names": { - "title": "Get multiple object names", - "description": "Query multiple object names at once", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "paths" - ], - "properties": { - "paths": { - "type": "array", - "items": [ - { - "$ref": "#/definitions/path_t" - } - ] - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - } - } - ] - } - } - } - } - }, - "instances": { - "title": "Instance query handler", - "description": "Get the instances of multi object", - "type": "object", - "required": [ - "input" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "required": [ - "parameter" - ], - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/instance_t" - } - } - } - ] - } - } - } - ] - } - } - }, - "validate": { - "title": "Validate a datamodel path", - "description": "Validate a path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "$ref": "#/definitions/path_t" - } - } - } - ] - } - } - }, - "object_names": { - "title": "Get objects names", - "description": "Get names of all the objects below input object path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "writable", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "writable": { - "type": "integer", - "description": "1 if object is writable, 0 otherwise" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ] - } - } - } - ] - } - } - }, - "add_object": { - "title": "Add a new object instance", - "description": "Add a new object in multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "transaction_id" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "status" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - }, - "instance": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "del_object": { - "title": "Delete object instance", - "description": "Delete a object instance from multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "transaction_id" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "status" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - } - }, - "set": { - "title": "Set handler", - "description": "Set values of datamodel object element", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "value", - "transaction_id" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "value": { - "description": "value of the object element provided in path, path should contains valid writable object element", - "type": "string", - "examples": [ - "{\"path\":\"Device.WiFi.SSID.1.SSID\", \"value\":\"test_ssid\"}", - "{\"path\":\"Device.WiFi.SSID.2.Enable\", \"value\":\"true\"}", - "{\"path\":\"Device.WiFi.SSID.1.Enable\", \"value\":\"0\"}" - ] - }, - "values": { - "description": "To set multiple values at once, path should be relative to object elements", - "examples": [ - "{\"path\":\"Device.WiFi.SSID.1\", \"values\":{\".SSID\":\"test_ssid\",\".Name\":\"test_name\"}}", - "{\"path\":\"Device.WiFi.SSID.2\", \"values\":{\".SSID\":\"test_ssid\"}}" - ], - "type": "object", - "properties": {} - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - } - } - }, - "output": { - "oneof": [ - { - "type": "object", - "properties": { - "status": { - "const": "1" - } - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - ] - } - } - }, - "operate": { - "title": "Operate handler", - "description": "Operate on object element provided in path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "action" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "action": { - "description": "Opreate command as defined in TR-369, TR-181-2.13", - "type": "string", - "examples": [ - "{\"path\":\"Device.WiFi.\", \"action\":\"Reset\\(\\)\"}" - ] - }, - "input": { - "description": "Input arguments for the operate command as defined in TR-181-2.13", - "examples": [ - "{\"path\":\"Device.IP.Diagnostics\", \"action\":\"IPPing\\(\\)\", \"input\":{\"Host\":\"iopsys.eu\"}}" - ], - "type": "object", - "properties": {} - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "Results" - ], - "properties": { - "Results": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "parameters": { - "description": "Output will have status for sync commands and for async commands parameters as defined in TR-181-2.13", - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "type": "string" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ], - "examples": [ - "{\n\t\"status\": true}", - "{\n\t\"AverageResponseTime\": \"0\",\n\t\"AverageResponseTimeDetailed\": \"130\",\n\t\"FailureCount\": \"0\",\n\t\"MaximumResponseTime\": \"0\",\n\t\"MaximumResponseTimeDetailed\": \"140\",\n\t\"MinimumResponseTime\": \"0\",\n\t\"MinimumResponseTimeDetailed\": \"120\",\n\t\"SuccessCount\": \"3\"}" - ] - } - } - } - ] - } - } - } - } - }, - "transaction_start": { - "title": "Start a transaction before set/add/del operations", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "app": { - "type": "string" - }, - "max_timeout": { - "type": "integer", - "minimum":0 - } - }, - "required": [ - "app" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "error": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "transaction_abort": { - "title": "Aborts an on-going transaction", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "transaction_id": { - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "transaction_id" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - }, - "error": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "transaction_commit": { - "title": "Commits an on-going transaction", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "restart_services": { - "type": "boolean" - } - }, - "required": [ - "transaction_id" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - }, - "error": { - "type": "string" - }, - "updated_services": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "transaction_status": { - "title": "Shows status of a transaction", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "transaction_id": { - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "transaction_id" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "string", - "description": "on-going or not-exists" - }, - "remaining_time": { - "type": "integer" - }, - "app": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "setm_values": { - "title": "Set values of multiple objects at once", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "pv_tuple", - "transaction_id" - ], - "properties": { - "pv_tuple": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "path", - "value" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - } - } - ] - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - }, - "transaction_id": { - "type": "integer", - "minimum": 0 - } - } - }, - "output": { - "type": "object", - "oneof": [ - { - "required": [ - "status" - ] - }, - { - "required": [ - "parameters" - ] - } - ], - "properties": { - "status": { - "type": "boolean" - }, - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - } - }, - "notify_event": { - "title": "notify occurance of an event on ubus", - "type": "object", - "required": [ - "input" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "input": { - "type": "string" - } - } - }, - "output": {} - } - } - } -} diff --git a/bbfd/schemas/uci/uspd.json b/bbfd/schemas/uci/uspd.json deleted file mode 100644 index 8c9ea3a8..00000000 --- a/bbfd/schemas/uci/uspd.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "uspd": [ - { - "section": "uspd", - "description": "USP daemon Settings", - "multi": false, - "options": [ - { - "name": "granularitylevel", - "type": "integer", - "required": "no", - "default": "0", - "description": "Creates ubus objects along with object names, depth of object name depends on granularitylevel" - }, - { - "name": "debug", - "type": "boolean", - "required": "no", - "default": "", - "description": "Enabled debug logging" - }, - { - "name": "sock", - "type": "string", - "required": "no", - "default": "", - "description": "Path for ubus socket to register uspd services" - }, - { - "name": "transaction_timeout", - "type": "integer", - "required": "no", - "default": "10", - "description": "Transaction timeout value in seconds" - }, - { - "name": "loglevel", - "type": "integer", - "required": "no", - "default": "1", - "description": "Internal loglevel for debugging {0: No Logs; 1: Errors only; 2: Errors and warnings; 3: Error, warning and info; 4: Everything}" - }, - { - "name": "subprocess_level", - "type": "integer", - "required": "no", - "default": "2", - "description": "This parameter configures when subprocess can be used for get operation. Level here denotes the Datamodel object depth up-to which subprocess will be used to collect the get data. For example, if this is configured to 1, then only get for 'Device.' shall be called within the subprocess. If configured as level 2, then all the get with up-to depth 2 like 'Device.WiFi.', 'Device.IP.' shall be called in subprocess." - }, - { - "name": "bbf_caching_time", - "type": "integer", - "required": "no", - "default": "0", - "description": "Max caching time in seconds for ubus output used in datamodel parameters. If not configured, output shall be cleared end the end of call." - }, - { - "name": "dm_version", - "type": "string", - "required": "no", - "default": "", - "description": "Configures the datamodel version to use for datamodel parameters, if not configured show all defined datamodel" - }, - { - "name": "refresh_time", - "type": "integer", - "required": "no", - "default": "5", - "description": "The time period in seconds after which uspd will refresh the datamodel instances in a periodic manner. If configured to '0' then instance updater will be disabled. If not configured at all then after every 5 seconds datamodel instances will be refreshed." - } - ] - } - ] -} diff --git a/bbfd/src/set.c b/bbfd/set.c similarity index 100% rename from bbfd/src/set.c rename to bbfd/set.c diff --git a/bbfd/src/set.h b/bbfd/set.h similarity index 100% rename from bbfd/src/set.h rename to bbfd/set.h diff --git a/bbfd/src/Makefile b/bbfd/src/Makefile deleted file mode 100644 index f1bf9f94..00000000 --- a/bbfd/src/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -PROG = uspd -OBJS =common.o get.o get_helper.o set.o operate.o add_delete.o pretty_print.o usp.o events.o -CP=cp -f - -PROG_CFLAGS = $(CFLAGS) \ - -fstrict-aliasing \ - -Wall -Wextra -Werror \ - -Wformat \ - -Wformat-signedness -fPIC - -PROG_LDFLAGS = $(LDFLAGS) -PROG_LDFLAGS += -luci -lubus -lubox -ljson-c -lblobmsg_json -lbbfdm - -ifeq ($(USE_MBEDTLS),yes) -PROG_LDFLAGS += -lmbedcrypto -lmbedtls -endif - -ifeq ($(USE_OPENSSL),yes) -PROG_LDFLAGS += -lssl -lcrypto -endif - -ifeq ($(USE_WOLFSSL),yes) -PROG_LDFLAGS += -lwolfssl -endif - -%.o: %.c - $(CC) $(PROG_CFLAGS) -c -o $@ $< - -all: ${PROG} - -${PROG}: $(OBJS) - $(CC) $(PROG_CFLAGS) -o $@ $^ $(PROG_LDFLAGS) - $(CP) ${PROG} ../${PROG} - -test: PROG_CFLAGS += -fPIC -test: ${OBJS} - ${CC} $(PROG_CFLAGS) -shared -o libuspd.so ${OBJS} $(PROG_LDFLAGS) - $(CP) libuspd.so ../libuspd.so - -unit-test: CFLAGS += -g -O0 -fprofile-arcs -ftest-coverage -unit-test: LDFLAGS += --coverage -unit-test: clean_objs -unit-test: test - make -C ../test/cmocka unit-test USPD_LIB_DIR=$(PWD) - -func-test: CFLAGS += -g -O0 -fprofile-arcs -ftest-coverage -func-test: LDFLAGS += --coverage -func-test: clean_objs -func-test: ${PROG} - -clean_objs: - rm -f *.o -clean: - rm -f *.o libuspd.so $(PROG) - rm -f *.xml *.html - find -name '*.gcda' -exec rm {} -fv \; - find -name '*.gcno' -exec rm {} -fv \; - find -name '*.gcov' -exec rm {} -fv \; diff --git a/bbfd/test/Makefile b/bbfd/test/Makefile deleted file mode 100644 index 073683af..00000000 --- a/bbfd/test/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -LIB = libuspd_test.so - -LIB_OBJS = libuspd_test.o -LIB_CFLAGS = $(CFLAGS) -Wall -Werror -fPIC -LIB_LDFLAGS = $(LDFLAGS) - -%.o: %.c - $(CC) $(LIB_CFLAGS) -I/usr/local/include/libbbf_api/ -c -o $@ $< - -all: $(LIB) - -$(LIB): $(LIB_OBJS) - $(CC) $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -o $@ $^ - -clean: - rm -fv *.o $(LIB) diff --git a/bbfd/test/Readme.md b/bbfd/test/Readme.md deleted file mode 100644 index ff2f41be..00000000 --- a/bbfd/test/Readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# USPD Tests -USPD module test is based on `iopsys/code-analysis-dev` docker image. It consists -of below test phases, in each phase different kind of test perform: - -1. Static code analysis -2. Unit Test -3. API Test -4. Functional Test - -## 1. Static code Analysis -In this stage code is being tested for flaws by running static code analysers, -it also runs CPD tests which determine the optimal reusable codes. -Tests running in this phase are: - - - Flaw finder - - CPP Check - - CPD Test - -## 2. Unit Test -In this stage various wrapper functions being tested for memory leaks using -`valgrind`. -Tests running in this phase are: - - Cmocka Test cases - - Coverage report - - memory check using valgrind - -## 3. API Test -In this stage ubus exposed APIs getting tested using `ubus-api-validator` - -## 4. Functional Test -In this stage functionality provided by uspd is getting tested. - -Below tests and verifications done in this stage: -- Compilation check -- Python based bug verification -- Functionality testing based on schema validation - - - diff --git a/bbfd/test/api/json/usp.raw.validation.json b/bbfd/test/api/json/usp.raw.validation.json deleted file mode 100644 index d9998e80..00000000 --- a/bbfd/test/api/json/usp.raw.validation.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "object": "usp.raw", - "methods": [ - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "hello", - "rc": 3 - }, - { - "method": "instances", - "args": { - "path": "Device.Users.User.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "transaction_start", - "args": { - "app": "test" - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.WiFi.SSID.1.SSID", - "value": "test-2g", - "transaction_id": 123 - }, - "rc": 0 - }, - { - "method": "transaction_abort", - "args": { - "transaction_id": 123 - }, - "rc": 0 - }, - { - "method": "object_names", - "args": { - "path": "Device.WiFi.SSID.1.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "operate", - "args": { - "path":"Device.IP.Diagnostics.", - "action":"IPPing()", - "input":{ - "Host":"127.0.0.1", - "Timeout":".5" - } - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "path":"Device.USB.", - "next-level":false, - "schema_type":1 - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "path":"Device.WiFi." - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "path":"Device.WiFi.", - "next-level":false, - "schema_type":2 - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "path":"Device.USB.", - "next-level":false, - "schema_type":3 - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "path":"Device.WiFi.", - "schema_type":1 - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": {}, - "rc": 0 - }, - { - "method": "dump_schema", - "args": {}, - "rc": 0 - }, - { - "method": "list_operate", - "args": {}, - "rc": 0 - }, - { - "method": "transaction_start", - "args": { - "app": "test" - }, - "rc": 0 - }, - { - "method": "setm_values", - "args": { - "pv_tuple": [{"path":"Device.Users.User.1.Alias", "value":"cpe-1"}, {"path":"Device.Users.User.2.Alias", "value":"cpe-2"}], - "proto": "usp", - "transaction_id": 123 - }, - "rc": 0 - }, - { - "method": "transaction_commit", - "args": { - "transaction_id": 123 - }, - "rc": 0 - }, - { - "method": "getm_names", - "args": { - "paths": ["Device.WiFi.SSID.1.SSID","Device.WiFi.SSID.2.SSID"], - "proto": "usp" - }, - "rc": 0 - } - ] -} - diff --git a/bbfd/test/api/json/usp.validation.json b/bbfd/test/api/json/usp.validation.json deleted file mode 100644 index 02e9d630..00000000 --- a/bbfd/test/api/json/usp.validation.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "object": "usp", - "methods": [ - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "object_names", - "args": { - "path": "Device.WiFi.SSID.1.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "instances", - "args": { - "path": "Device.Users.User.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "validate", - "args": { - "path": "Device.Users.User.1.Alias", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.WiFi.SSID.1.SSID", - "value": "test-2g" - }, - "rc": 0 - }, - { - "method": "operate", - "args": { - "path":"Device.IP.Diagnostics.", - "action":"IPPing()", - "input":{ - "Host":"127.0.0.1" - } - }, - "rc": 0 - }, - { - "method": "add_object", - "args": { - "path": "Device.Users.User.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "list_operate", - "args": {}, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "path":"Device.USB.", - "next-level":false, - "schema_type":1 - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "path":"Device.WiFi." - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "path":"Device.WiFi.", - "next-level":false, - "schema_type":2 - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "path":"Device.USB.", - "next-level":false, - "schema_type":3 - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "Path":"Device.WiFi.", - "schema_type":1 - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": {}, - "rc": 0 - } - ] -} - diff --git a/bbfd/test/cmocka/Makefile b/bbfd/test/cmocka/Makefile deleted file mode 100644 index 85d22c48..00000000 --- a/bbfd/test/cmocka/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -CC = gcc -USPD_LIB_DIR ?= $(shell dirname $(PWD)) -USPD_LIB = -luspd -L$(USPD_LIB_DIR) -CMOCKA_LIB = -l cmocka -LIBS = $(USPD_LIB) $(CMOCKA_LIB) -luci -pthread -lubus -lubox -ljson-c -lblobmsg_json -lbbfdm -lpthread -CFLAGS = -g -Wall -I../../src -LDFLAGS = $(LIBS) -Wl,-rpath=$(USPD_LIB_DIR) -I$(USPD_LIB_DIR) -UNIT_TESTS = unit_test_uspd - -VALGRIND = valgrind --leak-check=full --show-reachable=no \ - --show-leak-kinds=all --errors-for-leak-kinds=all \ - --error-exitcode=1 --track-origins=yes - -unit_test_uspd: unit_test_uspd.o - $(CC) -o $@ $^ $(LDFLAGS) - -unit-test: $(UNIT_TESTS) - $(foreach testprog, $(UNIT_TESTS), sudo $(VALGRIND) ./$(testprog);) - -.PHONY: clean -clean: - rm $(UNIT_TESTS) *.o -fv - diff --git a/bbfd/test/cmocka/test_utils.h b/bbfd/test/cmocka/test_utils.h deleted file mode 100644 index 07c19276..00000000 --- a/bbfd/test/cmocka/test_utils.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef TEST_UTILS_H -#define TEST_UTILS_H - -#define GET_PATH "Device.DeviceInfo.Manufacturer" -#define GET_PROTO "usp" -#define GET_RAW_PROTO "usp.raw" -#define GET_CWMP_PROTO "cwmp" - -#endif diff --git a/bbfd/test/cmocka/unit_test_uspd.c b/bbfd/test/cmocka/unit_test_uspd.c deleted file mode 100644 index 740a3bbb..00000000 --- a/bbfd/test/cmocka/unit_test_uspd.c +++ /dev/null @@ -1,980 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "usp.h" -#include "get_helper.h" -#include "test_utils.h" - -struct test_ctx { - struct usp_context uspctx; - struct blob_buf bb; - struct ubus_object usp; - struct ubus_object usp_raw; - FILE *fp; - struct ubus_request_data *req; - unsigned long instance; -}; - -// Stub functions to override existing functionalities -void ubus_complete_deferred_request(struct ubus_context *ctx, - struct ubus_request_data *req, int ret) -{ -} - -static int group_setup(void **state) -{ - struct test_ctx *ctx = calloc(1, sizeof(struct test_ctx)); - - if (!ctx) - return -1; - - openlog("unit_test", LOG_CONS| LOG_NDELAY, LOG_LOCAL1); - - memset(&ctx->uspctx, 0, sizeof(struct usp_context)); - - ubus_connect_ctx(&ctx->uspctx.ubus_ctx, NULL); - - INIT_LIST_HEAD(&ctx->uspctx.obj_list); - INIT_LIST_HEAD(&ctx->uspctx.instances); - INIT_LIST_HEAD(&ctx->uspctx.old_instances); - - usp_pre_init(&ctx->uspctx); - - remove("/tmp/test.log"); - ctx->usp.name = "usp"; - ctx->usp_raw.name = "usp.raw"; - memset(&ctx->bb, 0, sizeof(struct blob_buf)); - ctx->req = (struct ubus_request_data *) calloc(1, sizeof(struct ubus_request_data)); - *state = ctx; - - return 0; -} - -static int setup(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - - remove("/tmp/test.log"); - blob_buf_init(&ctx->bb, 0); - - return 0; -} - -static int group_teardown(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - - usp_cleanup(&ctx->uspctx); - blob_buf_free(&ctx->bb); - ubus_shutdown(&ctx->uspctx.ubus_ctx); - free(ctx->req); - free(ctx); - remove("/tmp/test.log"); - - return 0; -} - -static void test_api_usp_get_DeviceInfo_Manufacturer(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "DeviceInfo.Manufacturer"); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "get", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - //printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "fault", &tmp); - assert_string_equal(json_object_to_json_string(tmp), "7026"); - - json_object_put(jobj); - return; -} - -static void test_api_usp_raw_getm_values_Device_WiFi_SSID_Alias(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp_raw; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp; - struct json_object *local; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - void *paths; - paths = blobmsg_open_array(bb, "paths"); - blobmsg_add_string(bb, NULL, "Device.WiFi.SSID.1.Alias"); - blobmsg_close_array(bb, paths); - blobmsg_add_string(bb, "proto", GET_RAW_PROTO); - - usp_getm_values(uctx, obj, req, "getm_values", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "parameters", &tmp); - - if (json_object_get_type(tmp) == json_type_array) { - for (int i = 0; ibb; - struct ubus_object *obj = &ctx->usp_raw; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp; - struct json_object *local; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device.Users.User.1.Username"); - blobmsg_add_string(bb, "proto", GET_RAW_PROTO); - - usp_get_handler(uctx, obj, req, "validate", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "parameters", &tmp); - if (json_object_get_type(tmp) == json_type_array) { - for (int i = 0; ibb; - struct ubus_object *obj = &ctx->usp; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp; - struct json_object *local; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device.Users.User.1.Username"); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "validate", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "parameters", &tmp); - if (json_object_get_type(tmp) == json_type_array) { - for (int i = 0; ibb; - struct ubus_object *obj = &ctx->usp_raw; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp; - struct json_object *local; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - void *paths; - paths = blobmsg_open_array(bb, "paths"); - blobmsg_add_string(bb, NULL, "Device.WiFi.SSID.1.Alias"); - blobmsg_close_array(bb, paths); - blobmsg_add_string(bb, "proto", GET_RAW_PROTO); - - usp_getm_names(uctx, obj, req, "getm_names", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "parameters", &tmp); - - if (json_object_get_type(tmp) == json_type_array) { - for (int i = 0; iuspctx.ubus_ctx; - struct ubus_object *obj = &ctx->usp_raw; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj; - - usp_list_schema(ubus_ctx, obj, req, "dump_schema", NULL); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - //printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_put(jobj); - return; -} - -static void test_api_usp_list_operate(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct ubus_context *ubus_ctx = &ctx->uspctx.ubus_ctx; - struct ubus_object *obj = &ctx->usp; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj; - - usp_list_operate(ubus_ctx, obj, req, "list_operate", NULL); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - //printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_put(jobj); - return; -} - -static void test_api_usp_get_wrong_name_Device_IP_Interface(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path","Device.IP._Interface.1.Status"); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "get", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "fault", &tmp); - assert_string_equal(json_object_to_json_string(tmp), "7026"); - - json_object_put(jobj); - return; -} - -static void test_api_usp_get_wrong_braces_Device_IP_Interface(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path","Device.IP.Interface.{Type==\"Normal\"}.Status"); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "get", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "fault", &tmp); - assert_string_equal(json_object_to_json_string(tmp), "7026"); - - json_object_put(jobj); - return; -} - -static void test_api_usp_get_wrong_exp_Device_IP_Interface(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path","Device.IP.Interface.[Type==\"Normal\"&&IPv4Address.*.AddressingType==\"Static\"].Status"); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "get", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "fault", &tmp); - assert_string_equal(json_object_to_json_string(tmp), "7011"); - - json_object_put(jobj); - return; -} - -static void test_api_usp_get_Device_IP_Interface(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device.IP.Interface.[]."); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "get", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "fault", &tmp); - assert_string_equal(json_object_to_json_string(tmp), "7026"); - - json_object_put(jobj); - return; -} - -static void test_api_usp_get_search_exp_Device_WiFi_SSID(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp, *array_obj; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device.WiFi.SSID.[Status==\"Up\"].Alias"); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "get", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - array_obj = json_object_object_get(jobj, "SSID"); - if (json_object_get_type(array_obj) == json_type_array) { - for (int i = 0; ibb; - struct ubus_object *obj = &ctx->usp; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp, *array_obj; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device.WiFi.SSID.*.Alias"); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "get", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - array_obj = json_object_object_get(jobj, "SSID"); - - if (json_object_get_type(array_obj) == json_type_array) { - for (int i = 0; i < json_object_array_length(array_obj); ++i) { - char temp[512]; - struct json_object *array_index_obj = json_object_array_get_idx(array_obj, i); - - json_object_object_get_ex(array_index_obj, "Alias", &tmp); - snprintf(temp, 512, "cpe-%d", i+1); - assert_string_equal(json_object_get_string(tmp), temp); - } - } - - json_object_put(jobj); - return; -} - -static void test_api_usp_get_wrong_oper_Device_WiFi_SSID(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct ubus_request_data *req = ctx->req; - struct json_object *jobj, *tmp; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device.WiFi.SSID.[Status>Up].Alias"); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "get", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "fault", &tmp); - assert_string_equal(json_object_to_json_string(tmp), "7008"); - - json_object_put(jobj); - return; -} - - -static void test_api_usp_get_Device_DeviceInfo_Manufacturer(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct json_object *jobj, *tmp; - struct ubus_request_data *req = ctx->req; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", GET_PATH); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "get", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "Manufacturer", &tmp); - assert_string_equal(json_object_get_string(tmp), "iopsys"); - - json_object_put(jobj); - return; -} - -static void test_api_usp_add_object_Device_Users_User(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct json_object *jobj, *tmp, *array_index_obj, *array_obj; - struct ubus_request_data *req = ctx->req; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device.Users.User."); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_add_del_handler(uctx, obj, req, "add_object", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - array_obj = json_object_object_get(jobj, "parameters"); - array_index_obj = json_object_array_get_idx(array_obj, 0); - - tmp = json_object_object_get(array_index_obj, "parameter"); - assert_string_equal(json_object_get_string(tmp), "Device.Users.User."); - json_object_object_get_ex(array_index_obj, "status", &tmp); - assert_string_equal(json_object_get_string(tmp), "true"); - - tmp = NULL; - json_object_object_get_ex(array_index_obj, "instance", &tmp); - assert_non_null(tmp); - ctx->instance = strtoul(json_object_get_string(tmp), NULL, 10); - - assert_int_not_equal((int)ctx->instance, 0); - - json_object_put(jobj); - return; -} - -static void test_api_usp_del_Device_Users_User(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct json_object *jobj, *tmp, *array_obj, *array_index_obj; - struct ubus_request_data *req = ctx->req; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - assert_int_not_equal((int)ctx->instance, 0); - - char path[1024] = {0}; - snprintf(path, sizeof(path), "Device.Users.User.%lu.", ctx->instance); - blobmsg_add_string(bb, "path", path); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_add_del_handler(uctx, obj, req, "del_object", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - array_obj = json_object_object_get(jobj, "parameters"); - array_index_obj = json_object_array_get_idx(array_obj, 0); - - tmp = json_object_object_get(array_index_obj, "parameter"); - assert_string_equal(json_object_get_string(tmp), path); - - tmp = json_object_object_get(array_index_obj, "status"); - assert_string_equal(json_object_get_string(tmp), "true"); - - ctx->instance = 0; - - json_object_put(jobj); - return; -} - -static void test_api_usp_instances_Device_Users_User(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct json_object *jobj, *tmp, *array_obj, *array_index_obj; - struct ubus_request_data *req = ctx->req; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device.Users.User."); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "instances", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - - assert_non_null(jobj); - - array_obj = json_object_object_get(jobj, "parameters"); - array_index_obj = json_object_array_get_idx(array_obj, 0); - - tmp = json_object_object_get(array_index_obj, "parameter"); - - assert_string_equal(json_object_get_string(tmp), "Device.Users.User.1"); - - json_object_put(jobj); - return; -} - -static void test_api_usp_instances_Device(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct json_object *jobj, *array_obj, *array_index_obj; - struct ubus_request_data *req = ctx->req; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device."); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "instances", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - - assert_non_null(jobj); - - array_obj = json_object_object_get(jobj, "parameters"); - array_index_obj = json_object_array_get_idx(array_obj, 0); - assert_non_null(array_index_obj); - - json_object_put(jobj); - return; -} - -static void test_api_usp_set_Device_Users_User(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct json_object *jobj, *tmp; - struct ubus_request_data *req = ctx->req; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - assert_int_not_equal((int)ctx->instance, 0); - - char path[1024] = {0}; - snprintf(path, sizeof(path), "Device.Users.User.%lu.Username", ctx->instance); - blobmsg_add_string(bb, "path", path); - blobmsg_add_string(bb, "value", "user2"); - - usp_set(uctx, obj, req, "set", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - tmp = json_object_object_get(jobj, "status"); - assert_string_equal(json_object_get_string(tmp), "true"); - - json_object_put(jobj); - return; -} - -static void test_api_usp_object_name_Device_Users_User(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct json_object *jobj, *tmp, *array_obj, *array_index_obj; - struct ubus_request_data *req = ctx->req; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device.Users.User."); - blobmsg_add_string(bb, "proto", GET_PROTO); - blobmsg_add_u8(bb, "next-level", true); - - usp_get_handler(uctx, obj, req, "object_names", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - array_obj = json_object_object_get(jobj, "parameters"); - array_index_obj = json_object_array_get_idx(array_obj, 0); - - tmp = json_object_object_get(array_index_obj, "parameter"); - assert_string_equal(json_object_get_string(tmp), "Device.Users.User.1."); - - json_object_put(jobj); - return; -} - -static void test_api_usp_raw_get_Device_DeviceInfo_Manufacturer(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp_raw; - struct json_object *jobj, *tmp, *array_obj, *array_index_obj; - struct ubus_request_data *req = ctx->req; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", GET_PATH); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "get", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - array_obj = json_object_object_get(jobj, "parameters"); - array_index_obj = json_object_array_get_idx(array_obj, 0); - - tmp = json_object_object_get(array_index_obj, "parameter"); - - assert_string_equal(json_object_get_string(tmp), "Device.DeviceInfo.Manufacturer"); - - tmp = json_object_object_get(array_index_obj, "value"); - assert_string_equal(json_object_get_string(tmp), "iopsys"); - - json_object_put(jobj); - return; -} - - -static void test_api_usp_raw_add_object_Device_Users_User(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp_raw; - struct json_object *jobj, *tmp, *array_obj, *array_index_obj; - struct ubus_request_data *req = ctx->req; - int trans_id; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - trans_id = transaction_start("ut", 0); - blobmsg_add_string(bb, "path", "Device.Users.User."); - blobmsg_add_string(bb, "proto", GET_PROTO); - blobmsg_add_u32(bb, "transaction_id", trans_id); - usp_raw_add_del_handler(uctx, obj, req, "add_object", bb->head); - transaction_commit(trans_id, NULL, true); - - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - array_obj = json_object_object_get(jobj, "parameters"); - array_index_obj = json_object_array_get_idx(array_obj, 0); - - json_object_object_get_ex(array_index_obj, "status", &tmp); - assert_string_equal(json_object_get_string(tmp), "true"); - - tmp = NULL; - json_object_object_get_ex(array_index_obj, "instance", &tmp); - assert_non_null(tmp); - ctx->instance = strtoul(json_object_get_string(tmp), NULL, 10); - - assert_int_not_equal((int)ctx->instance, 0); - - json_object_put(jobj); - return; -} - - -static void test_api_usp_raw_del_Device_Users_User(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp_raw; - struct json_object *jobj, *tmp, *array_obj, *array_index_obj; - struct ubus_request_data *req = ctx->req; - int trans_id; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - assert_int_not_equal((int)ctx->instance, 0); - - char path[1024] = {0}; - snprintf(path, sizeof(path), "Device.Users.User.%lu.", ctx->instance); - - trans_id = transaction_start("ut", 0); - blobmsg_add_string(bb, "path", path); - blobmsg_add_string(bb, "proto", GET_PROTO); - blobmsg_add_u32(bb, "transaction_id", trans_id); - usp_raw_add_del_handler(uctx, obj, req, "del_object", bb->head); - transaction_commit(trans_id, NULL, true); - - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - array_obj = json_object_object_get(jobj, "parameters"); - array_index_obj = json_object_array_get_idx(array_obj, 0); - - tmp = json_object_object_get(array_index_obj, "parameter"); - assert_string_equal(json_object_get_string(tmp), path); - - tmp = json_object_object_get(array_index_obj, "status"); - assert_string_equal(json_object_get_string(tmp), "true"); - - ctx->instance = 0; - - json_object_put(jobj); - return; -} - -static void test_api_usp_raw_instances_Device_Users_User(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp_raw; - struct json_object *jobj, *tmp, *array_obj, *array_index_obj; - struct ubus_request_data *req = ctx->req; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device.Users.User."); - blobmsg_add_string(bb, "proto", GET_PROTO); - - usp_get_handler(uctx, obj, req, "instances", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - array_obj = json_object_object_get(jobj, "parameters"); - array_index_obj = json_object_array_get_idx(array_obj, 0); - - tmp = json_object_object_get(array_index_obj, "parameter"); - - assert_string_equal(json_object_get_string(tmp), "Device.Users.User.1"); - - json_object_put(jobj); - return; -} - -static void test_api_usp_raw_set_Device_Users_User(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp_raw; - struct json_object *jobj, *tmp; - struct ubus_request_data *req = ctx->req; - int trans_id; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - assert_int_not_equal((int)ctx->instance, 0); - - char path[1024] = {0}; - snprintf(path, sizeof(path), "Device.Users.User.%lu.Username", ctx->instance); - - trans_id = transaction_start("ut", 0); - blobmsg_add_string(bb, "path", path); - blobmsg_add_string(bb, "value", "user3"); - blobmsg_add_u32(bb, "transaction_id", trans_id); - usp_raw_set(uctx, obj, req, "set", bb->head); - transaction_commit(trans_id, NULL, true); - - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - tmp = json_object_object_get(jobj, "status"); - if (tmp == NULL) { - json_object_put(jobj); - } - assert_non_null(tmp); - assert_string_equal(json_object_get_string(tmp), "true"); - json_object_put(jobj); - - return; -} - -static void test_api_usp_raw_object_name_Device_Users_User(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp_raw; - struct json_object *jobj, *tmp, *array_obj, *array_index_obj; - struct ubus_request_data *req = ctx->req; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", "Device.Users.User."); - blobmsg_add_string(bb, "proto", GET_PROTO); - blobmsg_add_u8(bb, "next-level", true); - - usp_get_handler(uctx, obj, req, "object_names", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - array_obj = json_object_object_get(jobj, "parameters"); - array_index_obj = json_object_array_get_idx(array_obj, 0); - - tmp = json_object_object_get(array_index_obj, "parameter"); - assert_string_equal(json_object_get_string(tmp), "Device.Users.User.1."); - - json_object_put(jobj); - return; -} - -static void test_api_usp_get_cwmp_Device_DeviceInfo_Manufacturer(void **state) -{ - struct test_ctx *ctx = (struct test_ctx *) *state; - struct blob_buf *bb = &ctx->bb; - struct ubus_object *obj = &ctx->usp; - struct json_object *jobj, *tmp; - struct ubus_request_data *req = ctx->req; - struct ubus_context *uctx = &ctx->uspctx.ubus_ctx; - - blobmsg_add_string(bb, "path", GET_PATH); - blobmsg_add_string(bb, "proto", GET_CWMP_PROTO); - - usp_get_handler(uctx, obj, req, "get", bb->head); - jobj = json_object_from_file("/tmp/test.log"); - assert_non_null(jobj); - printf("json(%s)\n", json_object_to_json_string(jobj)); - - json_object_object_get_ex(jobj, "Manufacturer", &tmp); - assert_string_equal(json_object_get_string(tmp), "iopsys"); - - json_object_put(jobj); - return; -} - -// overriding this function -int ubus_send_event(struct ubus_context *ctx, const char *id, - struct blob_attr *data) -{ - char *str; - - str = blobmsg_format_json(data, true); - printf("{\"%s\": %s }", id, str); - - free(str); - - return 0; -} - - -int ubus_send_reply(struct ubus_context *ctx, struct ubus_request_data *req, - struct blob_attr *msg) -{ - char *str; - FILE *fp; - - fp = fopen("/tmp/test.log", "w"); - if (!fp) { - printf("failed to open file\n"); - return -1; - } - - if (!msg) { - fclose(fp); - return -1; - } - - str = blobmsg_format_json_indent(msg, true, -1); - fprintf(fp, "%s", str); - - fclose(fp); - free(str); - return 0; -} - -int main(void) -{ - const struct CMUnitTest tests[] = { - // usp object test cases - cmocka_unit_test_setup(test_api_usp_list_operate, setup), - cmocka_unit_test_setup(test_api_usp_get_Device_DeviceInfo_Manufacturer, setup), - cmocka_unit_test_setup(test_api_usp_get_Device_WiFi_SSID, setup), - cmocka_unit_test_setup(test_api_usp_get_search_exp_Device_WiFi_SSID, setup), - cmocka_unit_test_setup(test_api_usp_instances_Device_Users_User, setup), - cmocka_unit_test_setup(test_api_usp_instances_Device, setup), - cmocka_unit_test_setup(test_api_usp_resolve_Device_Users_User, setup), - cmocka_unit_test_setup(test_api_usp_add_object_Device_Users_User, setup), - cmocka_unit_test_setup(test_api_usp_set_Device_Users_User, setup), - cmocka_unit_test_setup(test_api_usp_del_Device_Users_User, setup), - cmocka_unit_test_setup(test_api_usp_object_name_Device_Users_User, setup), - // usp.raw object test cases - cmocka_unit_test_setup(test_api_usp_raw_dump_schema, setup), - cmocka_unit_test_setup(test_api_usp_raw_get_Device_DeviceInfo_Manufacturer, setup), - cmocka_unit_test_setup(test_api_usp_raw_getm_values_Device_WiFi_SSID_Alias, setup), - cmocka_unit_test_setup(test_api_usp_raw_getm_names_Device_WiFi_SSID_Alias, setup), - cmocka_unit_test_setup(test_api_usp_raw_instances_Device_Users_User, setup), - cmocka_unit_test_setup(test_api_usp_raw_resolve_Device_Users_User, setup), - cmocka_unit_test_setup(test_api_usp_raw_add_object_Device_Users_User, setup), - cmocka_unit_test_setup(test_api_usp_raw_set_Device_Users_User, setup), - cmocka_unit_test_setup(test_api_usp_raw_del_Device_Users_User, setup), - cmocka_unit_test_setup(test_api_usp_raw_object_name_Device_Users_User, setup), - cmocka_unit_test_setup(test_api_usp_get_cwmp_Device_DeviceInfo_Manufacturer, setup), - - // -ve scenerios - cmocka_unit_test_setup(test_api_usp_get_DeviceInfo_Manufacturer, setup), - cmocka_unit_test_setup(test_api_usp_get_wrong_oper_Device_WiFi_SSID, setup), - cmocka_unit_test_setup(test_api_usp_get_Device_IP_Interface, setup), - cmocka_unit_test_setup(test_api_usp_get_wrong_exp_Device_IP_Interface, setup), - cmocka_unit_test_setup(test_api_usp_get_wrong_braces_Device_IP_Interface, setup), - cmocka_unit_test_setup(test_api_usp_get_wrong_name_Device_IP_Interface, setup) - }; - - return cmocka_run_group_tests(tests, group_setup, group_teardown); -} - diff --git a/bbfd/test/files/etc/bbfdm/json/transferComplete.json b/bbfd/test/files/etc/bbfdm/json/transferComplete.json deleted file mode 100644 index 078cd9d7..00000000 --- a/bbfd/test/files/etc/bbfdm/json/transferComplete.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "Device.LocalAgent.": { - "type": "object", - "version": "2.12", - "protocols": [ - "usp" - ], - "access": false, - "array": false, - "TransferComplete!": { - "type": "event", - "version": "2.12", - "protocols": [ - "usp" - ], - "Command": { - "type": "string", - "read": true, - "write": true, - "version": "2.12", - "protocols": [ - "usp" - ], - "datatype": "string" - }, - "CommandKey": { - "type": "string", - "read": true, - "write": true, - "version": "2.12", - "protocols": [ - "usp" - ], - "datatype": "string" - }, - "Requestor": { - "type": "string", - "read": true, - "write": true, - "version": "2.12", - "protocols": [ - "usp" - ], - "datatype": "string" - }, - "TransferType": { - "type": "string", - "read": true, - "write": true, - "version": "2.12", - "protocols": [ - "usp" - ], - "datatype": "string", - "enumerations": [ - "Download", - "Upload" - ] - }, - "Affected": { - "type": "string", - "read": true, - "write": true, - "version": "2.12", - "protocols": [ - "usp" - ], - "datatype": "string" - }, - "TransferURL": { - "type": "string", - "read": true, - "write": true, - "version": "2.12", - "protocols": [ - "usp" - ], - "datatype": "URL", - "range": [ - { - "max": 2048 - } - ] - }, - "StartTime": { - "type": "dateTime", - "read": true, - "write": true, - "version": "2.12", - "protocols": [ - "usp" - ], - "datatype": "dateTime" - }, - "CompleteTime": { - "type": "dateTime", - "read": true, - "write": true, - "version": "2.12", - "protocols": [ - "usp" - ], - "datatype": "dateTime" - }, - "FaultCode": { - "type": "unsignedInt", - "read": true, - "write": true, - "version": "2.12", - "protocols": [ - "usp" - ], - "datatype": "unsignedInt" - }, - "FaultString": { - "type": "string", - "read": true, - "write": true, - "version": "2.12", - "protocols": [ - "usp" - ], - "datatype": "string", - "range": [ - { - "max": 256 - } - ] - } - } - } -} diff --git a/bbfd/test/files/etc/board-db/config/device b/bbfd/test/files/etc/board-db/config/device deleted file mode 100644 index 5c60ca11..00000000 --- a/bbfd/test/files/etc/board-db/config/device +++ /dev/null @@ -1,11 +0,0 @@ -config deviceinfo 'deviceinfo' - option Manufacturer 'iopsys' - option ProductClass 'FirstClass' - option SerialNumber '000000001' - option SoftwareVersion 'IOPSYS-CODE-ANALYSIS' - option HardwareVersion '1.0' - option DeviceCategory 'Gateway' - option ModelName 'ModelName' - option Description 'Iopsys code analysis test simulator' - option ManufacturerOUI 'XXX' - option BaseMACAddress 'feeddeadbeef' diff --git a/bbfd/test/files/etc/config/firewall b/bbfd/test/files/etc/config/firewall deleted file mode 100644 index edf85cd9..00000000 --- a/bbfd/test/files/etc/config/firewall +++ /dev/null @@ -1,185 +0,0 @@ - -config globals 'globals' - option enabled '1' - -config defaults - option syn_flood '1' - option input 'ACCEPT' - option output 'ACCEPT' - option forward 'REJECT' - -config zone - option name 'lan' - list network 'lan' - option input 'ACCEPT' - option output 'ACCEPT' - option forward 'ACCEPT' - -config zone - option name 'wan' - list network 'wan' - list network 'wan6' - option input 'REJECT' - option output 'ACCEPT' - option forward 'REJECT' - option masq '1' - option mtu_fix '1' - -config forwarding - option src 'lan' - option dest 'wan' - -config rule - option name 'Allow-DHCP-Renew' - option src 'wan' - option proto 'udp' - option dest_port '68' - option target 'ACCEPT' - option family 'ipv4' - -config rule - option name 'Allow-Ping' - option src 'wan' - option proto 'icmp' - option icmp_type 'echo-request' - option family 'ipv4' - option target 'ACCEPT' - -config rule - option name 'Allow-IGMP' - option src 'wan' - option proto 'igmp' - option family 'ipv4' - option target 'ACCEPT' - -config rule - option name 'Allow-DHCPv6' - option src 'wan' - option proto 'udp' - option src_ip 'fc00::/6' - option dest_ip 'fc00::/6' - option dest_port '546' - option family 'ipv6' - option target 'ACCEPT' - -config rule - option name 'Allow-MLD' - option src 'wan' - option proto 'icmp' - option src_ip 'fe80::/10' - list icmp_type '130/0' - list icmp_type '131/0' - list icmp_type '132/0' - list icmp_type '143/0' - option family 'ipv6' - option target 'ACCEPT' - -config rule - option name 'Allow-ICMPv6-Input' - option src 'wan' - option proto 'icmp' - list icmp_type 'echo-request' - list icmp_type 'echo-reply' - list icmp_type 'destination-unreachable' - list icmp_type 'packet-too-big' - list icmp_type 'time-exceeded' - list icmp_type 'bad-header' - list icmp_type 'unknown-header-type' - list icmp_type 'router-solicitation' - list icmp_type 'neighbour-solicitation' - list icmp_type 'router-advertisement' - list icmp_type 'neighbour-advertisement' - option limit '1000/sec' - option family 'ipv6' - option target 'ACCEPT' - -config rule - option name 'Allow-ICMPv6-Forward' - option src 'wan' - option dest '*' - option proto 'icmp' - list icmp_type 'echo-request' - list icmp_type 'echo-reply' - list icmp_type 'destination-unreachable' - list icmp_type 'packet-too-big' - list icmp_type 'time-exceeded' - list icmp_type 'bad-header' - list icmp_type 'unknown-header-type' - option limit '1000/sec' - option family 'ipv6' - option target 'ACCEPT' - -config rule - option name 'Allow-IPSec-ESP' - option src 'wan' - option dest 'lan' - option proto 'esp' - option target 'ACCEPT' - -config rule - option name 'Allow-ISAKMP' - option src 'wan' - option dest 'lan' - option dest_port '500' - option proto 'udp' - option target 'ACCEPT' - -config rule - option name 'Support-UDP-Traceroute' - option src 'wan' - option dest_port '33434:33689' - option proto 'udp' - option family 'ipv4' - option target 'REJECT' - option enabled 'false' - -config dmz 'dmz' - option enabled '0' - option exclude_ports '5060 7547' - -config include - option path '/etc/firewall.user' - option reload '1' - -config include 'ddos' - option path '/etc/firewall.ddos' - option reload '1' - -config include 'parental' - option path '/etc/firewall.parental' - option reload '1' - -config include 'qos' - option path '/etc/firewall.qos' - option reload '1' - -config include 'cwmp' - option path '/etc/firewall.cwmp' - option reload '1' - -config include 'miniupnpd' - option type 'script' - option path '/usr/share/miniupnpd/firewall.include' - option family 'any' - option reload '1' - -config include 'sip' - option path '/etc/firewall.sip' - option reload '1' - -config include 'dmzhost' - option path '/etc/firewall.dmz' - option reload '1' - -config redirect 'port_mapping_1' - option enabled '1' - option src 'wan' - option dest 'lan' - option target 'DNAT' - option reflection '1' - option name 'test' - option proto 'tcp' - option dest_ip 'wan' - option src_dport '192.168.3.45' - option src_dport '50:60' - option dest_port '44' diff --git a/bbfd/test/files/etc/config/network b/bbfd/test/files/etc/config/network deleted file mode 100644 index 732377fe..00000000 --- a/bbfd/test/files/etc/config/network +++ /dev/null @@ -1,123 +0,0 @@ -config interface 'loopback' - option device 'lo' - option proto 'static' - option ipaddr '127.0.0.1' - option netmask '255.0.0.0' - -config globals 'globals' - option ula_prefix 'fddb:7949:7caa::/48' - -config device - option name 'br-lan' - option type 'bridge' - list ports 'eth1' - list ports 'eth2' - list ports 'eth3' - list ports 'eth4' - option macaddr '44:D4:37:71:B8:11' - -config interface 'lan' - option device 'br-lan' - option proto 'static' - option ipaddr '192.168.1.1' - option netmask '255.255.255.0' - option ip6assign '60' - option is_lan '1' - option macaddr '44:D4:37:71:B8:11' - -config interface 'wan' - option proto 'dhcp' - option hostname 'iopsysWrt-44D43771B810' - option vendorid 'eg400' - option device 'eth0.1' - option reqopts '12 43' - option sendopts '60:iopsystest 61:iopsys' - option macaddr '44:D4:37:71:B8:12' - -config interface 'wan6' - option proto 'dhcpv6' - option device '@wan' - -config device 'ethwan' - option type 'untagged' - option ifname 'eth0' - option name 'eth0.1' - option macaddr '44:D4:37:71:B8:12' - -config device 'br_test_1' - option name 'br-test' - option type 'bridge' - list ports 'eth1.100' - list ports 'eth2.100' - list ports 'eth3.100' - list ports 'eth4.100' - option macaddr '44:D4:37:71:B8:13' - -config interface 'lan100' - option device 'br-test' - option proto 'static' - option ipaddr '172.32.1.1' - option macaddr '44:D4:37:71:B8:13' - -config device 'eth1_100' - option type 'untagged' - option ifname 'eth1' - option name 'eth1.100' - option vid '100' - -config device 'eth2_100' - option type 'untagged' - option ifname 'eth2' - option name 'eth2.100' - option vid '100' - -config device 'eth3_100' - option type '8021q' - option ifname 'eth3' - option name 'eth3.100' - option vid '100' - -config device 'eth4_100' - option type '8021q' - option ifname 'eth4' - option name 'eth4.100' - option vid '100' - -config interface 'ppp_wan' - option type 'anywan' - option proto 'pppoe' - option username 'iopsyshome@iopsys.eu' - option password 'iopsys' - option device 'eth0.1' - option ipv6 '1' - option macaddr '44:D4:37:71:B8:14' - -config route 'route4' - option interface 'wan' - option target '0.0.0.0/0' - option gateway '10.72.197.110' - -config route6 'route6' - option interface 'wan6' - option target '::/0' - -config interface 'stabridge' - option proto 'relay' - option network 'lan wan' - -config interface 'mygre' - option ipaddr '10.1.1.1' - option peeraddr '10.2.2.1' - option proto 'gre' - -config interface 'mygre_static' - option proto 'static' - option device '@mygre' - option ipaddr '172.16.12.1' - option netmask '255.255.255.252' - -config route 'tunnel' - option interface 'mygre_static' - option target '172.16.2.0' - option netmask '255.255.255.0' - option gateway '172.16.12.2' diff --git a/bbfd/test/files/etc/config/users b/bbfd/test/files/etc/config/users deleted file mode 100644 index ca728026..00000000 --- a/bbfd/test/files/etc/config/users +++ /dev/null @@ -1,7 +0,0 @@ - -config user 'user' - option enabled '1' - option remote_access '1' - list _access_w 'admin' - list _access_w 'support' - list _access_w 'user' diff --git a/bbfd/test/files/etc/config/uspd b/bbfd/test/files/etc/config/uspd deleted file mode 100644 index 2cf09c81..00000000 --- a/bbfd/test/files/etc/config/uspd +++ /dev/null @@ -1,6 +0,0 @@ -config uspd 'usp' - option granularitylevel '0' - option debug '1' - option loglevel '2' - option subprocess_level '1' - option refresh_time '0' diff --git a/bbfd/test/files/etc/config/wireless b/bbfd/test/files/etc/config/wireless deleted file mode 100644 index 1937ae7f..00000000 --- a/bbfd/test/files/etc/config/wireless +++ /dev/null @@ -1,56 +0,0 @@ -config wifi-device 'test1' - option type 'mac80211' - option channel '36' - option hwmode '11a' - option country 'DE' - option htmode 'HE80' - option apsta '0' - option phy 'phy0' - -config wifi-iface 'no_mp_test1' - option device 'test1' - option network 'lan' - option mode 'ap' - option ifname 'test1' - option encryption 'psk2' - option wps_pushbutton '1' - option ieee80211k '1' - option ieee80211v '1' - option bss_transition '1' - option ssid 'NON-MULTI-AP-TEST' - -config wifi-iface 'default_test1' - option device 'test1' - option network 'lan' - option mode 'ap' - option ifname 'test1' - option ssid 'MAP-44D43771B810-BH-5GHz' - option encryption 'psk2' - option wps_pushbutton '1' - option ieee80211k '1' - option ieee80211v '1' - option bss_transition '1' - option multi_ap '3' - -config wifi-device 'test2' - option type 'mac80211' - option channel '11' - option hwmode '11g' - option country 'DE' - option htmode 'HE20' - option apsta '0' - option phy 'phy1' - -config wifi-iface 'default_test2' - option device 'test2' - option network 'lan' - option mode 'ap' - option ifname 'test2' - option ssid 'iopsysWrt-44D43771B810' - option encryption 'psk2' - option key 'MPUEO3L7WHJ45P' - option wps_pushbutton '1' - option ieee80211k '1' - option ieee80211v '1' - option bss_transition '1' - option multi_ap '2' diff --git a/bbfd/test/files/etc/init.d/uspd b/bbfd/test/files/etc/init.d/uspd deleted file mode 100755 index 2f788976..00000000 --- a/bbfd/test/files/etc/init.d/uspd +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=94 -STOP=10 - -USE_PROCD=1 -PROG=/usr/sbin/uspd - -start_service() { - procd_open_instance - procd_set_param command ${PROG} - procd_set_param respawn - procd_close_instance -} - -reload_service() { - stop - start -} - -service_triggers() -{ - procd_add_reload_trigger "cwmp" - procd_add_config_trigger "config.change" "uspd" /etc/init.d/uspd restart -} diff --git a/bbfd/test/funl/json/gran/gran.validation.json b/bbfd/test/funl/json/gran/gran.validation.json deleted file mode 100644 index 7083b195..00000000 --- a/bbfd/test/funl/json/gran/gran.validation.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "object": "usp.Device.", - "methods": [ - { - "method": "get", - "args": { - "path": "Users." - }, - "rc": 0 - } - ] -} - diff --git a/bbfd/test/funl/json/usp.raw.validation.json b/bbfd/test/funl/json/usp.raw.validation.json deleted file mode 100644 index 1efa913b..00000000 --- a/bbfd/test/funl/json/usp.raw.validation.json +++ /dev/null @@ -1,350 +0,0 @@ -{ - "object": "usp.raw", - "methods": [ - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "cwmp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Users.User.*.Alias", - "proto": "cwmp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "both" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp", - "maxdepth": "1" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp", - "maxdepth": "1", - "next-level": true - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers#1+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Users.User.*.Alias" - }, - "rc": 0 - }, - - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers#*+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Status==\"Up\"].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[SSID==\"test-2g\"&&Status==\"Up\"].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[SSID==\"test-2g\"&&Stats.PacketsSent>0].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[BytesSent>0].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Enable==true].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Enable!=true].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.[Enable==0].Device." - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.*.Device." - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort==68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort!=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort>68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort<68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort>=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort<=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order==1].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order!=1].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order>8].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order>=8].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order<2].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order<=2].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.AccessPoint.[SSIDReference+.Alias==\"cpe-1\"].AssociatedDeviceNumberOfEntries" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.AccessPoint.[SSIDReference#1+.Alias==\"cpe-1\"].WPS.ConfigMethodsSupported" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.[Enable==0].Device." - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.*.Device." - }, - "rc": 0 - }, - { - "method": "hello", - "rc": 3 - }, - { - "method": "instances", - "args": { - "path": "Device.Users.User.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.WiFi.SSID.1.SSID", - "value": "test-2g", - "transaction_id": 123 - }, - "rc": 0 - }, - { - "method": "object_names", - "args": { - "path": "Device.WiFi.SSID.1.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "operate", - "args": { - "path":"Device.IP.Diagnostics.", - "action":"IPPing()", - "input":{ - "Host":"iopsys.eu" - } - }, - "rc": 0 - }, - { - "method": "dump_schema", - "args": {}, - "rc": 0 - }, - { - "method": "list_operate", - "args": {}, - "rc": 0 - }, - { - "method": "transaction_commit", - "args": { - "transaction_id": 123 - }, - "rc": 0 - }, - { - "method": "transaction_abort", - "args": { - "transaction_id": 123 - }, - "rc": 0 - }, - { - "method": "getm_names", - "args": { - "paths": ["Device.WiFi.SSID.1.SSID","Device.WiFi.SSID.2.SSID"], - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "setm_values", - "args": { - "pv_tuple": [{"path":"Device.Users.User.1.Alias", "value":"cpe-1"}, {"path":"Device.Users.User.2.Alias", "value":"cpe-2"}], - "proto": "usp", - "transaction_id": 123 - }, - "rc": 0 - }, - ] -} - diff --git a/bbfd/test/funl/json/usp.validation.json b/bbfd/test/funl/json/usp.validation.json deleted file mode 100644 index 41124d42..00000000 --- a/bbfd/test/funl/json/usp.validation.json +++ /dev/null @@ -1,463 +0,0 @@ -{ - "object": "usp", - "methods": [ - { - "method": "list_operate", - "args": {}, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "cwmp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Users.User.*.Alias", - "proto": "cwmp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "both" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp", - "maxdepth": "1" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp", - "maxdepth": "1", - "next-level": true - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers#1+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Users.User.*.Alias" - }, - "rc": 0 - }, - - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers#*+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.IP.Interface.*.IPv4Address.*.AddressingType" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Status==\"Up\"].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[SSID==\"test-2g\"&&Status==\"Up\"].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[SSID==\"test-2g\"&&Stats.PacketsSent>0].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[BytesSent>0].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Enable==true].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Enable!=true].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.[Enable==0].Device." - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.*.Device." - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort==68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort!=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort>68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort<68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort>=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort<=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order==1].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order!=1].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order>8].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order>=8].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order<2].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order<=2].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Status>\"Up\"].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.{Status==\"Up\"}.Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.AccessPoint.[SSIDReference+.Alias==\"cpe-1\"].AssociatedDeviceNumberOfEntries" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.AccessPoint.[SSIDReference#1+.Alias==\"cpe-1\"].WPS.ConfigMethodsSupported" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.AccessPoint.[SSIDReference#*+.Alias==\"cpe-1\"].WPS.ConfigMethodsSupported" - }, - "rc": 0 - }, - { - "method": "object_names", - "args": { - "path": "Device.WiFi.SSID.1.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "object_names", - "args": { - "path": "Device.WiFi.SSID.1.Stats.", - "proto": "usp" - }, - "rc": 0 - }, - - { - "method": "instances", - "args": { - "path": "Device.Users.User.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "instances", - "args": { - "path": "Device.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "instances", - "args": { - "path": "Device.Users.User.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "validate", - "args": { - "path": "Device.Users.User.1.Alias", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "validate", - "args": { - "path": "Device.Users.User.1.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "validate", - "args": { - "path": "Device.Users.User.*.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.WiFi.SSID.1.SSID", - "value": "test-1g" - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.Users.User.1.", - "values": {"username":"funl-test", "password":"ft1234"} - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.Firewall.Chain.1.Rule.1.", - "values": {"DestPortRangeMax":"5"} - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.Firewall.Chain.1.Rule.1.", - "values": {"Order":"7"} - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.Firewall.Chain.1.Rule.1.", - "values": {"DestPortRangeMax":5} - }, - "rc": 0 - }, - { - "method": "operate", - "args": { - "path":"Device.IP.Diagnostics.", - "action":"IPPing()", - "input":{ - "Host":"iopsys.eu" - } - }, - "rc": 0 - }, - { - "method": "operate", - "args": { - "path":"Device.IP.Diagnostics.", - "action":"IPPing()", - "input":{ - "Host":"iopsys.eu", - "Host":"localhost" - } - }, - "rc": 0 - }, - { - "method": "operate", - "args": { - "path":"Device.WiFi.SSID.1.", - "action":"NeighboringWiFiDiagnostic()" - }, - "rc": 0 - }, - { - "method": "operate", - "args": { - "path":"Device.WiFi", - "action":"" - }, - "rc": 0 - }, - { - "method": "add_object", - "args": { - "path": "Device.Users.User.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "del_object", - "args": { - "path": "Device.Users.User.[Username>admin].", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "del_object", - "args": { - "path": "Device.Users.User.2.", - "proto": "usp" - }, - "rc": 0 - } - ] -} - diff --git a/bbfd/test/funl/schema/usp.raw_test_negative.json b/bbfd/test/funl/schema/usp.raw_test_negative.json deleted file mode 100644 index df34d8b3..00000000 --- a/bbfd/test/funl/schema/usp.raw_test_negative.json +++ /dev/null @@ -1,1183 +0,0 @@ -{ - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": [ - "Device.", - "Device.DeviceInfo.Manufacturer", - "Device.WiFi.SSID.1.", - "Device.WiFi." - ] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://dev.iopsys.eu/iopsys/uspd/-/blob/devel/docs/api/usp.raw.md", - "type": "object", - "title": "usp.raw", - "object": "usp.raw", - "additionalProperties": false, - "properties": { - "get_supported_dm": { - "title": "Get list of supported datamodel parameters", - "description": "Schema will have all the nodes/objects supported by libbbf", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "schema_type": { - "type": "integer", - "minimum": 0, - "maximum": 3, - "description": "0-All, 1-Parameter only 2- Event only 3- operate only" - } - } - }, - "output": { - "required": [ - "fault" - ], - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - }, - "dump_schema": { - "title": "Get available datamodel schema from Device", - "description": "Schema will have all the nodes/objects supported by data model", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "unique_keys": { - "type": "array", - "uniqueItems": true, - "maxItems": 8, - "items": [ - { - "type": "string" - } - ] - } - }, - "required": [ - "parameter", - "writable", - "type" - ] - }, - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - } - }, - "required": [ - "parameter", - "writable", - "type" - ] - } - ] - } - }, - "required": [ - "parameters" - ] - } - } - }, - "list_operate": { - "title": "List down supported usp operate commands", - "description": "Commands will be shown in schema format", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/operate_path_t" - }, - "type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - }, - "out": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - } - } - ] - } - } - } - } - }, - "list_events": { - "title": "List down supported usp events", - "description": "events will be shown in schema format", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/operate_path_t" - }, - "type": { - "type": "string", - "pattern": "xsd:event" - }, - "in": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - } - } - ] - } - } - } - } - }, - "get": { - "title": "Get handler", - "description": "Query the datamodel object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "required": [ - "fault" - ], - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - }, - "getm_values": { - "title": "Get multiple values", - "description": "Query multiple paths at once", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "paths" - ], - "properties": { - "paths": { - "type": "array", - "items": [ - { - "$ref": "#/definitions/path_t" - } - ] - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "required": [ - "parameters" - ], - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "fault" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - } - }, - "getm_names": { - "title": "Get multiple object names", - "description": "Query multiple object names at once", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "paths" - ], - "properties": { - "paths": { - "type": "array", - "items": [ - { - "$ref": "#/definitions/path_t" - } - ] - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - - "items": [ - { - "type": "object", - "required": [ - "parameter", - "fault" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - } - }, - "instances": { - "title": "Instance query handler", - "description": "Get the instances of multi object", - "type": "object", - "required": [ - "input" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - }, - "validate": { - "title": "Validate a datamodel path", - "description": "Validate a path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - }, - "object_names": { - "title": "Get objects names", - "description": "Get names of all the objects below input object path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "required": [ - "fault" - ], - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - }, - "add_object": { - "title": "Add a new object instance", - "description": "Add a new object in multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "transaction_id" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "status" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - }, - "instance": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "del_object": { - "title": "Delete object instance", - "description": "Delete a object instance from multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "transaction_id" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "status" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - } - }, - "set": { - "title": "Set handler", - "description": "Set values of datamodel object element", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "value", - "transaction_id" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "value": { - "type": "string" - }, - "values": { - "type": "object", - "properties": {} - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - } - } - }, - "output": { - "oneof": [ - { - "type": "object", - "properties": { - "status": { - "const": "1" - } - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - ] - } - } - }, - "operate": { - "title": "Operate handler", - "description": "Operate on object element provided in path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "action" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "action": { - "type": "string", - }, - "input": { - "type": "object", - "properties": {} - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "required":[ - "fault" - ], - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - }, - "transaction_start": { - "title": "Start a transaction before set/add/del operations", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "app": { - "type": "string" - } - }, - "required": [ - "app" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "error": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "transaction_abort": { - "title": "Aborts an on-going transaction", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "transaction_id": { - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "transaction_id" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - }, - "error": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "transaction_commit": { - "title": "Commits an on-going transaction", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "restart_services": { - "type": "boolean" - } - }, - "required": [ - "transaction_id" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - }, - "error": { - "type": "string" - }, - "updated_services": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "transaction_status": { - "title": "Shows status of a transaction", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "transaction_id": { - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "transaction_id" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "string", - "description": "on-going or not-exists" - }, - "remaining_time": { - "type": "integer" - }, - "app": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "setm_values": { - "title": "Set values of multiple objects at once", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "pv_tuple", - "transaction_id" - ], - "properties": { - "pv_tuple": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "path", - "value" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - } - } - } - ] - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - }, - "transaction_id": { - "type": "integer", - "minimum": 0 - } - } - }, - "output": { - "type": "object", - "oneof": [ - { - "required": [ - "status" - ] - }, - { - "required": [ - "parameters" - ] - } - ], - "properties": { - "status": { - "type": "boolean" - }, - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - } - }, - "notify_event": { - "title": "notify occurance of an event on ubus", - "type": "object", - "required": [ - "input" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "input": { - "type": "string" - } - } - }, - "output": {} - } - } - } -} diff --git a/bbfd/test/funl/schema/usp.raw_test_positive.json b/bbfd/test/funl/schema/usp.raw_test_positive.json deleted file mode 100644 index adf51e5f..00000000 --- a/bbfd/test/funl/schema/usp.raw_test_positive.json +++ /dev/null @@ -1,1383 +0,0 @@ -{ - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": [ - "Device.", - "Device.DeviceInfo.Manufacturer", - "Device.WiFi.SSID.1.", - "Device.WiFi." - ] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://dev.iopsys.eu/iopsys/uspd/-/blob/devel/docs/api/usp.raw.md", - "type": "object", - "title": "usp.raw", - "object": "usp.raw", - "additionalProperties": false, - "properties": { - "get_supported_dm": { - "title": "Get list of supported datamodel parameters", - "description": "Schema will have all the nodes/objects supported by libbbf", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "schema_type": { - "type": "integer", - "minimum": 0, - "maximum": 3, - "description": "0-All, 1-Parameter only 2- Event only 3- operate only" - } - } - }, - "output": { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "cmd_type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - }, - "out": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - } - }, - "required": [ - "parameter", - "type" - ] - } - ] - } - } - } - } - }, - "dump_schema": { - "title": "Get available datamodel schema from Device", - "description": "Schema will have all the nodes/objects supported by data model", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "unique_keys": { - "type": "array", - "uniqueItems": true, - "maxItems": 8, - "items": [ - { - "type": "string" - } - ] - } - }, - "required": [ - "parameter", - "writable", - "type" - ] - }, - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - } - }, - "required": [ - "parameter", - "writable", - "type" - ] - } - ] - } - }, - "required": [ - "parameters" - ] - } - } - }, - "list_operate": { - "title": "List down supported usp operate commands", - "description": "Commands will be shown in schema format", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/operate_path_t" - }, - "type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - }, - "out": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - } - } - ] - } - } - } - } - }, - "list_events": { - "title": "List down supported usp events", - "description": "events will be shown in schema format", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/operate_path_t" - }, - "type": { - "type": "string", - "pattern": "xsd:event" - }, - "in": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - } - } - ] - } - } - } - } - }, - "get": { - "title": "Get handler", - "description": "Query the datamodel object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "value", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ] - } - } - } - } - }, - "getm_values": { - "title": "Get multiple values", - "description": "Query multiple paths at once", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "paths" - ], - "properties": { - "paths": { - "type": "array", - "items": [ - { - "$ref": "#/definitions/path_t" - } - ] - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ] - } - } - } - } - }, - "getm_names": { - "title": "Get multiple object names", - "description": "Query multiple object names at once", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "paths" - ], - "properties": { - "paths": { - "type": "array", - "items": [ - { - "$ref": "#/definitions/path_t" - } - ] - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "value", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ] - } - } - } - } - }, - "instances": { - "title": "Instance query handler", - "description": "Get the instances of multi object", - "type": "object", - "required": [ - "input" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "required": [ - "parameter" - ], - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/instance_t" - } - } - } - ] - } - } - } - } - }, - "validate": { - "title": "Validate a datamodel path", - "description": "Validate a path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "$ref": "#/definitions/path_t" - } - } - } - } - }, - "object_names": { - "title": "Get objects names", - "description": "Get names of all the objects below input object path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "writable", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "writable": { - "type": "string", - "description": "1 if object is writable, 0 otherwise" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ] - } - } - } - } - }, - "add_object": { - "title": "Add a new object instance", - "description": "Add a new object in multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "transaction_id" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "status" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - }, - "instance": { - "type": "string" - } - } - } - ] - } - } - } - ] - } - } - }, - "del_object": { - "title": "Delete object instance", - "description": "Delete a object instance from multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "transaction_id" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "status" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - ] - } - } - }, - "set": { - "title": "Set handler", - "description": "Set values of datamodel object element", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "value", - "transaction_id" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "value": { - "description": "value of the object element provided in path, path should contains valid writable object element", - "type": "string", - "examples": [ - "{\"path\":\"Device.WiFi.SSID.1.SSID\", \"value\":\"test_ssid\"}", - "{\"path\":\"Device.WiFi.SSID.2.Enable\", \"value\":\"true\"}", - "{\"path\":\"Device.WiFi.SSID.1.Enable\", \"value\":\"0\"}" - ] - }, - "values": { - "description": "To set multiple values at once, path should be relative to object elements", - "examples": [ - "{\"path\":\"Device.WiFi.SSID.1\", \"values\":{\".SSID\":\"test_ssid\",\".Name\":\"test_name\"}}", - "{\"path\":\"Device.WiFi.SSID.2\", \"values\":{\".SSID\":\"test_ssid\"}}" - ], - "type": "object", - "properties": {} - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - } - } - }, - "output": { - "oneof": [ - { - "type": "object", - "properties": { - "status": { - "const": "1" - } - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - ] - } - } - }, - "operate": { - "title": "Operate handler", - "description": "Operate on object element provided in path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "action" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "action": { - "description": "Opreate command as defined in TR-369, TR-181-2.13", - "type": "string", - "examples": [ - "{\"path\":\"Device.WiFi.\", \"action\":\"Reset\\(\\)\"}" - ] - }, - "input": { - "description": "Input arguments for the operate command as defined in TR-181-2.13", - "examples": [ - "{\"path\":\"Device.IP.Diagnostics\", \"action\":\"IPPing\\(\\)\", \"input\":{\"Host\":\"iopsys.eu\"}}" - ], - "type": "object", - "properties": {} - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "Results" - ], - "properties": { - "Results": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "parameters": { - "description": "Output will have status for sync commands and for async commands parameters as defined in TR-181-2.13", - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "type": "string" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ], - "examples": [ - "{\n\t\"status\": true}", - "{\n\t\"AverageResponseTime\": \"0\",\n\t\"AverageResponseTimeDetailed\": \"130\",\n\t\"FailureCount\": \"0\",\n\t\"MaximumResponseTime\": \"0\",\n\t\"MaximumResponseTimeDetailed\": \"140\",\n\t\"MinimumResponseTime\": \"0\",\n\t\"MinimumResponseTimeDetailed\": \"120\",\n\t\"SuccessCount\": \"3\"}" - ] - } - } - } - ] - } - } - } - } - }, - "transaction_start": { - "title": "Start a transaction before set/add/del operations", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "app": { - "type": "string" - } - }, - "required": [ - "app" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - }, - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "error": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "transaction_abort": { - "title": "Aborts an on-going transaction", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "transaction_id": { - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "transaction_id" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - }, - "error": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "transaction_commit": { - "title": "Commits an on-going transaction", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "transaction_id": { - "type": "integer", - "minimum": 1 - }, - "restart_services": { - "type": "boolean" - } - }, - "required": [ - "transaction_id" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - }, - "error": { - "type": "string" - }, - "updated_services": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "transaction_status": { - "title": "Shows status of a transaction", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": { - "transaction_id": { - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "transaction_id" - ] - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "string", - "description": "on-going or not-exists" - }, - "remaining_time": { - "type": "integer" - }, - "app": { - "type": "string" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "input", - "output" - ] - }, - "setm_values": { - "title": "Set values of multiple objects at once", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "pv_tuple", - "transaction_id" - ], - "properties": { - "pv_tuple": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "path", - "value" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - } - } - ] - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - }, - "transaction_id": { - "type": "integer", - "minimum": 0 - } - } - }, - "output": { - "type": "object", - "oneof": [ - { - "required": [ - "status" - ] - }, - { - "required": [ - "parameters" - ] - } - ], - "properties": { - "status": { - "type": "boolean" - }, - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - } - }, - "notify_event": { - "title": "notify occurance of an event on ubus", - "type": "object", - "required": [ - "input" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "input": { - "type": "string" - } - } - }, - "output": {} - } - } - } -} diff --git a/bbfd/test/funl/schema/usp_test_negative.json b/bbfd/test/funl/schema/usp_test_negative.json deleted file mode 100644 index 47eb0261..00000000 --- a/bbfd/test/funl/schema/usp_test_negative.json +++ /dev/null @@ -1,338 +0,0 @@ -{ - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": [ - "Device.", - "Device.DeviceInfo.Manufacturer", - "Device.WiFi.SSID.1.", - "Device.WiFi." - ] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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 - } - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://dev.iopsys.eu/iopsys/uspd/-/blob/devel/docs/api/usp.md", - "type": "object", - "title": "usp", - "object": "usp", - "additionalProperties": false, - "properties": { - "get": { - "title": "Get handler", - "description": "Query the datamodel object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "required": [ - "fault" - ], - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - }, - "set": { - "title": "Set handler", - "description": "Set values of datamodel object element", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "value": { - "type": "string" - }, - "values": { - "type": "object", - "properties": {} - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "required": [ - "parameter", - "fault" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean", - "const": false - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - } - } - } - } - }, - "add_object": { - "title": "Add a new object instance", - "description": "Add a new object in multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "required": [ - "parameter", - "status", - "fault" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - } - } - } - } - }, - "del_object": { - "title": "Delete object instance", - "description": "Delete a object instance from multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "required": [ - "parameter", - "fault" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - } - } - } - } - } - } -} diff --git a/bbfd/test/funl/schema/usp_test_positive.json b/bbfd/test/funl/schema/usp_test_positive.json deleted file mode 100644 index 5f87794c..00000000 --- a/bbfd/test/funl/schema/usp_test_positive.json +++ /dev/null @@ -1,315 +0,0 @@ -{ - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": [ - "Device.", - "Device.DeviceInfo.Manufacturer", - "Device.WiFi.SSID.1.", - "Device.WiFi." - ] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "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": 1024, - "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 - } - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://dev.iopsys.eu/iopsys/uspd/-/blob/devel/docs/api/usp.md", - "type": "object", - "title": "usp", - "object": "usp", - "additionalProperties": false, - "properties": { - "get": { - "title": "Get handler", - "description": "Query the datamodel object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "maxdepth": { - "type": "integer", - "description": "Integer to decide the depth of data model to be parsed" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "instance-mode": { - "type": "integer", - "description": "" - } - } - }, - "output": { - "type": "object", - "properties": {} - } - } - }, - "set": { - "title": "Set handler", - "description": "Set values of datamodel object element", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "value" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "value": { - "type": "string" - }, - "values": { - "description": "To set multiple values at once, path should be relative to object elements", - "type": "object", - "properties": {} - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "status" - ], - "properties": { - "status": { - "const": true - } - } - } - } - }, - "add_object": { - "title": "Add a new object instance", - "description": "Add a new object in multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "required": [ - "parameter", - "status", - "instance" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "instance": { - "type": "string" - } - } - } - } - } - } - } - }, - "del_object": { - "title": "Delete object instance", - "description": "Delete a object instance from multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/query_path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "instance_mode": { - "type": "integer", - "minimum": 0, - "maximum": 1 - } - } - }, - "output": { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": { - "type": "object", - "required": [ - "parameter", - "status" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean", - "const": true - } - } - } - } - } - } - } - } - } -} diff --git a/bbfd/test/funl/validation/usp.raw.validation.negative.json b/bbfd/test/funl/validation/usp.raw.validation.negative.json deleted file mode 100644 index bc501c7e..00000000 --- a/bbfd/test/funl/validation/usp.raw.validation.negative.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "object": "usp.raw", - "methods": [ - { - "method": "get", - "args": { - "path": "Device.DeviceInfo", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.InvalidPath", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "path": "Device.DeviceInfo.InvalidPath", - }, - "rc": 0 - }, - { - "method": "instances", - "args": { - "path": "Device.Users.InvalidUser.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "operate", - "args": { - "path":"Device.IP.Diagnostics.InvalidPath", - "action":"IPPing()", - "input":{ - "Host":"iopsys.eu" - } - }, - "rc": 0 - }, - { - "method": "getm_names", - "args": { - "paths": ["Device.WiFi.SSID.1.Invalid","Device.WiFi.SSID.2.Invalid"], - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "object_names", - "args": { - "path": "Device.WiFi.SSID.1.Invalid", - "proto": "usp" - }, - "rc": 0 - } - ] -} - diff --git a/bbfd/test/funl/validation/usp.raw.validation.positive.json b/bbfd/test/funl/validation/usp.raw.validation.positive.json deleted file mode 100644 index 09a1548f..00000000 --- a/bbfd/test/funl/validation/usp.raw.validation.positive.json +++ /dev/null @@ -1,368 +0,0 @@ -{ - "object": "usp.raw", - "methods": [ - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "cwmp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Users.User.*.Alias", - "proto": "cwmp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "both" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp", - "maxdepth": "1" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp", - "maxdepth": "1", - "next-level": true - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers#1+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Users.User.*.Alias" - }, - "rc": 0 - }, - - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers#*+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Status==\"Up\"].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[SSID==\"test-2g\"&&Status==\"Up\"].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[SSID==\"test-2g\"&&Stats.PacketsSent>0].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[BytesSent>0].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Enable==true].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Enable!=true].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.[Enable==0].Device." - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.*.Device." - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort==68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort!=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort>68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort<68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort>=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort<=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order==1].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order!=1].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order>8].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order>=8].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order<2].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order<=2].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.AccessPoint.[SSIDReference+.Alias==\"cpe-1\"].AssociatedDeviceNumberOfEntries" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.AccessPoint.[SSIDReference#1+.Alias==\"cpe-1\"].WPS.ConfigMethodsSupported" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.[Enable==0].Device." - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.*.Device." - }, - "rc": 0 - }, - { - "method": "hello", - "rc": 3 - }, - { - "method": "instances", - "args": { - "path": "Device.Users.User.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.WiFi.SSID.1.SSID", - "value": "test-2g", - "transaction_id": 123 - }, - "rc": 0 - }, - { - "method": "object_names", - "args": { - "path": "Device.WiFi.SSID.1.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "operate", - "args": { - "path":"Device.IP.Diagnostics.", - "action":"IPPing()", - "input":{ - "Host":"iopsys.eu" - } - }, - "rc": 0 - }, - { - "method": "dump_schema", - "args": {}, - "rc": 0 - }, - { - "method": "list_operate", - "args": {}, - "rc": 0 - }, - { - "method": "get_supported_dm", - "args": { - "path": "Device.DeviceInfo.", - }, - "rc": 0 - }, - { - "method": "operate", - "args": { - "path":"Device.IP.Diagnostics.", - "action":"IPPing()", - "input":{ - "Host":"iopsys.eu" - } - }, - "rc": 0 - }, - { - "method": "transaction_commit", - "args": { - "transaction_id": 123 - }, - "rc": 0 - }, - { - "method": "transaction_abort", - "args": { - "transaction_id": 123 - }, - "rc": 0 - }, - { - "method": "getm_names", - "args": { - "paths": ["Device.WiFi.SSID.1.SSID","Device.WiFi.SSID.2.SSID"], - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "setm_values", - "args": { - "pv_tuple": [{"path":"Device.Users.User.1.Alias", "value":"cpe-1"}, {"path":"Device.Users.User.2.Alias", "value":"cpe-2"}], - "proto": "usp", - "transaction_id": 123 - }, - "rc": 0 - }, - ] -} - diff --git a/bbfd/test/funl/validation/usp.validation.negative.json b/bbfd/test/funl/validation/usp.validation.negative.json deleted file mode 100644 index 5f96f41d..00000000 --- a/bbfd/test/funl/validation/usp.validation.negative.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "object": "usp", - "methods": [ - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Invalid", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.Invalid", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Invalid", - "proto": "cwmp" - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.WiFi.SSID.1.Invalid", - "value": "test-1g" - }, - "rc": 0 - }, - { - "method": "add_object", - "args": { - "path": "Device.Users.User.Invalid", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "del_object", - "args": { - "path": "Device.Users.User.Invalid.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "del_object", - "args": { - "path": "Device.Users.User.[Username>admin].", - "proto": "usp" - }, - "rc": 0 - } - ] -} - diff --git a/bbfd/test/funl/validation/usp.validation.positive.json b/bbfd/test/funl/validation/usp.validation.positive.json deleted file mode 100644 index c1aa81ab..00000000 --- a/bbfd/test/funl/validation/usp.validation.positive.json +++ /dev/null @@ -1,323 +0,0 @@ -{ - "object": "usp", - "methods": [ - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "cwmp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Users.User.*.Alias", - "proto": "cwmp" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "both" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp", - "maxdepth": "1" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path": "Device.DeviceInfo.Manufacturer", - "proto": "usp", - "maxdepth": "1", - "next-level": true - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers#1+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Users.User.*.Alias" - }, - "rc": 0 - }, - - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.1.LowerLayers#*+.Name" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.IP.Interface.*.IPv4Address.*.AddressingType" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Status==\"Up\"].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[SSID==\"test-2g\"&&Status==\"Up\"].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[SSID==\"test-2g\"&&Stats.PacketsSent>0].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[BytesSent>0].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Enable==true].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Enable!=true].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.[Enable==0].Device." - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.USB.USBHosts.Host.*.Device." - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort==68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort!=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort>68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort<68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort>=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[DestPort<=68].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order==1].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order!=1].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order>8].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order>=8].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order<2].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.Firewall.Chain.1.Rule.[Order<=2].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[Status>\"Up\"].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.{Status==\"Up\"}.Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.SSID.[].Alias" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.AccessPoint.[SSIDReference+.Alias==\"cpe-1\"].AssociatedDeviceNumberOfEntries" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.AccessPoint.[SSIDReference#1+.Alias==\"cpe-1\"].WPS.ConfigMethodsSupported" - }, - "rc": 0 - }, - { - "method": "get", - "args": { - "path":"Device.WiFi.AccessPoint.[SSIDReference#*+.Alias==\"cpe-1\"].WPS.ConfigMethodsSupported" - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.WiFi.SSID.1.SSID", - "value": "test-1g" - }, - "rc": 0 - }, - { - "method": "set", - "args": { - "path": "Device.Firewall.Chain.1.Rule.1.", - "values": {"Order":"7"} - }, - "rc": 0 - }, - { - "method": "add_object", - "args": { - "path": "Device.Users.User.", - "proto": "usp" - }, - "rc": 0 - }, - - { - "method": "del_object", - "args": { - "path": "Device.Users.User.2.", - "proto": "usp" - }, - "rc": 0 - } - ] -} - diff --git a/bbfd/test/libuspd_test.c b/bbfd/test/libuspd_test.c deleted file mode 100644 index c0de422d..00000000 --- a/bbfd/test/libuspd_test.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2021 iopsys Software Solutions AB - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 - * as published by the Free Software Foundation - * - * Author: Suvendhu Hansa - */ - -/* This file is used for validating USPD max msg len using libbbf APIs */ - -#include -#include -#include - -#ifndef DEF_IPC_DATA_LEN -#define DEF_IPC_DATA_LEN (1024 * 1024 - 128) -#endif - -/************************************************************* -* GET PARAM -**************************************************************/ -static int get_X_IOPSYS_EU_testUSPDParam_TestText(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - char *ptr = (char *)calloc(1, DEF_IPC_DATA_LEN); - if (ptr == NULL) { - *value = ""; - return 0; - } - memset(ptr, 'a', DEF_IPC_DATA_LEN - 1); - dmasprintf(value, ptr); - free(ptr); - return 0; -} - -/********************************************************************************************************************************** -* OBJ & PARAM DEFINITION -***********************************************************************************************************************************/ -/*** Device. ***/ -DMLEAF tX_IOPSYS_EU_testUSPDParam[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ -{"X_IOPSYS_EU_TestText", &DMREAD, DMT_STRING, get_X_IOPSYS_EU_testUSPDParam_TestText, NULL, BBFDM_BOTH}, -{0} -}; - -/* ********** DynamicObj ********** */ -DM_MAP_OBJ tDynamicObj[] = { -/* parentobj, nextobject, parameter */ -{"Device.", NULL, tX_IOPSYS_EU_testUSPDParam}, -{0} -}; diff --git a/bbfd/test/python/validate_3272.py b/bbfd/test/python/validate_3272.py deleted file mode 100755 index 0abb7e99..00000000 --- a/bbfd/test/python/validate_3272.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/python3 - -import subprocess -import json - -TEST_NAME = "BUG_3272" - -print("Running: " + TEST_NAME) - -def usp_get(path, proto = ""): - path_arg = "{\"path\":\"" + path + "\",\"proto\":\"" + proto + "\"}" - cmd = ['ubus', 'call', 'usp.raw', 'get', path_arg] - - out = subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - - stdout,stderr = out.communicate() - return stdout - -# check fault code of invalid path -output = json.loads(usp_get("Device.USB.USBHosts.Host.[Enable==0].Device.")) - -for param in enumerate(output["parameters"]): - assert param[1]["parameter"].endswith("DeviceNumberOfEntries") == False, "FAIL" + TEST_NAME - -print("PASS: " + TEST_NAME) diff --git a/bbfd/test/python/validate_3536.py b/bbfd/test/python/validate_3536.py deleted file mode 100755 index b8732f78..00000000 --- a/bbfd/test/python/validate_3536.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python3 - -import subprocess -import json - -TEST_NAME = "BUG_3536" - -print("Running: " + TEST_NAME) - -def usp_get(path, proto = ""): - path_arg = "{\"path\":\"" + path + "\",\"proto\":\"" + proto + "\"}" - cmd = ['ubus', 'call', 'usp.raw', 'get', path_arg] - - out = subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - - stdout,stderr = out.communicate() - return stdout - -# check fault code of invalid path -output = json.loads(usp_get("Device", "usp")) -assert output["fault"] == 7026, "Wrong fault code" - -# check fault code of invalid path -output = json.loads(usp_get("Device", "cwmp")) -assert output["fault"] == 9005, "Wrong fault code for cwmp" - -print("PASS: " + TEST_NAME) diff --git a/bbfd/test/python/validate_device.py b/bbfd/test/python/validate_device.py deleted file mode 100755 index 3dfaa97e..00000000 --- a/bbfd/test/python/validate_device.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/python3 - -import ubus -import pathlib -import subprocess -import json - -TEST_NAME = "Get Device." - -print("Running: " + TEST_NAME) - -sock = pathlib.Path('/var/run/ubus/ubus.sock') -if sock.exists(): - assert ubus.connect('/var/run/ubus/ubus.sock') -else: - assert ubus.connect() - -out = ubus.call('usp.raw', 'get', {"path":"Device."}) -assert isinstance(out[0]["parameters"][0], dict), "FAIL: get Device. on usp.raw" - -# Check get operation for Device. path succeed -out = ubus.call('usp', 'get', {"path":"Device."}) -assert isinstance(out[0]['Device'], dict), "FAIL: get Device. on usp" - -ubus.disconnect() -print("PASS: " + TEST_NAME) diff --git a/bbfd/test/python/validate_fault_code.py b/bbfd/test/python/validate_fault_code.py deleted file mode 100755 index 651d2bb2..00000000 --- a/bbfd/test/python/validate_fault_code.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/python3 - -import subprocess -import json - -TEST_NAME = "Invalid path fault test" - -print("Running: " + TEST_NAME) - -def usp_get(path, proto = ""): - path_arg = "{\"path\":\"" + path + "\",\"proto\":\"" + proto + "\"}" - cmd = ['ubus', 'call', 'usp.raw', 'get', path_arg] - - out = subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - - stdout,stderr = out.communicate() - return stdout - -# check fault code of invalid path -output = json.loads(usp_get("Device")) -assert output["fault"] == 9005, "FAIL: " + TEST_NAME - -output = json.loads(usp_get("Device", "usp")) -assert output["fault"] == 7026, "FAIL: " + TEST_NAME - -# for cmwp proto fault should be 9005 -output = json.loads(usp_get("Device", "cwmp")) -assert output["fault"] == 9005, "FAIL: " + TEST_NAME - -print("PASS: " + TEST_NAME) diff --git a/bbfd/test/python/validate_invalid_transaction_id.py b/bbfd/test/python/validate_invalid_transaction_id.py deleted file mode 100755 index 7a399190..00000000 --- a/bbfd/test/python/validate_invalid_transaction_id.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/python3 - -import ubus -import json -import pathlib - -TEST_NAME = "Validate fault on invalid transaction id with usp.raw" - -print("Running: " + TEST_NAME) - -def fault_wrong_transaction(cmd, param, efault): - out = ubus.call("usp.raw", cmd, param) - assert out[0]["fault"] == efault, "FAIL: for " + cmd + str(param) + " output " + str(out) - - -sock = pathlib.Path('/var/run/ubus/ubus.sock') -if sock.exists (): - assert ubus.connect('/var/run/ubus/ubus.sock') -else: - assert ubus.connect() - -fault_wrong_transaction("set", {"path":"Device.Users.User.1.Username", "value":"abc", "transaction_id":1234}, 7003) -fault_wrong_transaction("set", {"path":"Device.Users.User.1.Username", "value":"abc", "proto":"usp", "transaction_id":1234}, 7003) -fault_wrong_transaction("set", {"path":"Device.Users.User.1.Username", "value":"abc", "proto":"cwmp", "transaction_id":1234}, 9002) - -fault_wrong_transaction("set", {"path":"Device.Users.User.1.", "values":{"Username":"abc"}, "transaction_id":1234}, 7003) -fault_wrong_transaction("set", {"path":"Device.Users.User.1.", "values":{"Username":"abc"}, "transaction_id":1234, "proto":"usp"}, 7003) -fault_wrong_transaction("set", {"path":"Device.Users.User.1.", "values":{"Username":"abc"}, "transaction_id":1234, "proto":"cwmp"}, 9002) - -fault_wrong_transaction("add_object", {"path":"Device.Users.User.", "transaction_id":1234}, 7003) -fault_wrong_transaction("add_object", {"path":"Device.Users.User.", "transaction_id":1234, "proto":"usp"}, 7003) -fault_wrong_transaction("add_object", {"path":"Device.Users.User.", "transaction_id":1234, "proto":"cwmp"}, 9002) - -fault_wrong_transaction("del_object", {"path":"Device.Users.User.1", "transaction_id":1234}, 7003) -fault_wrong_transaction("del_object", {"path":"Device.Users.User.1", "transaction_id":1234, "proto":"usp"}, 7003) -fault_wrong_transaction("del_object", {"path":"Device.Users.User.1", "transaction_id":1234, "proto":"cwmp"}, 9002) - - -fault_wrong_transaction("setm_values", {"pv_tuple":[{"path":"Device.Users.User.1.Username", "value":"abc"}], "transaction_id":1234}, 7003) -fault_wrong_transaction("setm_values", {"pv_tuple":[{"path":"Device.Users.User.1.Username", "value":"abc"}], "transaction_id":1234, "proto":"usp"}, 7003) -fault_wrong_transaction("setm_values", {"pv_tuple":[{"path":"Device.Users.User.1.Username", "value":"abc"}], "transaction_id":1234, "proto":"cwmp"}, 9002) - -ubus.disconnect() - -print("PASS: " + TEST_NAME) diff --git a/bbfd/test/python/validate_invalid_transaction_id_fault.py b/bbfd/test/python/validate_invalid_transaction_id_fault.py deleted file mode 100755 index eef4be1a..00000000 --- a/bbfd/test/python/validate_invalid_transaction_id_fault.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/python3 - -import ubus -import json -import pathlib - -TEST_NAME = "Validate fault on invalid transaction id with usp.raw" - -print("Running: " + TEST_NAME) - -def fault_wrong_transaction(cmd, param, efault): - out = ubus.call("usp.raw", cmd, param) - assert out[0]["fault"] == efault, "FAIL: for " + cmd + str(param) + " output " + str(out) - - -sock = pathlib.Path('/var/run/ubus/ubus.sock') -if sock.exists (): - assert ubus.connect('/var/run/ubus/ubus.sock') -else: - assert ubus.connect() - -fault_wrong_transaction("set", {"path":"Device.Users.User.1.Username", "value":"abc", "transaction_id":1234}, 7003) -fault_wrong_transaction("set", {"path":"Device.Users.User.1.Username", "value":"abc", "proto":"usp", "transaction_id":1234}, 7003) -fault_wrong_transaction("set", {"path":"Device.Users.User.1.Username", "value":"abc", "proto":"cwmp", "transaction_id":1234}, 9002) - -fault_wrong_transaction("set", {"path":"Device.Users.User.1.", "values":{"Username":"abc"}, "transaction_id":1234}, 7003) -fault_wrong_transaction("set", {"path":"Device.Users.User.1.", "values":{"Username":"abc"}, "transaction_id":1234, "proto":"usp"}, 7003) -fault_wrong_transaction("set", {"path":"Device.Users.User.1.", "values":{"Username":"abc"}, "transaction_id":1234, "proto":"cwmp"}, 9002) - -fault_wrong_transaction("add_object", {"path":"Device.Users.User.", "transaction_id":1234}, 7003) -fault_wrong_transaction("add_object", {"path":"Device.Users.User.", "transaction_id":1234, "proto":"usp"}, 7003) -fault_wrong_transaction("add_object", {"path":"Device.Users.User.", "transaction_id":1234, "proto":"cwmp"}, 9002) - -fault_wrong_transaction("del_object", {"path":"Device.Users.User.1", "transaction_id":1234}, 7003) -fault_wrong_transaction("del_object", {"path":"Device.Users.User.1", "transaction_id":1234, "proto":"usp"}, 7003) -fault_wrong_transaction("del_object", {"path":"Device.Users.User.1", "transaction_id":1234, "proto":"cwmp"}, 9002) - - -fault_wrong_transaction("setm_values", {"pv_tuple":[{"path":"Device.Users.User.1.Username", "value":"abc"}], "transaction_id":1234}, 7003) -fault_wrong_transaction("setm_values", {"pv_tuple":[{"path":"Device.Users.User.1.Username", "value":"abc"}], "transaction_id":1234, "proto":"usp"}, 7003) -fault_wrong_transaction("setm_values", {"pv_tuple":[{"path":"Device.Users.User.1.Username", "value":"abc"}], "transaction_id":1234, "proto":"cwmp"}, 9002) - - -ubus.disconnect() - -print("PASS: " + TEST_NAME) diff --git a/bbfd/test/python/validate_schema_notify.py b/bbfd/test/python/validate_schema_notify.py deleted file mode 100755 index b8915993..00000000 --- a/bbfd/test/python/validate_schema_notify.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/python3 - -import pexpect -import os - -print("Running: Schema updater notification validation") - -ret = 1 -child = pexpect.spawn('ubus monitor') - -# force change in schema, by removing dependency uci file -os.rename("/etc/config/users", "/etc/config/users_1") - -try: - ret = child.expect('notify', timeout=35) -except: - print("FAIL: Schema updater notification") - -if ret == 0: - try: - ret = child.expect('schema_update_available') - except: - print("FAIL: Schema updater notification") - -# Revert back uci changes -os.rename("/etc/config/users_1", "/etc/config/users") - -if ret == 0: - print("PASS: Schema updater notification") - -exit(ret) diff --git a/bbfd/test/python/validate_serial.py b/bbfd/test/python/validate_serial.py deleted file mode 100755 index d5a9d3f2..00000000 --- a/bbfd/test/python/validate_serial.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/python3 - -import subprocess -import json - -TEST_NAME = "Get serial number" - -print("Running: " + TEST_NAME) - -out = subprocess.Popen(['ubus', 'call', 'usp.raw', 'get', '{"path":"Device.DeviceInfo.SerialNumber"}'], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - -stdout,stderr = out.communicate() - -jout = json.loads(stdout) - -assert jout["parameters"][0]["value"] == "000000001", "FAIL: serial number mismatch" - -print("PASS: " + TEST_NAME) diff --git a/bbfd/test/python/validate_ubus_event.py b/bbfd/test/python/validate_ubus_event.py deleted file mode 100755 index e174fd63..00000000 --- a/bbfd/test/python/validate_ubus_event.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/python3 - -import ubus -import json -import pathlib - -TEST_NAME = "Validate ubus event usp.raw" - -print("Running: " + TEST_NAME) - -def callback(event, data): - print("PASS: " + TEST_NAME) - ubus.disconnect() - exit(0) - -sock = pathlib.Path('/var/run/ubus/ubus.sock') -if sock.exists (): - assert ubus.connect('/var/run/ubus/ubus.sock') -else: - assert ubus.connect() - -ubus.listen(("usp.event", callback)) - -ubus.call("usp.raw", "notify_event", {"name":"Device.LocalAgent.TransferComplete!", "input":{"param1":"val1", "param2":"val2"}}) - -ubus.loop() - -ubus.disconnect() - -print("FAIL: " + TEST_NAME) diff --git a/bbfd/test/python/validate_uspd.py b/bbfd/test/python/validate_uspd.py deleted file mode 100755 index 008c3853..00000000 --- a/bbfd/test/python/validate_uspd.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/python3 - -import ubus -import json -import pathlib -import shutil -import os - -TEST_NAME = "Validate USPD Max MSG Len" -SHARED_LIB = "/builds/iopsys/uspd/test/libuspd_test.so" -DEST_DIR = "/usr/lib/bbfdm/" - -print("Running: " + TEST_NAME) - -sock = pathlib.Path('/var/run/ubus/ubus.sock') -if sock.exists(): - assert ubus.connect('/var/run/ubus/ubus.sock') -else: - assert ubus.connect() - -# Check get operation for Device. path succeed -out = ubus.call('usp.raw', 'get', {"path":"Device."}) -assert isinstance(out[0]["parameters"][0], dict), "FAIL: get Device. on usp" - -# Now copy the shared library -print("Copying shared library to /usr/lib/bbfdm") -try: - shutil.copy(SHARED_LIB, DEST_DIR) -except: - assert False, "FAIL: can't copy shared lib to /usr/lib/bbfdm" - -# Again check get for Device. path should fail due to max msglen crossed -out = ubus.call('usp.raw', 'get', {"path":"Device.", "proto":"usp"}) -fault = out[0]["fault"]; -assert fault == 7003, "FAIL: " + TEST_NAME - -# Now check usp.raw object should still present -out = ubus.objects() -objects = out.keys() -assert "usp.raw" in objects, "Object vanished" - -# Again check get operation with less msglen should succeed -out = ubus.call('usp.raw', 'get', {"path":"Device.DeviceInfo."}) -assert isinstance(out[0]["parameters"][0], dict), "FAIL: get Device. on usp" - -# Now delete the shared library from /usr/lib/bbfdm -os.remove(DEST_DIR + "libuspd_test.so") - -print("PASS: " + TEST_NAME) diff --git a/bbfd/src/usp.c b/bbfd/usp.c similarity index 100% rename from bbfd/src/usp.c rename to bbfd/usp.c diff --git a/bbfd/src/usp.h b/bbfd/usp.h similarity index 100% rename from bbfd/src/usp.h rename to bbfd/usp.h diff --git a/docs/guide/tools.md b/docs/guide/tools.md index 12d74232..44627477 100644 --- a/docs/guide/tools.md +++ b/docs/guide/tools.md @@ -113,7 +113,7 @@ Part of BBF-tools, refer Readme for more examples More examples: ```bash -$ ./generate_dm_excel.py -d tr181 -v iopsys -v openwrt -o datamodel.xls +$ ./generate_dm_excel.py -d tr181 -v iopsys -o datamodel.xls $ ./generate_dm_excel.py -d tr181 -d tr104 -v iopsys -o datamodel.xls $ ./generate_dm_excel.py -d tr181 -v iopsys -p X_IOPSYS_EU_ -r git^https://dev.iopsys.eu/iopsys/xmppc.git^devel -o datamodel_iopsys.xls ``` @@ -165,7 +165,6 @@ The input json file should be defined as follow: "software_version": "1.2.3.4", "vendor_list": [ "iopsys", - "openwrt", "test" ], "dm_json_files": [ diff --git a/libbbf_dm/dmtree/vendor/openwrt/tr181/deviceinfo.c b/libbbf_dm/dmtree/vendor/openwrt/tr181/deviceinfo.c deleted file mode 100644 index 61e4147c..00000000 --- a/libbbf_dm/dmtree/vendor/openwrt/tr181/deviceinfo.c +++ /dev/null @@ -1,208 +0,0 @@ -#include "deviceinfo.h" - -enum fw_image_status { - FW_IMAGE_STATUS_NoImage, - FW_IMAGE_STATUS_Downloading, - FW_IMAGE_STATUS_Validating, - FW_IMAGE_STATUS_Available, - FW_IMAGE_STATUS_DownloadFailed, - FW_IMAGE_STATUS_ValidationFailed, - FW_IMAGE_STATUS_InstallationFailed, - FW_IMAGE_STATUS_ActivationFailed, - __FW_IMAGE_STATUS_MAX -}; - -static const char *fw_image_status_str[__FW_IMAGE_STATUS_MAX] = { - "NoImage", - "Downloading", - "Validating", - "Available", - "DownloadFailed", - "ValidationFailed", - "InstallationFailed", - "ActivationFailed" -}; - -struct fw_image { - const char *name; - enum fw_image_status status; -}; - -static const struct fw_image fw_images[] = { - { .name = "default", .status = FW_IMAGE_STATUS_Available } -}; - -static int openwrt__browseDeviceInfoFirmwareImageInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) -{ - char *inst = NULL; - int i; - - for (i = 0; i < ARRAY_SIZE(fw_images); i++) { - const struct fw_image *fw_img = &fw_images[i]; - - inst = handle_instance_without_section(dmctx, parent_node, i+1); - if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)fw_img, inst) == DM_STOP) - break; - } - return 0; -} - -static char *get_uci_deviceinfo(char *opt) -{ - char *v; - - dmuci_get_option_value_string("cwmp", "@deviceinfo[0]", opt, &v); - return v; -} - -static int openwrt__get_device_manufacturer(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_uci_deviceinfo("Manufacturer"); - return 0; -} - -static int openwrt__get_device_manufactureroui(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_uci_deviceinfo("ManufacturerOUI"); - return 0; -} - -static int openwrt__get_device_productclass(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_uci_deviceinfo("ProductClass"); - return 0; -} - -static int openwrt__get_device_serialnumber(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_uci_deviceinfo("SerialNumber"); - return 0; -} - -static int openwrt__get_device_softwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_uci_deviceinfo("SoftwareVersion"); - return 0; -} - -static int openwrt__get_device_hardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_uci_deviceinfo("HardwareVersion"); - return 0; -} - -static int openwrt__get_device_devicecategory(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_uci_deviceinfo("DeviceCategory"); - return 0; -} - -static int openwrt__get_device_additionalhardwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_uci_deviceinfo("AdditionalHardwareVersion"); - return 0; -} - -static int openwrt__get_device_additionalsoftwareversion(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_uci_deviceinfo("AdditionalSoftwareVersion"); - return 0; -} - -static int openwrt__get_device_modelname(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_uci_deviceinfo("ModelName"); - return 0; -} - -static int openwrt__get_device_description(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = get_uci_deviceinfo("Description"); - return 0; -} - -static int openwrt__get_device_active_fwimage(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = dmstrdup("Device.DeviceInfo.FirmwareImage.1"); - return 0; -} - -static int openwrt__get_device_fwimage_numberofentries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - dmasprintf(value, "%d", ARRAY_SIZE(fw_images)); - return 0; -} - -static int openwrt__get_FirmwareImage_name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - const struct fw_image *fw_img = data; - - *value = (char *)fw_img->name; - return 0; -} - -static int openwrt__get_FirmwareImage_version(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - return openwrt__get_device_softwareversion(refparam, ctx, data, instance, value); -} - -static int openwrt__get_FirmwareImage_available(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - const struct fw_image *fw_img = data; - - *value = fw_img->status == FW_IMAGE_STATUS_Available ? "1" : "0"; - return 0; -} - -static int openwrt__get_FirmwareImage_status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - const struct fw_image *fw_img = data; - - *value = (char *)fw_image_status_str[fw_img->status]; - return 0; -} - -static int openwrt__get_FirmwareImage_bootfailurelog(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - *value = 0; - return 0; -} - -/********************************************************************************************************************************** -* OBJ & PARAM DEFINITION -***********************************************************************************************************************************/ -/* *** Device.DeviceInfo. *** */ -DMOBJ tOPENWRT_DeviceInfoObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/ -{"FirmwareImage", &DMREAD, NULL, NULL, NULL, openwrt__browseDeviceInfoFirmwareImageInst, NULL, NULL, NULL, tOPENWRT_DeviceInfoFirmwareImageParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}}, -{0} -}; - -DMLEAF tOPENWRT_DeviceInfoParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ -{"DeviceCategory", &DMREAD, DMT_STRING, openwrt__get_device_devicecategory, NULL, BBFDM_BOTH}, -{"Manufacturer", &DMREAD, DMT_STRING, openwrt__get_device_manufacturer, NULL, BBFDM_BOTH}, -{"ManufacturerOUI", &DMREAD, DMT_STRING, openwrt__get_device_manufactureroui, NULL, BBFDM_BOTH}, -{"ModelName", &DMREAD, DMT_STRING, openwrt__get_device_modelname, NULL, BBFDM_BOTH}, -{"Description", &DMREAD, DMT_STRING, openwrt__get_device_description, NULL, BBFDM_BOTH}, -{"ProductClass", &DMREAD, DMT_STRING, openwrt__get_device_productclass, NULL, BBFDM_BOTH}, -{"SerialNumber", &DMREAD, DMT_STRING, openwrt__get_device_serialnumber, NULL, BBFDM_BOTH}, -{"HardwareVersion", &DMREAD, DMT_STRING, openwrt__get_device_hardwareversion, NULL, BBFDM_BOTH}, -{"SoftwareVersion", &DMREAD, DMT_STRING, openwrt__get_device_softwareversion, NULL, BBFDM_BOTH}, -{"AdditionalHardwareVersion", &DMREAD, DMT_STRING, openwrt__get_device_additionalhardwareversion, NULL, BBFDM_BOTH}, -{"AdditionalSoftwareVersion", &DMREAD, DMT_STRING, openwrt__get_device_additionalsoftwareversion, NULL, BBFDM_BOTH}, -{"ActiveFirmwareImage", &DMREAD, DMT_STRING, openwrt__get_device_active_fwimage, NULL, BBFDM_BOTH}, -{"FirmwareImageNumberOfEntries", &DMREAD, DMT_UNINT, openwrt__get_device_fwimage_numberofentries, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.DeviceInfo.FirmwareImage.{i}. *** */ -DMLEAF tOPENWRT_DeviceInfoFirmwareImageParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ -{"Name", &DMREAD, DMT_STRING, openwrt__get_FirmwareImage_name, NULL, BBFDM_BOTH }, -{"Version", &DMREAD, DMT_STRING, openwrt__get_FirmwareImage_version, NULL, BBFDM_BOTH }, -{"Available", &DMREAD, DMT_BOOL, openwrt__get_FirmwareImage_available, NULL, BBFDM_BOTH }, -{"Status", &DMREAD, DMT_STRING, openwrt__get_FirmwareImage_status, NULL, BBFDM_BOTH }, -{"BootFailureLog", &DMREAD, DMT_STRING, openwrt__get_FirmwareImage_bootfailurelog, NULL, BBFDM_BOTH }, -{0} -}; diff --git a/libbbf_dm/dmtree/vendor/openwrt/tr181/deviceinfo.h b/libbbf_dm/dmtree/vendor/openwrt/tr181/deviceinfo.h deleted file mode 100644 index d3525e69..00000000 --- a/libbbf_dm/dmtree/vendor/openwrt/tr181/deviceinfo.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __OPENWRT_DEVICEINFO_H -#define __OPENWRT_DEVICEINFO_H - -#include "libbbf_api/dmcommon.h" - -extern DMOBJ tOPENWRT_DeviceInfoObj[]; -extern DMLEAF tOPENWRT_DeviceInfoParams[]; -extern DMLEAF tOPENWRT_DeviceInfoFirmwareImageParams[]; - -#endif //__OPENWRT_DEVICEINFO_H diff --git a/libbbf_dm/dmtree/vendor/openwrt/tr181/qos.c b/libbbf_dm/dmtree/vendor/openwrt/tr181/qos.c deleted file mode 100644 index 1e0278a9..00000000 --- a/libbbf_dm/dmtree/vendor/openwrt/tr181/qos.c +++ /dev/null @@ -1,575 +0,0 @@ -/* - * Copyright (C) 2021 iopsys Software Solutions AB - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 - * as published by the Free Software Foundation - * - * Author: Omar Kallel - * Author: Amin Ben Ramdhane - */ - -#include "qos.h" - -struct queuestats -{ - struct uci_section *dmsect; - char dev[50]; - char user[50]; - char priomap[50]; - int noqueue; - int pfifo_fast; - int refcnt; - int bands; - int bytes_sent; - int pkt_sent; - int pkt_dropped; - int pkt_overlimits; - int pkt_requeues; - int backlog_b; - int backlog_p; - int backlog_requeues; -}; - -/************************************************************* -* COMMON FUNCTIONS -**************************************************************/ -int command_exec_output_to_array(const char *cmd, char **output, int *length) -{ - char out[2048]; - int i = 0; - - /* Open the command for reading. */ - FILE *fp = popen(cmd, "r"); /* Flawfinder: ignore */ - if (fp == NULL) - return -1; - - /* Read the output line by line and store it in output array. */ - while (fgets(out, sizeof(out)-1, fp) != NULL) - dmasprintf(&output[i++], "%s", out); - - *length = i; - - /* close */ - pclose(fp); - - return 0; -} - -/************************************************************* -* ENTRY METHOD -**************************************************************/ -/*#Device.QoS.Classification.{i}.!UCI:qos/classify/dmmap_qos*/ -static int openwrt__browseQoSClassificationInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) -{ - char *inst = NULL; - struct dmmap_dup *p = NULL; - LIST_HEAD(dup_list); - - synchronize_specific_config_sections_with_dmmap("qos", "classify", "dmmap_qos", &dup_list); - list_for_each_entry(p, &dup_list, list) { - - inst = handle_instance(dmctx, parent_node, p->dmmap_section, "classifinstance", "classifalias"); - - if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p, inst) == DM_STOP) - break; - } - free_dmmap_config_dup_list(&dup_list); - return 0; -} - -static struct uci_section *get_dup_qstats_section_in_dmmap(char *dmmap_package, char *section_type, char *dev) -{ - struct uci_section *s = NULL; - - uci_path_foreach_option_eq(bbfdm, dmmap_package, section_type, "dev_link", dev, s) { - return s; - } - - return NULL; -} - -static int openwrt__browseQoSQueueStatsInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) -{ - struct uci_section *dmmap_sect; - char *questatsout[256], *inst = NULL, *max_inst = NULL, *lastinstancestore = NULL, dev[50] = "", user[50] = ""; - int length = 0; - struct queuestats queuests = {0}, emptyquestats = {0}; - regex_t regex1 = {}, regex2 = {}; - int ret = 0; - - regcomp(®ex1, "^qdisc noqueue [0-9]*: dev [[:alnum:]]* [[:alnum:]]* refcnt [0-9]*", 0); - regcomp(®ex2, "^qdisc pfifo_fast [0-9]*: dev [[:alnum:]]* [[:alnum:]]* refcnt [0-9]*", 0); - - command_exec_output_to_array("tc -s qdisc", questatsout, &length); - - for (int i = 0; i < length; i++) { - switch (i%3) { - case 0: - ret = regexec(®ex1, questatsout[i], 0, NULL, 0); - if (ret == 0) - sscanf(questatsout[i], "qdisc noqueue %d: dev %49s %49s refcnt %d\n", &queuests.noqueue, dev, user, &queuests.refcnt); - else { - ret= regexec(®ex2, questatsout[i], 0, NULL, 0); - if (ret == 0) - sscanf(questatsout[i], "qdisc pfifo_fast %d: dev %49s %49s refcnt %d\n", &queuests.pfifo_fast, dev, user, &queuests.refcnt); - } - DM_STRNCPY(queuests.dev, dev, sizeof(queuests.dev)); - break; - case 1: - sscanf(questatsout[i], " Sent %d bytes %d pkt (dropped %d, overlimits %d requeues %d)\n", &queuests.bytes_sent, &queuests.pkt_sent, &queuests.pkt_dropped, &queuests.pkt_overlimits, &queuests.pkt_requeues); - break; - case 2: - sscanf(questatsout[i], " backlog %db %dp requeues %d\n", &queuests.backlog_b, &queuests.backlog_p, &queuests.backlog_requeues); - if ((dmmap_sect = get_dup_qstats_section_in_dmmap("dmmap_qos", "qqueue_stats", queuests.dev)) == NULL) { - dmuci_add_section_bbfdm("dmmap_qos", "qqueue_stats", &dmmap_sect); - dmuci_set_value_by_section_bbfdm(dmmap_sect, "dev_link", queuests.dev); - } - - queuests.dmsect= dmmap_sect; - - if (lastinstancestore != NULL && max_inst != NULL) - max_inst = dmstrdup(lastinstancestore); - - inst = handle_instance(dmctx, parent_node, dmmap_sect, "queuestatsinstance", "queuestatsalias"); - - lastinstancestore = dmstrdup(max_inst); - - if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&queuests, inst) == DM_STOP) - goto end; - - queuests = emptyquestats; - break; - } - } - - regfree(®ex1); - regfree(®ex2); -end: - return 0; -} - -/************************************************************* -* ADD & DEL OBJ -**************************************************************/ -static int openwrt__addObjQoSClassification(char *refparam, struct dmctx *ctx, void *data, char **instance) -{ - struct uci_section *s, *dmmap_qclassify; - char qcomment[32]; - - snprintf(qcomment, sizeof(qcomment), "QoS classify %s", *instance); - - dmuci_add_section("qos", "classify", &s); - dmuci_set_value_by_section(s, "comment", qcomment); - - dmuci_add_section_bbfdm("dmmap_qos", "classify", &dmmap_qclassify); - dmuci_set_value_by_section(dmmap_qclassify, "section_name", section_name(s)); - dmuci_set_value_by_section(dmmap_qclassify, "classifinstance", *instance); - return 0; -} - -static int openwrt__delObjQoSClassification(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action) -{ - struct uci_section *s = NULL, *stmp = NULL; - - switch (del_action) { - case DEL_INST: - dmuci_delete_by_section(((struct dmmap_dup *)data)->dmmap_section, NULL, NULL); - dmuci_delete_by_section(((struct dmmap_dup *)data)->config_section, NULL, NULL); - break; - case DEL_ALL: - uci_foreach_sections_safe("qos", "classify", stmp, s) { - struct uci_section *dmmap_section = NULL; - - get_dmmap_section_of_config_section("dmmap_qos", "classify", section_name(s), &dmmap_section); - dmuci_delete_by_section(dmmap_section, NULL, NULL); - - dmuci_delete_by_section(s, NULL, NULL); - } - break; - } - return 0; -} - -static int openwrt__addObjQoSQueueStats(char *refparam, struct dmctx *ctx, void *data, char **instance) -{ - return 0; -} - -static int openwrt__delObjQoSQueueStats(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action) -{ - return 0; -} - -/************************************************************* -* GET & SET PARAM -**************************************************************/ -/*#Device.QoS.ClassificationNumberOfEntries!UCI:qos/classify/*/ -static int openwrt__get_QClassificationNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - int cnt = get_number_of_entries(ctx, data, instance, openwrt__browseQoSClassificationInst); - dmasprintf(value, "%d", cnt); - return 0; -} - -static int openwrt__get_QQueueStatsNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - int cnt = get_number_of_entries(ctx, data, instance, openwrt__browseQoSQueueStatsInst); - dmasprintf(value, "%d", cnt); - return 0; -} - -static int openwrt__get_QoSClassification_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - dmuci_get_value_by_section_string(p->dmmap_section, "classifalias", value); - if ((*value)[0] == '\0') - dmasprintf(value, "cpe-%s", instance); - return 0; -} - -static int openwrt__set_QoSClassification_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - - switch (action) { - case VALUECHECK: - if (dm_validate_string(value, -1, 64, NULL, NULL)) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section(p->dmmap_section, "classifalias", value); - break; - } - return 0; -} - -static int openwrt__get_QoSClassification_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct dmmap_dup *p = (struct dmmap_dup *)data; - struct uci_section *s = NULL; - char *classes = NULL, **classesarr = NULL, *classgroup = NULL, *ifaceclassgrp = NULL, *targetclass = NULL; - size_t length; - - dmuci_get_value_by_section_string(p->config_section, "target", &targetclass); - uci_foreach_sections("qos", "classgroup", s) { - dmuci_get_value_by_section_string(s, "classes", &classes); - classesarr = strsplit(classes, " ", &length); - if (classes != NULL && elt_exists_in_array(classesarr, targetclass, length)) { - dmasprintf(&classgroup, "%s", section_name(s)); - break; - } - } - if (classgroup == NULL) - return 0; - uci_foreach_sections("qos", "interface", s) { - dmuci_get_value_by_section_string(s, "classgroup", &ifaceclassgrp); - if (ifaceclassgrp != NULL && DM_STRCMP(ifaceclassgrp, classgroup) == 0) { - adm_entry_get_linker_param(ctx, "Device.IP.Interface.", section_name(s), value); - if (!(*value) || (*value)[0] == 0) - adm_entry_get_linker_param(ctx, "Device.PPP.Interface.", section_name(s), value); - if (!(*value) || (*value)[0] == 0) - adm_entry_get_linker_param(ctx, "Device.Ethernet.Interface.", section_name(s), value); - } - } - return 0; -} - -static int openwrt__set_QoSClassification_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - switch (action) { - case VALUECHECK: - if (dm_validate_string(value, -1, 256, NULL, NULL)) - return FAULT_9007; - break; - case VALUESET: - break; - } - return 0; -} - -/*#Device.QoS.Classification.{i}.DestIP!UCI:qos/classify,@i-1/dsthost*/ -static int openwrt__get_QoSClassification_DestIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - dmuci_get_value_by_section_string(p->config_section, "dsthost", value); - return 0; -} - -static int openwrt__set_QoSClassification_DestIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - - switch (action) { - case VALUECHECK: - if (dm_validate_string(value, -1, 45, NULL, IPAddress)) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section(p->config_section, "dsthost", value); - break; - } - return 0; -} - - - -/*#Device.QoS.Classification.{i}.SourceIP!UCI:qos/classify,@i-1/srchost*/ -static int openwrt__get_QoSClassification_SourceIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - dmuci_get_value_by_section_string(p->config_section, "srchost", value); - return 0; -} - -static int openwrt__set_QoSClassification_SourceIP(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - - switch (action) { - case VALUECHECK: - if (dm_validate_string(value, -1, 45, NULL, IPAddress)) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section(p->config_section, "srchost", value); - break; - } - return 0; -} - -/*#Device.QoS.Classification.{i}.Protocol!UCI:qos/classify,@i-1/proto*/ -static int openwrt__get_QoSClassification_Protocol(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - dmuci_get_value_by_section_string(p->config_section, "proto", value); - return 0; -} - -static int openwrt__set_QoSClassification_Protocol(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - switch (action) { - case VALUECHECK: - if (dm_validate_int(value, RANGE_ARGS{{"-1","255"}}, 1)) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section(p->config_section, "proto", value); - break; - } - return 0; -} - -/*#Device.QoS.Classification.{i}.DestPort!UCI:qos/classify,@i-1/dstports*/ -static int openwrt__get_QoSClassification_DestPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - dmuci_get_value_by_section_string(p->config_section, "dstports", value); - return 0; -} - -static int openwrt__set_QoSClassification_DestPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - - switch (action) { - case VALUECHECK: - if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1)) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section(p->config_section, "dstports", value); - break; - } - return 0; -} - -/*#Device.QoS.Classification.{i}.DestPortRangeMax!UCI:qos/classify,@i-1/portrange*/ -static int openwrt__get_QoSClassification_DestPortRangeMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - dmuci_get_value_by_section_string(p->config_section, "portrange", value); - return 0; -} - -static int openwrt__set_QoSClassification_DestPortRangeMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - - switch (action) { - case VALUECHECK: - if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1)) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section(p->config_section, "portrange", value); - break; - } - return 0; -} - -/*#Device.QoS.Classification.{i}.SourcePort!UCI:qos/classify,@i-1/srcports*/ -static int openwrt__get_QoSClassification_SourcePort(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct dmmap_dup *p = (struct dmmap_dup*)data; - dmuci_get_value_by_section_string(p->config_section, "srcports", value); - return 0; -} - -static int openwrt__set_QoSClassification_SourcePort(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dmmap_dup *p= (struct dmmap_dup*)data; - - switch (action) { - case VALUECHECK: - if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1)) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section(p->config_section, "srcports", value); - break; - } - return 0; -} - -/*#Device.QoS.Classification.{i}.DSCPMark!UCI:qos/classify,@i-1/dscp*/ -static int openwrt__get_QoSClassification_DSCPMark(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct dmmap_dup *p = (struct dmmap_dup *)data; - dmuci_get_value_by_section_string(p->config_section, "dscp", value); - return 0; -} - -static int openwrt__set_QoSClassification_DSCPMark(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct dmmap_dup *p= (struct dmmap_dup *)data; - - switch (action) { - case VALUECHECK: - if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1)) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section(p->config_section, "dscp", value); - break; - } - return 0; -} - -static int openwrt__get_QoSQueueStats_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct queuestats *qts= (struct queuestats*)data; - dmuci_get_value_by_section_string(qts->dmsect, "queuestatsalias", value); - if ((*value)[0] == '\0') - dmasprintf(value, "cpe-%s", instance); - return 0; -} - -static int openwrt__set_QoSQueueStats_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - struct queuestats *qts= (struct queuestats*)data; - - switch (action) { - case VALUECHECK: - if (dm_validate_string(value, -1, 64, NULL, NULL)) - return FAULT_9007; - break; - case VALUESET: - dmuci_set_value_by_section(qts->dmsect, "queuestatsalias", value); - break; - } - return 0; -} - -static int openwrt__get_QoSQueueStats_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct queuestats *qts = (struct queuestats*)data; - - adm_entry_get_linker_param(ctx, "Device.IP.Interface.", qts->dev, value); - if (!(*value) || (*value)[0] == 0) - adm_entry_get_linker_param(ctx, "Device.PPP.Interface.", qts->dev, value); - if (!(*value) || (*value)[0] == 0) - adm_entry_get_linker_param(ctx, "Device.Ethernet.Interface.", qts->dev, value); - if (!(*value) || (*value)[0] == 0) - adm_entry_get_linker_param(ctx, "Device.WiFi.Radio.", qts->dev, value); - return 0; -} - -static int openwrt__set_QoSQueueStats_Interface(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) -{ - switch (action) { - case VALUECHECK: - if (dm_validate_string(value, -1, 256, NULL, NULL)) - return FAULT_9007; - break; - case VALUESET: - break; - } - return 0; -} - -static int openwrt__get_QoSQueueStats_OutputPackets(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct queuestats *queuests = (struct queuestats*)data; - dmasprintf(value, "%d", queuests->pkt_sent); - return 0; -} - -static int openwrt__get_QoSQueueStats_OutputBytes(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct queuestats *queuests = (struct queuestats*)data; - dmasprintf(value, "%d", queuests->bytes_sent); - return 0; -} - -static int openwrt__get_QoSQueueStats_DroppedPackets(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) -{ - struct queuestats *queuests = (struct queuestats*)data; - dmasprintf(value, "%d", queuests->pkt_dropped); - return 0; -} - -/********************************************************************************************************************************** -* OBJ & PARAM DEFINITION -***********************************************************************************************************************************/ -/* *** Device.QoS. *** */ -DMOBJ tOPENWRT_QoSObj[] = { -/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/ -{"Classification", &DMWRITE, openwrt__addObjQoSClassification, openwrt__delObjQoSClassification, NULL, openwrt__browseQoSClassificationInst, NULL, NULL, NULL, tOPENWRT_QoSClassificationParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}}, -{"QueueStats", &DMWRITE, openwrt__addObjQoSQueueStats, openwrt__delObjQoSQueueStats, NULL, openwrt__browseQoSQueueStatsInst, NULL, NULL, NULL, tOPENWRT_QoSQueueStatsParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "Queue", "Interface", NULL}}, -{0} -}; - -DMLEAF tOPENWRT_QoSParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ -{"ClassificationNumberOfEntries", &DMREAD, DMT_UNINT, openwrt__get_QClassificationNumberOfEntries, NULL, BBFDM_BOTH}, -{"QueueStatsNumberOfEntries", &DMREAD, DMT_UNINT, openwrt__get_QQueueStatsNumberOfEntries, NULL, BBFDM_BOTH}, -{0} -}; - -/* *** Device.QoS.Classification.{i}. *** */ -DMLEAF tOPENWRT_QoSClassificationParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ -{"Alias", &DMWRITE, DMT_STRING, openwrt__get_QoSClassification_Alias, openwrt__set_QoSClassification_Alias, BBFDM_BOTH}, -{"Interface", &DMWRITE, DMT_STRING, openwrt__get_QoSClassification_Interface, openwrt__set_QoSClassification_Interface, BBFDM_BOTH}, -{"DestIP", &DMWRITE, DMT_STRING, openwrt__get_QoSClassification_DestIP, openwrt__set_QoSClassification_DestIP, BBFDM_BOTH}, -{"SourceIP", &DMWRITE, DMT_STRING, openwrt__get_QoSClassification_SourceIP, openwrt__set_QoSClassification_SourceIP, BBFDM_BOTH}, -{"Protocol", &DMWRITE, DMT_INT, openwrt__get_QoSClassification_Protocol, openwrt__set_QoSClassification_Protocol, BBFDM_BOTH}, -{"DestPort", &DMWRITE, DMT_INT, openwrt__get_QoSClassification_DestPort, openwrt__set_QoSClassification_DestPort, BBFDM_BOTH}, -{"DestPortRangeMax", &DMWRITE, DMT_INT, openwrt__get_QoSClassification_DestPortRangeMax, openwrt__set_QoSClassification_DestPortRangeMax, BBFDM_BOTH}, -{"SourcePort", &DMWRITE, DMT_INT, openwrt__get_QoSClassification_SourcePort, openwrt__set_QoSClassification_SourcePort, BBFDM_BOTH}, -{"DSCPMark", &DMWRITE, DMT_INT, openwrt__get_QoSClassification_DSCPMark, openwrt__set_QoSClassification_DSCPMark, BBFDM_BOTH}, -{0} -}; - -/* *** Device.QoS.QueueStats.{i}. *** */ -DMLEAF tOPENWRT_QoSQueueStatsParams[] = { -/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ -{"Alias", &DMWRITE, DMT_STRING, openwrt__get_QoSQueueStats_Alias, openwrt__set_QoSQueueStats_Alias, BBFDM_BOTH}, -{"Interface", &DMWRITE, DMT_STRING, openwrt__get_QoSQueueStats_Interface, openwrt__set_QoSQueueStats_Interface, BBFDM_BOTH}, -{"OutputPackets", &DMREAD, DMT_UNINT, openwrt__get_QoSQueueStats_OutputPackets, NULL, BBFDM_BOTH}, -{"OutputBytes", &DMREAD, DMT_UNINT, openwrt__get_QoSQueueStats_OutputBytes, NULL, BBFDM_BOTH}, -{"DroppedPackets", &DMREAD, DMT_UNINT, openwrt__get_QoSQueueStats_DroppedPackets, NULL, BBFDM_BOTH}, -{0} -}; diff --git a/libbbf_dm/dmtree/vendor/openwrt/tr181/qos.h b/libbbf_dm/dmtree/vendor/openwrt/tr181/qos.h deleted file mode 100644 index 4731dc07..00000000 --- a/libbbf_dm/dmtree/vendor/openwrt/tr181/qos.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 iopsys Software Solutions AB - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 - * as published by the Free Software Foundation - * - * Author: Omar Kallel - * Author: Amin Ben Ramdhane - */ - -#ifndef __OPENWRT_QOS_H -#define __OPENWRT_QOS_H - -#include "libbbf_api/dmcommon.h" - -extern DMOBJ tOPENWRT_QoSObj[]; -extern DMLEAF tOPENWRT_QoSParams[]; -extern DMLEAF tOPENWRT_QoSClassificationParams[]; -extern DMLEAF tOPENWRT_QoSQueueStatsParams[]; - -#endif //__OPENWRT_QOS_H - diff --git a/libbbf_dm/dmtree/vendor/openwrt/tr181/vendor.c b/libbbf_dm/dmtree/vendor/openwrt/tr181/vendor.c deleted file mode 100644 index 28c2bc26..00000000 --- a/libbbf_dm/dmtree/vendor/openwrt/tr181/vendor.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2021 iopsys Software Solutions AB - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 - * as published by the Free Software Foundation - * - * Author Amin Ben Ramdhane - * - */ - -#include "deviceinfo.h" -#include "qos.h" -#include "vendor.h" - -DM_MAP_OBJ tVendorExtensionOverwriteOPENWRT[] = { -/* parentobj, nextobject, parameter */ -{"Device.DeviceInfo.", tOPENWRT_DeviceInfoObj, tOPENWRT_DeviceInfoParams}, -{"Device.QoS.", tOPENWRT_QoSObj, tOPENWRT_QoSParams}, -{0} -}; - -char *VendorExtensionExcludeOPENWRT[] = { - "Device.Hosts.", //Object - "Device.WiFi.Radio.{i}.Stats.", //Object - "Device.WiFi.SSID.{i}.Stats.", //Object - "Device.WiFi.AccessPoint.{i}.AssociatedDevice.", //Object - "Device.WiFi.NeighboringWiFiDiagnostic.", //Object - "Device.WiFi.DataElements.Network.", //Object - "Device.DeviceInfo.MemoryStatus.", //Object - "Device.QoS.Policer.{i}.", //Object - "Device.QoS.Queue.{i}.", //Object - "Device.QoS.Shaper.{i}.", //Object - - "Device.Ethernet.Interface.{i}.Stats.MulticastPacketsSent", //Parameter - "Device.Ethernet.Interface.{i}.Stats.UnicastPacketsSent", //Parameter - "Device.Ethernet.Interface.{i}.Stats.UnicastPacketsReceived", //Parameter - "Device.Ethernet.Interface.{i}.Stats.BroadcastPacketsSent", //Parameter - "Device.Ethernet.Interface.{i}.Stats.BroadcastPacketsReceived", //Parameter - "Device.Ethernet.Interface.{i}.Stats.UnknownProtoPacketsReceived", //Parameter - "Device.Ethernet.Link.{i}.Stats.MulticastPacketsSent", //Parameter - "Device.Ethernet.Link.{i}.Stats.UnicastPacketsSent", //Parameter - "Device.Ethernet.Link.{i}.Stats.UnicastPacketsReceived", //Parameter - "Device.Ethernet.Link.{i}.Stats.BroadcastPacketsSent", //Parameter - "Device.Ethernet.Link.{i}.Stats.BroadcastPacketsReceived", //Parameter - "Device.Ethernet.Link.{i}.Stats.UnknownProtoPacketsReceived", //Parameter - "Device.Firewall.Chain.{i}.Rule.{i}.ExpiryDate", //Parameter - "Device.NAT.PortMapping.{i}.LeaseDuration", //Parameter - "Device.WiFi.Radio.{i}.MaxBitRate", //Parameter - "Device.WiFi.Radio.{i}.OperatingFrequencyBand", //Parameter - "Device.WiFi.Radio.{i}.SupportedFrequencyBands", //Parameter - "Device.WiFi.Radio.{i}.SupportedStandards", //Parameter - "Device.WiFi.Radio.{i}.OperatingStandards", //Parameter - "Device.WiFi.Radio.{i}.ChannelsInUse", //Parameter - "Device.WiFi.Radio.{i}.Channel", //Parameter - "Device.WiFi.Radio.{i}.PossibleChannels", //Parameter - "Device.WiFi.Radio.{i}.SupportedOperatingChannelBandwidths", //Parameter - "Device.WiFi.Radio.{i}.CurrentOperatingChannelBandwidth", //Parameter - "Device.WiFi.SSID.{i}.BSSID", //Parameter - "Device.WiFi.AccessPoint.{i}.Status", //Parameter - "Device.WiFi.AccessPoint.{i}.AssociatedDeviceNumberOfEntries", //Parameter - "Device.QoS.ShaperNumberOfEntries", //Parameter - "Device.QoS.QueueNumberOfEntries", //Parameter - "Device.QoS.PolicerNumberOfEntries", //Parameter - "Device.QoS.QueueStats.{i}.Enable", //Parameter - "Device.QoS.QueueStats.{i}.Status", //Parameter - "Device.QoS.QueueStats.{i}.Queue", //Parameter - "Device.QoS.QueueStats.{i}.DroppedBytes", //Parameter - "Device.QoS.Classification.{i}.Enable", //Parameter - "Device.QoS.Classification.{i}.DestMask", //Parameter - "Device.QoS.Classification.{i}.SourceMask", //Parameter - "Device.QoS.Classification.{i}.SourcePortRangeMax", //Parameter - "Device.QoS.Classification.{i}.SourceMACAddress", //Parameter - "Device.QoS.Classification.{i}.DestMACAddress", //Parameter - "Device.QoS.Classification.{i}.Ethertype", //Parameter - "Device.QoS.Classification.{i}.SourceVendorClassID", //Parameter - "Device.QoS.Classification.{i}.DestVendorClassID", //Parameter - "Device.QoS.Classification.{i}.SourceClientID", //Parameter - "Device.QoS.Classification.{i}.DestClientID", //Parameter - "Device.QoS.Classification.{i}.SourceUserClassID", //Parameter - "Device.QoS.Classification.{i}.DestUserClassID", //Parameter - "Device.QoS.Classification.{i}.IPLengthMin", //Parameter - "Device.QoS.Classification.{i}.IPLengthMax", //Parameter - "Device.QoS.Classification.{i}.DSCPCheck", //Parameter - "Device.QoS.Classification.{i}.EthernetPriorityCheck", //Parameter - "Device.QoS.Classification.{i}.VLANIDCheck", //Parameter - "Device.QoS.Classification.{i}.TrafficClass", //Parameter - "Device.QoS.Classification.{i}.Policer", //Parameter - NULL -}; diff --git a/libbbf_dm/dmtree/vendor/openwrt/tr181/vendor.h b/libbbf_dm/dmtree/vendor/openwrt/tr181/vendor.h deleted file mode 100644 index 9143985a..00000000 --- a/libbbf_dm/dmtree/vendor/openwrt/tr181/vendor.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2021 iopsys Software Solutions AB - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 - * as published by the Free Software Foundation - * - * Author Amin Ben Ramdhane - * - */ - -#ifndef __OPENWRT_VENDOR_H -#define __OPENWRT_VENDOR_H - -#include "libbbf_api/dmcommon.h" - -extern DM_MAP_OBJ tVendorExtensionOverwriteOPENWRT[]; -extern char *VendorExtensionExcludeOPENWRT[]; - -#endif //__OPENWRT_VENDOR_H diff --git a/libbbf_dm/dmtree/vendor/vendor.c b/libbbf_dm/dmtree/vendor/vendor.c index f19627d3..ed17c654 100644 --- a/libbbf_dm/dmtree/vendor/vendor.c +++ b/libbbf_dm/dmtree/vendor/vendor.c @@ -15,10 +15,6 @@ #include "iopsys/tr181/vendor.h" #endif -#ifdef BBF_VENDOR_OPENWRT -#include "openwrt/tr181/vendor.h" -#endif - #ifdef BBF_VENDOR_TEST #include "test/tr181/vendor.h" #endif @@ -42,10 +38,6 @@ DM_MAP_VENDOR tVendorExtension[] = { DM_MAP_VENDOR tVendorExtensionOverwrite[] = { /* customer, tableobject */ -#ifdef BBF_VENDOR_OPENWRT -{"openwrt", tVendorExtensionOverwriteOPENWRT}, -#endif - #ifdef BBF_VENDOR_TEST {"test", tVendorExtensionOverwriteTEST}, #endif @@ -57,10 +49,6 @@ DM_MAP_VENDOR tVendorExtensionOverwrite[] = { DM_MAP_VENDOR_EXCLUDE tVendorExtensionExclude[] = { /* customer, tableobject */ -#ifdef BBF_VENDOR_OPENWRT -{"openwrt", VendorExtensionExcludeOPENWRT}, -#endif - #ifdef BBF_VENDOR_TEST {"test", VendorExtensionExcludeTEST}, #endif diff --git a/openwrt/bbf/Config_bbfdm.in b/openwrt/bbf/Config_bbfdm.in deleted file mode 100644 index d664e1ee..00000000 --- a/openwrt/bbf/Config_bbfdm.in +++ /dev/null @@ -1,35 +0,0 @@ -if PACKAGE_libbbfdm - -config BBF_VENDOR_EXTENSION - bool "Enable Vendor Extension" - default y - -config BBF_VENDOR_LIST - string "Vendor List" - default "openwrt" - -config BBF_VENDOR_PREFIX - string "Vendor Prefix" - default "X_IOPSYS_EU_" - -config BBF_TR181 - bool "Enable TR-181 Data Model Support" - default y - -config BBF_TR104 - bool "Enable TR-104 Data Model Support" - default y - -config BBF_TR143 - bool "Enable TR-143 Data Model Support" - default y - -config BBFDM_ENABLE_JSON_PLUGIN - bool "Enable json plugin to extend datamodel" - default n - -config BBFDM_ENABLE_DOTSO_PLUGIN - bool "Enable shared library plugin to extend datamodel" - default n - -endif diff --git a/openwrt/bbf/Makefile b/openwrt/bbf/Makefile deleted file mode 100644 index 1973dc7b..00000000 --- a/openwrt/bbf/Makefile +++ /dev/null @@ -1,101 +0,0 @@ -# -# Copyright (C) 2019 IOPSYS -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=libbbfdm -PKG_VERSION:=1.0-2020-16-05 -PKG_FIXUP:=autoreconf -PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git -PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION=x -PKG_RELEASE=$(PKG_SOURCE_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) - -PKG_MAINTAINER:=IOPSYS Dev -CONFIG_SRC_TREE_OVERRIDE:=y - -PKG_LICENSE:=LGPL-2.1 -PKG_LICENSE_FILES:=LICENSE - -include $(INCLUDE_DIR)/package.mk - -define Package/libbbfdm - SECTION:=libs - CATEGORY:=Libraries - TITLE:=Library for broadband-forum data model - DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libcurl -endef - -define Package/libbbfdm/config - source "$(SOURCE)/Config_bbfdm.in" -endef - -define Package/libbbfdm/description - Test description will update later. -endef - -TARGET_CFLAGS += \ - -DBBF_VENDOR_LIST=\\\"$(CONFIG_BBF_VENDOR_LIST)\\\" \ - -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\" \ - -D_GNU_SOURCE -D_AADJ - -ifeq ($(CONFIG_BBF_TR181),y) -CONFIGURE_ARGS += \ - --enable-tr181 -endif - -ifeq ($(CONFIG_BBF_TR104),y) -CONFIGURE_ARGS += \ - --enable-tr104 -endif - -ifeq ($(CONFIG_BBF_TR143),y) -CONFIGURE_ARGS += \ - --enable-tr143 -endif - -ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y) -CONFIGURE_ARGS += \ - --enable-vendor-extension - -CONFIGURE_ARGS += \ - BBF_VENDOR_LIST="$(CONFIG_BBF_VENDOR_LIST)" - -endif ##CONFIG_BBF_VENDOR_EXTENSION - -ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y) -CONFIGURE_ARGS += \ - --enable-json-plugin -endif - -ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y) -CONFIGURE_ARGS += \ - --enable-shared-library -endif - -define Package/libbbfdm/install - $(INSTALL_DIR) $(1)/lib - $(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/ - $(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/ - $(INSTALL_DIR) $(1)/etc/bbfdm - $(INSTALL_DIR) $(1)/etc/bbfdm/dmmap - $(INSTALL_DIR) $(1)/usr/share/bbfdm - $(CP) $(PKG_BUILD_DIR)/scripts/* $(1)/usr/share/bbfdm -endef - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include - $(INSTALL_DIR) $(1)/usr/include/libbbfdm $(1)/usr/include/libbbf_api - $(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/ - $(CP) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/ - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/ - $(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.{a,so*} $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,libbbfdm)) diff --git a/openwrt/bbf/git-src b/openwrt/bbf/git-src deleted file mode 120000 index a49c86c1..00000000 --- a/openwrt/bbf/git-src +++ /dev/null @@ -1 +0,0 @@ -../../.git/ \ No newline at end of file diff --git a/schemas/dmtest.json b/schemas/dmtest.json deleted file mode 100644 index e362abf3..00000000 --- a/schemas/dmtest.json +++ /dev/null @@ -1,621 +0,0 @@ -{ - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": [ - "Device.", - "Device.DeviceInfo.Manufacturer", - "Device.WiFi.SSID.1.", - "Device.WiFi." - ] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "examples": [ - "Device.DHCPv4.Client.{i}.Renew()", - "Device.FactoryReset()" - ] - }, - "operate_type_t": { - "type": "string", - "enum": [ - "async", - "sync" - ] - }, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://dev.iopsys.eu/iopsys/uspd/-/blob/devel/docs/api/dmtest.json", - "type": "object", - "title": "dmtest", - "object": "user defined dynamic DM exposed on ubus", - "additionalProperties": false, - "properties": { - "get_supported_dm": { - "title": "Get list of supported datamodel parameters", - "description": "Schema will have all the nodes/objects supported by libbbf", - "type": "object", - "required": [ - "output" - ], - "properties": { - "input": { - "type": "object", - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "next-level": { - "type": "boolean", - "description": "gets only next level objects if true" - }, - "schema_type": { - "type": "integer", - "minimum": 0, - "maximum": 3, - "description": "0-All, 1-Parameter only 2- Event only 3- operate only" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "cmd_type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - }, - "out": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - } - }, - "required": [ - "parameter", - "type" - ] - } - ] - } - } - } - ] - } - } - }, - "get": { - "title": "Get handler", - "description": "Query the datamodel object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "value", - "type" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ] - } - } - } - ] - } - } - }, - "add_object": { - "title": "Add a new object instance", - "description": "Add a new object in multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "status" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - }, - "instance": { - "type": "string" - } - } - } - ] - } - } - } - ] - } - } - }, - "del_object": { - "title": "Delete object instance", - "description": "Delete a object instance from multi instance object", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - } - } - }, - "output": { - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter", - "status" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - ] - } - } - }, - "set": { - "title": "Set handler", - "description": "Set values of datamodel object element", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path", - "value" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "proto": { - "$ref": "#/definitions/proto_t" - }, - "value": { - "description": "value of the object element provided in path, path should contains valid writable object element", - "type": "string", - "examples": [ - "{\"path\":\"Device.WiFi.SSID.1.SSID\", \"value\":\"test_ssid\"}", - "{\"path\":\"Device.WiFi.SSID.2.Enable\", \"value\":\"true\"}", - "{\"path\":\"Device.WiFi.SSID.1.Enable\", \"value\":\"0\"}" - ] - } - } - }, - "output": { - "oneof": [ - { - "type": "object", - "properties": { - "status": { - "const": "1" - } - } - }, - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "required": [ - "parameters" - ], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "parameter" - ], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - ] - } - } - }, - "operate": { - "title": "Operate handler", - "description": "Operate on object element provided in path", - "type": "object", - "required": [ - "input", - "output" - ], - "properties": { - "input": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/operate_path_t" - }, - "input": { - "description": "Input arguments for the operate command as defined in TR-181-2.13", - "examples": [ - "{\"path\":\"Device.IP.Diagnostics.IPPing\\(\\)\", \"input\":{\"Host\":\"iopsys.eu\"}}" - ], - "type": "object", - "properties": {} - } - } - }, - "output": { - "type": "object", - "required": [ - "Results" - ], - "properties": { - "Results": { - "type": "array", - "items": [ - { - "type": "object", - "required": [ - "path" - ], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "parameters": { - "description": "Output will have status for sync commands and for async commands parameters as defined in TR-181-2.13", - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "type": "string" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ], - "examples": [ - "{\n\t\"status\": true}", - "{\n\t\"AverageResponseTime\": \"0\",\n\t\"AverageResponseTimeDetailed\": \"130\",\n\t\"FailureCount\": \"0\",\n\t\"MaximumResponseTime\": \"0\",\n\t\"MaximumResponseTimeDetailed\": \"140\",\n\t\"MinimumResponseTime\": \"0\",\n\t\"MinimumResponseTimeDetailed\": \"120\",\n\t\"SuccessCount\": \"3\"}" - ] - } - } - } - ] - } - } - } - } - }, - "transaction_start": { - "title": "Start a transaction before set/add/del operations", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "output" - ] - }, - "transaction_abort": { - "title": "Aborts an on-going transaction", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "output" - ] - }, - "transaction_commit": { - "title": "Commits an on-going transaction", - "type": "object", - "properties": { - "input": { - "type": "object", - "properties": {} - }, - "output": { - "type": "object", - "properties": { - "status": { - "type": "boolean" - } - }, - "required": [ - "status" - ] - } - }, - "required": [ - "output" - ] - } - } -} diff --git a/schemas/dmtest.md b/schemas/dmtest.md deleted file mode 100644 index 1fa0dcaf..00000000 --- a/schemas/dmtest.md +++ /dev/null @@ -1,1933 +0,0 @@ -# dmtest Schema - -| Custom Properties | Additional Properties | -| ----------------- | --------------------- | -| Forbidden | Forbidden | - -# dmtest - -| List of Methods | -| ----------------------------------------- | -| [add_object](#add_object) | Method | dmtest (this schema) | -| [del_object](#del_object) | Method | dmtest (this schema) | -| [get](#get) | Method | dmtest (this schema) | -| [get_supported_dm](#get_supported_dm) | Method | dmtest (this schema) | -| [operate](#operate) | Method | dmtest (this schema) | -| [set](#set) | Method | dmtest (this schema) | -| [transaction_abort](#transaction_abort) | Method | dmtest (this schema) | -| [transaction_commit](#transaction_commit) | Method | dmtest (this schema) | -| [transaction_start](#transaction_start) | Method | dmtest (this schema) | - -## add_object - -### Add a new object instance - -Add a new object in multi instance object - -`add_object` - -- type: `Method` - -### add_object Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| -------- | ------ | ------------ | -------- | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### path - -Complete object element path as per TR181 - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.1. -``` - -```json -Device.WiFi. -``` - -#### 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](#add_object-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call dmtest add_object {"path":"Lorem aliqua laboris","proto":"cwmp"} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": ["", "dmtest", "add_object", { "path": "Lorem aliqua laboris", "proto": "cwmp" }] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "required": ["parameters"], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": ["parameter", "status"], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be determined by fault code" - }, - "instance": { - "type": "string" - } - } - } - ] - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "examples": ["Device.DHCPv4.Client.{i}.Renew()", "Device.FactoryReset()"] - }, - "operate_type_t": { - "type": "string", - "enum": ["async", "sync"] - }, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"oneof\":[{\"fault\":7961},{\"parameters\":[{\"parameter\":\"aliquip ut laborum tempor\",\"status\":true,\"fault\":7103,\"instance\":\"a\"}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"examples\":[\"Device.DHCPv4.Client.{i}.Renew()\",\"Device.FactoryReset()\"]},\"operate_type_t\":{\"type\":\"string\",\"enum\":[\"async\",\"sync\"]},\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "fault": 7961 }, - { "parameters": [{ "parameter": "aliquip ut laborum tempor", "status": true, "fault": 7103, "instance": "a" }] } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "examples": ["Device.DHCPv4.Client.{i}.Renew()", "Device.FactoryReset()"] - }, - "operate_type_t": { "type": "string", "enum": ["async", "sync"] }, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` - -## del_object - -### Delete object instance - -Delete a object instance from multi instance object - -`del_object` - -- type: `Method` - -### del_object Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| -------- | ------ | ------------ | -------- | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### path - -Complete object element path as per TR181 - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.1. -``` - -```json -Device.WiFi. -``` - -#### 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](#del_object-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call dmtest del_object {"path":"ut officia pariatur","proto":"cwmp"} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": ["", "dmtest", "del_object", { "path": "ut officia pariatur", "proto": "cwmp" }] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "required": ["parameters"], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": ["parameter", "status"], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "examples": ["Device.DHCPv4.Client.{i}.Renew()", "Device.FactoryReset()"] - }, - "operate_type_t": { - "type": "string", - "enum": ["async", "sync"] - }, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"oneof\":[{\"fault\":7423},{\"parameters\":[{\"parameter\":\"laborum consequat elit in\",\"status\":true,\"fault\":8381}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"examples\":[\"Device.DHCPv4.Client.{i}.Renew()\",\"Device.FactoryReset()\"]},\"operate_type_t\":{\"type\":\"string\",\"enum\":[\"async\",\"sync\"]},\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "fault": 7423 }, - { "parameters": [{ "parameter": "laborum consequat elit in", "status": true, "fault": 8381 }] } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "examples": ["Device.DHCPv4.Client.{i}.Renew()", "Device.FactoryReset()"] - }, - "operate_type_t": { "type": "string", "enum": ["async", "sync"] }, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` - -## get - -### Get handler - -Query the datamodel object - -`get` - -- type: `Method` - -### get Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| -------- | ------ | ------------ | -------- | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | - -#### path - -Complete object element path as per TR181 - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.1. -``` - -```json -Device.WiFi. -``` - -#### 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](#get-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -### Ubus CLI Example - -``` -ubus call dmtest get {"path":"elit in dolore enim culpa","proto":"both"} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": ["", "dmtest", "get", { "path": "elit in dolore enim culpa", "proto": "both" }] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": ["parameter", "value", "type"], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - } - } - } - ] - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "examples": ["Device.DHCPv4.Client.{i}.Renew()", "Device.FactoryReset()"] - }, - "operate_type_t": { - "type": "string", - "enum": ["async", "sync"] - }, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"oneof\":[{\"fault\":8800},{\"parameters\":[{\"parameter\":\"cupidatat\",\"value\":\"dolor in pariatur\",\"type\":\"xsd:event\"}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"examples\":[\"Device.DHCPv4.Client.{i}.Renew()\",\"Device.FactoryReset()\"]},\"operate_type_t\":{\"type\":\"string\",\"enum\":[\"async\",\"sync\"]},\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "fault": 8800 }, - { "parameters": [{ "parameter": "cupidatat", "value": "dolor in pariatur", "type": "xsd:event" }] } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "examples": ["Device.DHCPv4.Client.{i}.Renew()", "Device.FactoryReset()"] - }, - "operate_type_t": { "type": "string", "enum": ["async", "sync"] }, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` - -## get_supported_dm - -### Get list of supported datamodel parameters - -Schema will have all the nodes/objects supported by libbbf - -`get_supported_dm` - -- type: `Method` - -### get_supported_dm Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | Optional | -| `output` | | **Required** | - -#### input - -`input` - -- is optional -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| ------------- | ------- | -------- | -------- | -| `next-level` | boolean | Optional | | -| `path` | string | Optional | | -| `proto` | string | Optional | `"both"` | -| `schema_type` | integer | Optional | | - -#### next-level - -gets only next level objects if true - -`next-level` - -- is optional -- type: `boolean` - -##### next-level Type - -`boolean` - -#### path - -Complete object element path as per TR181 - -`path` - -- is optional -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.1. -``` - -```json -Device.WiFi. -``` - -#### 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](#get_supported_dm-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -#### schema_type - -0-All, 1-Parameter only 2- Event only 3- operate only - -`schema_type` - -- is optional -- type: `integer` - -##### schema_type Type - -`integer` - -- minimum value: `0` -- maximum value: `3` - -### Ubus CLI Example - -``` -ubus call dmtest get_supported_dm {"path":"ut nostrud do e","proto":"usp","next-level":false,"schema_type":2} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": [ - "", - "dmtest", - "get_supported_dm", - { "path": "ut nostrud do e", "proto": "usp", "next-level": false, "schema_type": 2 } - ] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "$ref": "#/definitions/schema_path_t" - }, - "writable": { - "$ref": "#/definitions/boolean_t" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "cmd_type": { - "$ref": "#/definitions/operate_type_t" - }, - "in": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - }, - "out": { - "type": "array", - "uniqueItems": true, - "items": [ - { - "type": "string" - } - ] - } - }, - "required": ["parameter", "type"] - } - ] - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "examples": ["Device.DHCPv4.Client.{i}.Renew()", "Device.FactoryReset()"] - }, - "operate_type_t": { - "type": "string", - "enum": ["async", "sync"] - }, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"oneof\":[{\"fault\":8801},{\"parameters\":[{\"parameter\":\"qui irure au\",\"type\":\"xsd:dateTime\",\"writable\":\"1\",\"cmd_type\":\"async\",\"in\":[\"ipsum occaecat labore Ut\"],\"out\":[\"Excepteur dolore cupidatat aliquip\"]}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"examples\":[\"Device.DHCPv4.Client.{i}.Renew()\",\"Device.FactoryReset()\"]},\"operate_type_t\":{\"type\":\"string\",\"enum\":[\"async\",\"sync\"]},\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "fault": 8801 }, - { - "parameters": [ - { - "parameter": "qui irure au", - "type": "xsd:dateTime", - "writable": "1", - "cmd_type": "async", - "in": ["ipsum occaecat labore Ut"], - "out": ["Excepteur dolore cupidatat aliquip"] - } - ] - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "examples": ["Device.DHCPv4.Client.{i}.Renew()", "Device.FactoryReset()"] - }, - "operate_type_t": { "type": "string", "enum": ["async", "sync"] }, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` - -## operate - -### Operate handler - -Operate on object element provided in path - -`operate` - -- type: `Method` - -### operate Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | object | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | Optional | -| `path` | string | **Required** | - -#### input - -Input arguments for the operate command as defined in TR-181-2.13 - -`input` - -- is optional -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ---- | -------- | -| None | None | None | - -##### input Example - -```json -{ "path": "Device.IP.Diagnostics.IPPing()", "input": { "Host": "iopsys.eu" } } -``` - -#### path - -Datamodel object schema path - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device.DHCPv4.Client.{i}.Renew() -``` - -```json -Device.FactoryReset() -``` - -### Ubus CLI Example - -``` -ubus call dmtest operate {"path":"nonesse nostrud anim","input":{}} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": ["", "dmtest", "operate", { "path": "nonesse nostrud anim", "input": {} }] -} -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| --------- | ----- | ------------ | -| `Results` | array | **Required** | - -#### Results - -`Results` - -- is **required** -- type: `array` - -##### Results Type - -Array type: `array` - -All items must be of the type: Unknown type ``. - -```json -{ - "type": "array", - "items": [ - { - "type": "object", - "required": ["path"], - "properties": { - "path": { - "$ref": "#/definitions/path_t" - }, - "parameters": { - "description": "Output will have status for sync commands and for async commands parameters as defined in TR-181-2.13", - "type": "array", - "items": [ - { - "type": "object", - "properties": { - "parameter": { - "type": "string" - }, - "value": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/type_t" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ], - "examples": [ - "{\n\t\"status\": true}", - "{\n\t\"AverageResponseTime\": \"0\",\n\t\"AverageResponseTimeDetailed\": \"130\",\n\t\"FailureCount\": \"0\",\n\t\"MaximumResponseTime\": \"0\",\n\t\"MaximumResponseTimeDetailed\": \"140\",\n\t\"MinimumResponseTime\": \"0\",\n\t\"MinimumResponseTimeDetailed\": \"120\",\n\t\"SuccessCount\": \"3\"}" - ] - } - } - } - ], - "simpletype": "`array`" -} -``` - -### Output Example - -```json -{ - "Results": [ - { - "path": "velit sit veniam magna et", - "parameters": [ - { "parameter": "ullamco Duis do eiusmod eu", "value": "aute velit sit", "type": "xsd:event", "fault": 7524 } - ] - } - ] -} -``` - -## set - -### Set handler - -Set values of datamodel object element - -`set` - -- type: `Method` - -### set Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------ | ------------ | -| `input` | object | **Required** | -| `output` | | **Required** | - -#### input - -`input` - -- is **required** -- type: `object` - -##### input Type - -`object` with following properties: - -| Property | Type | Required | Default | -| -------- | ------ | ------------ | -------- | -| `path` | string | **Required** | | -| `proto` | string | Optional | `"both"` | -| `value` | string | **Required** | | - -#### path - -Complete object element path as per TR181 - -`path` - -- is **required** -- type: reference - -##### path Type - -`string` - -- minimum length: 6 characters -- maximum length: 1024 characters - -##### path Examples - -```json -Device. -``` - -```json -Device.DeviceInfo.Manufacturer -``` - -```json -Device.WiFi.SSID.1. -``` - -```json -Device.WiFi. -``` - -#### 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](#set-known-values). - -##### proto Known Values - -| Value | -| ----- | -| usp | -| cwmp | -| both | - -#### value - -value of the object element provided in path, path should contains valid writable object element - -`value` - -- is **required** -- type: `string` - -##### value Type - -`string` - -##### value Examples - -```json -{ "path": "Device.WiFi.SSID.1.SSID", "value": "test_ssid" } -``` - -```json -{ "path": "Device.WiFi.SSID.2.Enable", "value": "true" } -``` - -```json -{ "path": "Device.WiFi.SSID.1.Enable", "value": "0" } -``` - -### Ubus CLI Example - -``` -ubus call dmtest set {"path":"ea consecte","value":"et ipsum velit","proto":"both"} -``` - -### JSONRPC Example - -```json -{ - "jsonrpc": "2.0", - "id": 0, - "method": "call", - "params": ["", "dmtest", "set", { "path": "ea consecte", "value": "et ipsum velit", "proto": "both" }] -} -``` - -#### output - -`output` - -- is **required** -- type: complex - -##### output Type - -Unknown type ``. - -```json -{ - "oneof": [ - { - "type": "object", - "properties": { - "status": { - "const": "1" - } - } - }, - { - "fault": { - "$ref": "#/definitions/fault_t", - "Description": "Any discrepancy in input will result in fault. The type of fault can be identified by fault code" - } - }, - { - "type": "object", - "required": ["parameters"], - "properties": { - "parameters": { - "type": "array", - "items": [ - { - "type": "object", - "required": ["parameter"], - "properties": { - "parameter": { - "$ref": "#/definitions/path_t" - }, - "status": { - "type": "boolean" - }, - "fault": { - "$ref": "#/definitions/fault_t" - } - } - } - ] - } - } - } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "examples": ["Device.DHCPv4.Client.{i}.Renew()", "Device.FactoryReset()"] - }, - "operate_type_t": { - "type": "string", - "enum": ["async", "sync"] - }, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { - "type": "integer", - "minimum": 7000, - "maximum": 9050 - } - }, - "out": "{\"oneof\":[{\"status\":\"1\"},{\"fault\":7434},{\"parameters\":[{\"parameter\":\"consequat in et cillum voluptate\",\"status\":true,\"fault\":7297}]}],\"definitions\":{\"path_t\":{\"description\":\"Complete object element path as per TR181\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"examples\":[\"Device.\",\"Device.DeviceInfo.Manufacturer\",\"Device.WiFi.SSID.1.\",\"Device.WiFi.\"]},\"schema_path_t\":{\"description\":\"Datamodel object schema path\",\"type\":\"string\",\"minLength\":6,\"maxLength\":1024,\"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\":1024,\"examples\":[\"Device.DHCPv4.Client.{i}.Renew()\",\"Device.FactoryReset()\"]},\"operate_type_t\":{\"type\":\"string\",\"enum\":[\"async\",\"sync\"]},\"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\",\"xsd:command\",\"xsd:event\"]},\"fault_t\":{\"type\":\"integer\",\"minimum\":7000,\"maximum\":9050}}}", - "simpletype": "complex" -} -``` - -### Output Example - -```json -{ - "oneof": [ - { "status": "1" }, - { "fault": 7434 }, - { "parameters": [{ "parameter": "consequat in et cillum voluptate", "status": true, "fault": 7297 }] } - ], - "definitions": { - "path_t": { - "description": "Complete object element path as per TR181", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "examples": ["Device.", "Device.DeviceInfo.Manufacturer", "Device.WiFi.SSID.1.", "Device.WiFi."] - }, - "schema_path_t": { - "description": "Datamodel object schema path", - "type": "string", - "minLength": 6, - "maxLength": 1024, - "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": 1024, - "examples": ["Device.DHCPv4.Client.{i}.Renew()", "Device.FactoryReset()"] - }, - "operate_type_t": { "type": "string", "enum": ["async", "sync"] }, - "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", - "xsd:command", - "xsd:event" - ] - }, - "fault_t": { "type": "integer", "minimum": 7000, "maximum": 9050 } - } -} -``` - -## transaction_abort - -### Aborts an on-going transaction - -`transaction_abort` - -- type: `Method` - -### transaction_abort 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 | -| -------- | ---- | -------- | -| None | None | None | - -### Ubus CLI Example - -``` -ubus call dmtest transaction_abort {} -``` - -### JSONRPC Example - -```json -{ "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["", "dmtest", "transaction_abort", {}] } -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------- | ------------ | -| `status` | boolean | **Required** | - -#### status - -`status` - -- is **required** -- type: `boolean` - -##### status Type - -`boolean` - -### Output Example - -```json -{ "status": true } -``` - -## transaction_commit - -### Commits an on-going transaction - -`transaction_commit` - -- type: `Method` - -### transaction_commit 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 | -| -------- | ---- | -------- | -| None | None | None | - -### Ubus CLI Example - -``` -ubus call dmtest transaction_commit {} -``` - -### JSONRPC Example - -```json -{ "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["", "dmtest", "transaction_commit", {}] } -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------- | ------------ | -| `status` | boolean | **Required** | - -#### status - -`status` - -- is **required** -- type: `boolean` - -##### status Type - -`boolean` - -### Output Example - -```json -{ "status": false } -``` - -## transaction_start - -### Start a transaction before set/add/del operations - -`transaction_start` - -- type: `Method` - -### transaction_start 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 | -| -------- | ---- | -------- | -| None | None | None | - -### Ubus CLI Example - -``` -ubus call dmtest transaction_start {} -``` - -### JSONRPC Example - -```json -{ "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["", "dmtest", "transaction_start", {}] } -``` - -#### output - -`output` - -- is **required** -- type: `object` - -##### output Type - -`object` with following properties: - -| Property | Type | Required | -| -------- | ------- | ------------ | -| `status` | boolean | **Required** | - -#### status - -`status` - -- is **required** -- type: `boolean` - -##### status Type - -`boolean` - -### Output Example - -```json -{ "status": false } -```