documentation.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From DcConfiguration and commands in BIND10
  2. Specification files
  3. -------------------
  4. There is only 1 real mandatory element in the specification, and that is the name of the module.
  5. The simplest specification file therefore looks like this:
  6. {
  7. "module_spec": {
  8. "module_name": "my_module"
  9. }
  10. }
  11. This is the specification for a module that has no commands and no configuration options.
  12. my_module is the name of the module, and also the name of the command channel it will automatically subscribe to.
  13. To add a simple configuration option, let's say an int, we make it the following:
  14. {
  15. "module_spec": {
  16. "module_name": "my_module"
  17. "config_data": [
  18. { "item_name": "some_number",
  19. "item_type": "integer",
  20. "item_optional": False,
  21. "item_default": 123
  22. }
  23. ]
  24. }
  25. }
  26. "config_data" contains a list of elements of the form
  27. { "item_name": "name"
  28. "item_type": "integer|real|boolean|string|list|map"
  29. "item_optional": true|false
  30. "item_default": <depends on type>
  31. }
  32. You can provide as much options as you need, and can also make compound elements
  33. through "list_item_spec" for lists and "map_item_spec" for maps. See [link] for the
  34. full documentation on specification files.