# File lib/deltacloud.rb, line 282
    def method_missing(name, *args)
      if name.to_s =~ /create_(\w+)/
        params = args[0] if args[0] and args[0].class.eql?(Hash)
        params ||= args[1] if args[1] and args[1].class.eql?(Hash)
        params ||= {}

        # FIXME: This fixes are related to Instance model and should be
        # replaced by 'native' parameter names

        params[:realm_id] ||= params[:realm] if params[:realm]
        params[:keyname] ||= params[:key_name] if params[:key_name]

        if params[:hardware_profile] and params[:hardware_profile].class.eql?(Hash)
          params[:hardware_profile].each do |k,v|
            params["hwp_#{k}""hwp_#{k}"] ||= v
          end
        else
          params[:hwp_id] ||= params[:hardware_profile]
        end

        params[:image_id] ||= params[:image_id] || args[0] if args[0].class!=Hash

        obj = nil

        request(:post, entry_points["#{$1}s""#{$1}s"], {}, params) do |response|
          obj = base_object("#{$1}""#{$1}", response)
          # All create calls must respond 201 HTTP code
          # to indicate that resource was created.
          handle_backend_error(response) if response.code!=201
          yield obj if block_given?
        end
        return obj
      end
      raise NoMethodError
    end