Sha256: 403e7d8964dad508e68918aabaeda3210280e3146d925fbb7b40c45a4668a04c

Contents?: true

Size: 1.93 KB

Versions: 29

Compression:

Stored size: 1.93 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

29 entries across 29 versions & 4 rubygems

Version Path
fog-1.37.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.36.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.35.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-2.0.0.pre.0 lib/fog/hp/requests/compute/list_flavors.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/hp/requests/compute/list_flavors.rb
fog-1.34.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.33.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.32.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.31.0 lib/fog/hp/requests/compute/list_flavors.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/hp/requests/compute/list_flavors.rb
fog-1.30.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.29.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.28.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.27.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.26.0 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.25.0 lib/fog/hp/requests/compute/list_flavors.rb
nsidc-fog-1.24.1 lib/fog/hp/requests/compute/list_flavors.rb
fog-1.24.0 lib/fog/hp/requests/compute/list_flavors.rb
ns-fog-1.22.11 lib/fog/hp/requests/compute/list_flavors.rb
ns-fog-1.22.10 lib/fog/hp/requests/compute/list_flavors.rb