Hi Marios, Thanks for the quick reply!
> be careful with your namings+copy/paste - like > https://github.com/dkoper/deltacloud-core/commit/e93def6de7b1a088d23 > 0b32842a349059f12e88c#L6L-1 > you are defining 'import' for class CIMI::Service::SystemTemplateExport Nice catch! > > So I have added similar code for import (see url above), but > > ctx.respond_to?(cimi_import) in my self.import_url returns nil for me. > > Should I be doing this differently? Or do I need to add other code > > elsewhere for this operation to work? > > I can't see where 'cimi_import' is being defined in that commit. Line 147: https://github.com/dkoper/deltacloud-core/commit/e93def6de7b1a088d230b32 842a349059f12e88c#L3R147 > More generally, are you sure you want/need to define new Service classes > for the import/export? Can't these just be added to the System and > SystemTemplate Service classes? There may well be a legitimate reason > but it's Monday morning here so please help me out ;) (edit: see below > - > I think it does make sense, actually) I am not completely sure, but I thought all other resources with POSTs which require parameters in the body were developed that way. Only operations such as find and delete, where the resource id is part of the url, don't need them. Or am I missing something? > This is the reason you're getting the error below from the > require_relative on the Service class. The code in > lib/cimi/service/base.rb (which is where you're getting explosions) is > trying to determine the corresponding Model class - for > CIMI::Service::SystemTemplateImport for example as it says: > > uninitialized constant CIMI::Model::SystemTemplateImport > > > because the code is doing something like: > > > 33 def model_class$ > 34 CIMI::Model.const_get(name.split('::').last)$ > 35 end$ > > So, either you define a CIMI::Model::SystemTemplateImport, but I'm not > sure yet if we need that. This is the same question as above, i.e. "are > you sure you want/need to define new Service classes for the > import/export?". I can see how that would make sense though, in the same > way we have a 'MachineCreate' Model and 'MachineCreate' Service. So you > need to determine the attributes of the SystemImport model (like > 'source' ?) and continue in that way (yes, I think I just convinced > myself that creating stand-alone SystemImport model makes sense... :) ) > > > hope it helps, marios I didn't realize we had xxx_create classes in models. Thanks! Regards, Dies