Generic objects in AE Model

I have been working with CloudForms/ManageIQ for almost a year and had issues when my customers requested to manage other objects than VM/Host/Datastore. As pointed out in the thread “Breaking Free from Virt Management”, it would be great if ManageIQ were able to handle other objects.

So I started playing around with the object model in Automate Engine datastore. While it is not a true object model, as in Object Oriented Programming, with a few conventions one can simulate a pretty good model. For example, I created a /Objects namespace (in a custom domain) that is meant to store new object classes. In this namespace, I created a class named Objects which is meant to be the mother of all other classes in the namespace and that sets the minimum requirements.

  1. A method called get_object_type
  2. A method called get_object_provider
  3. A method called get_object_instance
  4. A relationship called attributes that points to /Attributes/${#type}/${#provider}/${#instance}
  5. A relationship called methods that points to /Methods/${#type}/${#provider}/${#instance}

This is meant to implement a Factory-ish pattern.
One just has to create a sub-namespace per object type that will contain a single class named after the type. Let’s say we want to be able to manage stacks, we create the /Objects/Stack namespace and a class called Stack within this namespace. This class is an abstract class for all the stack objects and links to /Attributes/Stack// and /Methods/Stack// (how is it interpreted by ManageIQ ?) to set the attributes and methods of a generic stack, from ManageIQ point of view.
Then one creates a class for each provider, such as AmazonWebServices or OpenStack. For example, the OpenStack class points to /Attributes/Stack/OpenStack/ and /Methods/Stack/OpenStack/. This sets the extra attributes for an AWS or OpenStack stack.
At last, one creates an instance of stack in /Objects/Stack/OpenStack that sets the real attributes.

It would look like that :

   - object.class/
       - meth: get_object_type
       - meth: get_object_provider
       - meth: get_object_instance
       - rel: attributes => /Attributes/
   - type/
        - type.class
            - attr3
            - meth3
        - provider.class/
            - attr4
            - meth4
            - instance/
                - attr5
                - meth5
   - /type
        - /provider
             - /${#instance}
   - /type
       -  provider.class/
             - method1
             - method2

I am now facing issues with inheritance in the thread Class inheritance in the AE Datastore. But knowing the behavior is a first step to adapt to it :slight_smile: And then, one can imagine that existing built-in objects could also be exposed and managed through AE Model. And we could easier extend the current model.

Going further, we have an issue when we want to manage the objects through the WebUI. This subject might have a thread on its own, to figure the future of a dynamic UI. One of my thought would be using some kind of annotation that would make the objects available through WebUI. For example, an boolean attribute called ui and a set of methods to expose the data to the UI. It would require the UI module to have a bit of logic…

It is the same for reports. The generic objects won’t be available for reporting.

Your opinions/advices/… are welcome.

Bumping the topic to get back on top of the heap :wink:

It’s in the trello board, but currently is on the backlog for priority:

It is indeed in the Trello card but it seems that commenting the card is limited. Well, I would be glad to participate to this discussion, whatever the medium…

Yeah, let’s keep the discussion here… The card links here I believe.

Ok, so from the Trello card I can’t say what is your Generic (1st class) object. Could you explain what it is meant to achieve ? This way, we could at least check whether this thread really matches the Trello card :wink:

Bumping to get an opportunity to discuss that matter :slight_smile:

Bumping again.

@Fryguy: the trello card is not updated after April 15th, when you wrote you would « try to put together a brain dump of my design ». Have you come up to do it ?