client/lib/deltacloud.rb
# Get /api and parse entry points
Get /api and parse entry points
Get / api and parse entry points
def discover_entry_points
      return if discovered?
      request(:get, @api_uri.to_s) do |response|
        api_xml = Nokogiri::XML(response)
        @driver_name = api_xml.xpath('/api').first['driver']
        @api_version = api_xml.xpath('/api').first['version']
        api_xml.css("api > link").each do |entry_point|
          rel, href = entry_point['rel'].to_sym, entry_point['href']
          @entry_points.store(rel, href)
          entry_point.css("feature").each do |feature|
            @features[rel] ||= []
            @features[rel] << feature['name'].to_sym
          end
        end
      end
      declare_entry_points_methods(@entry_points)
    end
def discover_entry_points return if discovered? request ( :get , @api_uri . to_s ) do | response | api_xml = Nokogiri :: XML ( response ) @driver_name = api_xml . xpath ( '/api' ) . first [ 'driver' ] @api_version = api_xml . xpath ( '/api' ) . first [ 'version' ] api_xml . css ( "api > link" ) . each do | entry_point | rel , href = entry_point [ 'rel' ] . to_sym , entry_point [ 'href' ] @entry_points . store ( rel , href ) entry_point . css ( "feature" ) . each do | feature | @features [ rel ] ||= [ ] @features [ rel ] << feature [ 'name' ] . to_sym end end end declare_entry_points_methods ( @entry_points ) end
Get /api and parse entry points
Get / api and parse entry points