Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Generic Objects - Bill Wei - ManageIQ Design Summit 2016

354 views

Published on

Generic Objects by Bill Wei at ManageIQ Design Summit 2016

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Generic Objects - Bill Wei - ManageIQ Design Summit 2016

  1. 1. Generic Objects Bill Wei - Red Hat @bzwei
  2. 2. Agenda What is a generic object? Why generic objects are needed? Who can access generic objects? Use cases Development status Future Limitations
  3. 3. What is a Generic Object It is an “object” It is like an object It has a definition Define in runtime Each type has an unique name and user defined attributes/relationships Stored in four tables - one for definitions, one for objects, one for attributes, and one for relationships
  4. 4. What is a Generic Object
  5. 5. Create a definition
  6. 6. Create a generic object from a definition
  7. 7. Use the generic object
  8. 8. Why generic objects are needed Talk topic: Generic objects in AE Model http://talk.manageiq.org/t/generic-objects-in-ae-model/252 Good for quickly adding capability of collecting and provisioning resources that are not yet officially supported in ManageIQ Examples include Load Balancer or RDS Database A basis for modeling official ManageIQ support
  9. 9. generic_objects g_o_definitions Who can access generic objects Engine DRb DRb Script (CRUD) Postgres Automate Controller UI REST client
  10. 10. Use Case: Create generic object definitions Create/List/Update/Delete generic object definitions through UI It has a type name, an icon representation, and a description It defines type specific attributes It defines associations to other resources Update/deletion of definitions that already have instances is limited
  11. 11. Use Case: Provider resource provisioning through service Purpose: Provision a new resource type that is not supported in ManageIQ ● Create a Generic Catalog Item ● Catalog item runs a state machine with typical pre-provisioning, provisioning, check-provisioned, post-provisioning steps ● Create the resource in the provider through API (for example, AWS RDS API) ● Create a corresponding generic object in ManageIQ ● Add associations to other objects (Generic or Rails Models) ● Resulting generic objects can be shown in UI or reports, with
  12. 12. Use Case: Process generic objects through automate Generic objects can be shown in ManageIQ UI User can add a button to a generic object The button is connected to an automate entry-point where the generic object can be processed
  13. 13. Use Case: Use generic objects in a service Generic objects can be directly accessed or passed in as a parameter in any step of an existing service state machine, for example, the pre-provisioning, provisioning, or post- provisioning method of a vm provisioning.
  14. 14. Development Progress Current: GenericObjectDefinition with attributes GenericObject with attributes setters/getters Coming soon: Expose in automate Simple relationships Direct many-to-many Simple querying REST API Full CRUD for definitions
  15. 15. Examples User script to create a generic object and get/set attributes
  16. 16. Examples - REST API endpoints Definitions: /api/object_definitions/ Objects: /api/objects/
  17. 17. Examples: CRUD on generic object definitions Create POST /api/object_definitions/ POST /api/object_definitions/ via action: "create" Query All Definitions GET /api/object_definitions/ Query One Definition GET /api/object_definitions/:id GET /api/object_definitions/:name Update Multiple Definitions POST /api/object_definitions action: "edit" Update Definition POST /api/object_definitions/[:id|:name] action: "edit" PUT /api/object_definitions/[:id|:name] Delete a definition DELETE /api/object_definitions/[:id|:name] or POST /api/object_definitions/[:id|:name] action: "delete" Note: Must fail if objects of this type exists.
  18. 18. Example: CRUD on generic objects Create POST /api/object_definition/[:id|:name]/objects or POST /api/objects Query All Objects GET /api/objects Query Objects of same Definition GET /api/object_definitions/[:id|:name]/objects GET /api/object_definitions/[:id|:name]?expand=objects possibly: GET /api/objects?filter[]=object_definition.name='<name>' Update an object POST /api/objects/:id action: "edit" PUT /api/objects/:id Delete an object DELETE /api/objects/:id POST /api/objects/:id action: "delete" Delete multiple objects POST /api/objects action: "delete"
  19. 19. Future Can be tagged Can be reported on Can be used for chargeback Can have an associated graphic image Can be used in widgets
  20. 20. Limitations It is an active record but not true active record Updates to the generic object definition (custom attributes and relationships) have no protection for existing generic objects Limited querying capability Simple relationships Performance

×