Closed slemrmartin closed 6 years ago
cc @Ladas @agrare
This PR requires Vm
and MiqTemplate
models now
Differences from miq's core:
add_collection
: first two params switched (ManageIQ::Providers::Inventory::Persister
will call super with switched params to keep compatilibility) - when builder_class not specified, base class is usedauto_model_class
: automatic derivation tries only basic classes (inflector not available) - overriden in coreauto_inventory_attributes
: base class for subtraction readers/writers methods is ActiveRecord::Base
(ApplicationRecord
not available) - overriden in coreadvanced settings removed
- MiQ configuration not related to gemreferences
and name_references
delegated from Persister
to TargetCollection
@slemrmartin hm I pictured this sort of thing belonging in a client gem rather than here.
The collector's ruby-client will be based on a json schema and probably won't even include this gem, and I don't think that the backend persisters will need the builder since it will most likely just do InventoryCollection.from_json
on each collection that is passed.
@agrare ah, no, this will be used in the persister, not in the client gem. Same as it is used in the specs, this interface will be used to define what the persister can persist. (we are getting away from using InventoryCollection as interface, since that will be refactored to smaller pieces)
Btw. it always needs to be wrapped to something bigger than just InventoryCollection.from_json
, since that inventory collection can have links to other inventory collections, so we need to init more of them (now it's all ICs under persister)
Same as it is used in the specs, this interface will be used to define what the persister can persist. (we are getting away from using InventoryCollection as interface, since that will be refactored to smaller pieces)
I'd like to get to simplifying the IC interface quickly because I think most of the builder can be simplified as well
Btw. it always needs to be wrapped to something bigger than just InventoryCollection.from_json, since that inventory collection can have links to other inventory collections, so we need to init more of them (now it's all ICs under persister)
Yes of course but it could be as simple as a collection of ICs and a to_json/from_json
I'll merge this but I want to get to refactoring the IC interface soon
Moving of IC Builder and Persister from ManageIQ's core.