inmanta / inmanta-core

Inmanta is an automation and orchestration tool
https://inmanta.com
Apache License 2.0
26 stars 7 forks source link

Provide stable api to access type information from the model #7741

Open edvgui opened 4 weeks ago

edvgui commented 4 weeks ago

Currently, plugins and exporter will receive proxy objects when dealing with values from the model. For basic plugins and exporters, you know exactly which type to expect, and you can simply access the attributes you care about. If you build a more generic logic however, which needs to discover the attributes of the object, it gets very complicated, and requires accessing private attributes of the proxy object.

  1. It would be nice of the proxy layer would expose the information of the type of the entity --> currently _type method
  2. It would be nice if the inmanta.ast.entity.Entity was added to the stable api (at least partially), same goes for Attribute, Relation, etc

One example of more advanced usage: https://code.inmanta.com/solutions/modules/restbase/-/blob/68289e734aaaeb39f97e3eba7bbcf6851c810acb/inmanta_plugins/restbase/schemas/one_of_object.py#L136

sanderr commented 4 weeks ago

Related thread on Slack.