client/lib/deltacloud/client/methods/common.rb
# A generic method for creating a new resources
#
# - resource_name -> A resource name to create (eg. :image)
# - create_opts -> HTTP options to pass into the create operation
#
A generic method for creating a new resources
resource_name -> A resource name to create
create_opts -> HTTP options to pass into the create operation
A generic method for creating a new resources resource_name - > A resource name to create create_opts - > HTTP options to pass into the create operation
def create_resource(resource_name, create_opts={})
        no_convert_model = create_opts.delete(:no_convert_model)
        must_support! resource_name.to_s.pluralize
        response = connection.post(api_uri(resource_name.to_s.pluralize)) do |request|
          request.params = create_opts
        end
        no_convert_model ? response : model(resource_name).convert(self, response.body)
      end
def create_resource ( resource_name , create_opts = { } ) no_convert_model = create_opts . delete ( :no_convert_model ) must_support! resource_name . to_s . pluralize response = connection . post ( api_uri ( resource_name . to_s . pluralize ) ) do | request | request . params = create_opts end no_convert_model ? response : model ( resource_name ) . convert ( self , response . body ) end
A generic method for creating a new resources
 resource_name -> A resource name to create (eg.
A generic method for creating a new resources resource_name - > A resource name to create ( eg .
resource_name
<not_specific>
create_opts
<not_specific>