Sha256: 8f088bd93df7cc938e1dab75b85a4e68c4bd6983d3628e75618e477a64f2d9c6

Contents?: true

Size: 1.94 KB

Versions: 79

Compression:

Stored size: 1.94 KB

Contents

module Fog
  module Compute
    class HP
      class Real

        # List all flavors (IDs and names only)
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'id'<~Integer> - Id of the flavor
        #     * 'name'<~String> - Name of the flavor
        def list_flavors
          request(
            :expects  => [200, 203],
            :method   => 'GET',
            :path     => 'flavors.json'
          )
        end

      end

      class Mock

        def list_flavors
          response = Excon::Response.new
          response.status = 200
          response.body = {
            'flavors' => [
              { 'name' => 'standard.xsmall',   'id' => 1, 'links' => [{"href"=>"http://nova1:8774/v1.1/admin/flavors/1", "rel"=>"self"}, {"href"=>"http://nova1:8774admin/flavors/1", "rel"=>"bookmark"}] },
              { 'name' => 'standard.small',    'id' => 2, 'links' => [{"href"=>"http://nova1:8774/v1.1/admin/flavors/2", "rel"=>"self"}, {"href"=>"http://nova1:8774admin/flavors/2", "rel"=>"bookmark"}] },
              { 'name' => 'standard.medium',   'id' => 3, 'links' => [{"href"=>"http://nova1:8774/v1.1/admin/flavors/3", "rel"=>"self"}, {"href"=>"http://nova1:8774admin/flavors/3", "rel"=>"bookmark"}] },
              { 'name' => 'standard.large',    'id' => 4, 'links' => [{"href"=>"http://nova1:8774/v1.1/admin/flavors/4", "rel"=>"self"}, {"href"=>"http://nova1:8774admin/flavors/4", "rel"=>"bookmark"}] },
              { 'name' => 'standard.xlarge',   'id' => 5, 'links' => [{"href"=>"http://nova1:8774/v1.1/admin/flavors/5", "rel"=>"self"}, {"href"=>"http://nova1:8774admin/flavors/5", "rel"=>"bookmark"}] },
              { 'name' => 'standard.2xlarge',  'id' => 6, 'links' => [{"href"=>"http://nova1:8774/v1.1/admin/flavors/6", "rel"=>"self"}, {"href"=>"http://nova1:8774admin/flavors/6", "rel"=>"bookmark"}] }
            ]
          }
          response
        end

      end
    end
  end
end

Version data entries

79 entries across 79 versions & 12 rubygems

Version Path
fog-1.22.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.21.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.20.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.19.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/hp/requests/compute/list_flavors.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/hp/requests/compute/list_flavors.rb