deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florin Ardelian <f.ardel...@gmail.com>
Subject Re: Enable 'storage volumes'
Date Tue, 20 Nov 2012 14:12:38 GMT
Found it! The storage_volumes() method was declared private. Thanks!


On Tue, Nov 20, 2012 at 2:46 PM, marios@redhat.com <mandreou@redhat.com>wrote:

> On 20/11/12 13:29, Florin Ardelian wrote:
> > Hi Marios,
> >
> > Here's the output from curl:
> >
> > <api driver='profitbricks' version='1.0.5'>
> >   <link href='http://localhost:3001/api/realms' rel='realms'>
> >   </link>
> >   <link href='http://localhost:3001/api/drivers' rel='drivers'>
> >   </link>
> >   <link href='http://localhost:3001/api/instance_states'
> > rel='instance_states'>
> >   </link>
> >   <link href='http://localhost:3001/api/hardware_profiles'
> > rel='hardware_profiles'>
> >   </link>
> >   <link href='http://localhost:3001/api/images' rel='images'>
> >   </link>
> >   <link href='http://localhost:3001/api/instances' rel='instances'>
> >     <feature name='realm_filter' rel='index'>
> >       <param name='realm_id' />
> >     </feature>
> >   </link>
> > </api>
> >
> >
> > I am sure I have the requested methods declared:
> >
> > $ cat ./profitbricks_driver.rb | grep storage
> >     storage         ( 1 .. 64*1024 )
> >   *def storage_volumes*( credentials, opts = { } )
> >   *def create_storage_volume*(credentials, opts={})
> >     @client.store(:storage_volumes, volume)
> >   *def destroy_storage_volume*(credentials, opts={})
> >     @client.destroy(:storage_volumes, opts[:id])
> >   def attach_storage_volume(credentials, opts={})
> >   def detach_storage_volume(credentials, opts)
> >
> >
> > I cleared the browser cache and used curl. No change, I still don't see
> the
> > "Storage volumes" feature.
> >
>
> can't be sure what's going on without seeing the code - but the
> 'supported_collections' are determined by a method in base driver:
>
> server/lib/deltacloud/drivers/base_driver.rb
>
> 154     def supported_collections(credentials)$
> 155       collection_arr = []$
> 156       Deltacloud::Collections.deltacloud_modules.each do |m|$
> 157         m.collections.each do |c|$
> 158           # Get the required capability for the :index operation
> (like 'realms' or 'instance_state_machine')$
> 159           index_operation_capability =
> c.operation(:index).required_capability$
> 160           # Then use this capability to check if the 'capability'
> lambda defined$
> 161           # for the Sinatra::Base class evaluate to 'true'$
> 162           next if m.settings.respond_to?(:capability) and
> !m.settings.capability(index_operation_capability)$
> 163           yield c if block_given?$
> 164           collection_arr << c$
> 165         end$
> 166       end$
> 167 puts collection_arr$
> 168       collection_arr$
>
>
> try debugging at line 167 above, or if you don't have a debugger
> installed just use a 'puts' as I have above. What are the reported
> collections there?
>
> marios
>
>
> >
> > On Tue, Nov 20, 2012 at 12:50 PM, marios@redhat.com <mandreou@redhat.com
> >wrote:
> >
> >> On 20/11/12 12:30, Florin Ardelian wrote:
> >>> Hi guys,
> >>>
> >>> I have declared the methods needed to manipulate storages, but I don't
> >> have
> >>> the Storage volumes option in the main menu. What am I missing?
> >>>
> >>> Thanks,
> >>> Florin
> >>>
> >>
> >> weird - if you define the storage_volumes methods like:
> >>
> >> def storage_volumes
> >>
> >> def create_storage_volume
> >>
> >> etc, then this collection should be exposed. Make sure you've restarted
> >> the server after the changes, and perhaps it is a browser cache/state
> >> issue (sorry if this is silly but have been bitten by it in the past).
> >> What output do you get when you list collections with curl?
> >>
> >> curl --user "user:pass" -H "Accept: application/xml"
> >> http://localhost:3001/api
> >>
> >> marios
> >>
> >
> >
> >
>
>


-- 
+40-740-903838

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message