deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject API driver methods and parameters
Date Fri, 12 Nov 2010 13:11:21 GMT
Hi, I am (finally) back onto working on the blobstore. I wanted to get 
some opinions (alternatively, find out if anyone feels strongly either 
way) about the driver method signatures. This is not terribly important 
but its a choice all the same.

So far most driver methods (i.e. defined in base_driver.rb) look like:

" def method_name(credentials, opts=nil) "

where opts hash will contain any of the required parameters (e.g. an 
'id' parameter for filtering a list of images). I have tried to follow 
this style as much as possible for blobstore thus far. However it seems 
silly for some methods not to explicate the parameters.

An obvious one is 'create_blob' where you need to supply the bucket 
name, blob name and the blob data. So I guess the question is should we 

"def create_blob(credentials, bucket_id, blob_id, blob_data)"


"def create_blob(credentials, opts = nil)"
{and  where opts: opts['bucket_id'], opts['blob_id'], opts['blob_data']}


View raw message