intro.adoc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. [#entities]
  2. = Entities
  3. An entity is something that exists - a "thing", like a VM, or a Container is an entity. OliveTin allows you to then dynamically generate actions based around these entities.
  4. This is really useful if you want to generate wake on lan or poweroff actions for `server` entities, for example.
  5. A very popular use case that entities were designed for was for `container` entities - in a similar way you could generate `start`, `stop`, and `restart` container actions.
  6. Entities are just loaded from files on disk, OliveTin will also watch these files for updates while OliveTin is running, and update entities.
  7. Entity data files can contain any fields you need. Those values are available in action templates as `{{ .CurrentEntity.field }}` — for example, `{{ .CurrentEntity.status }}` or `{{ .CurrentEntity.hostname }}`.
  8. To control which fields appear in the Entities page table and entity details view, configure `properties` on the entity definition in `config.yaml`. See xref:entities/properties.adoc[Entity properties] for details.
  9. [source,yaml]
  10. ----
  11. entities:
  12. - file: /etc/OliveTin/containers.json
  13. name: container
  14. - file: /etc/OliveTin/servers.yaml
  15. name: server
  16. icon: ssh
  17. properties:
  18. - name: hostname
  19. title: Hostname
  20. - name: ip
  21. title: IP
  22. ----
  23. Entity Actions can only be used on xref:dashboards/intro.adoc[Dashboards].
  24. == What's Next?
  25. Now that you understand entities, here's how to use them effectively:
  26. * xref:entities/properties.adoc[Configure entity properties] - Choose which fields appear in the UI and API
  27. * xref:entities/icons.adoc[Configure entity icons] - Set an icon for each entity type
  28. * xref:entities/yaml.adoc[Create YAML entity files] - Learn the YAML format for entity files
  29. * xref:entities/json.adoc[Create JSON entity files] - Learn the JSON format for entity files
  30. * xref:entities/examples.adoc[View entity examples] - See complete examples of entity configurations
  31. * xref:dashboards/intro.adoc[Use entities in dashboards] - Combine entities with dashboards for dynamic action generation
  32. * xref:solutions/container-control-panel/index.adoc[Container control panel solution] - See a complete example using container entities
  33. * xref:solutions/systemd-control-panel/index.adoc[Systemd control panel solution] - See a complete example using systemd entities