Sha256: 8ef12ea8a19c2658aac37767da1c7918da76cf0262672dac34929aeeb9297c79

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

# coding: utf-8

module Fog
  module Compute
    class SakuraCloud
      class Real
        def list_plans(options = {})
          request(
            :headers => {
              'Authorization' => "Basic #{@auth_encode}"
            },
            :method => 'GET',
            :path => "#{Fog::SakuraCloud::SAKURACLOUD_API_ENDPOINT}/product/server"
          )
        end
      end

      class Mock
        def list_plans(options = {})
          response = Excon::Response.new
          response.status = 200
          response.body = {
          "ServerPlans" =>
            [
            {"Index"=>0,
              "ID"=>1001,
              "Name"=>"プラン/1Core-1GB",
              "CPU"=>1,
              "MemoryMB"=>1024,
              "ServiceClass"=>"cloud/plan/1core-1gb",
              "Availability"=>"available"},
            {"Index"=>1,
              "ID"=>2001,
              "Name"=>"プラン/1Core-2GB",
              "CPU"=>1,
              "MemoryMB"=>2048,
              "ServiceClass"=>"cloud/plan/1core-2gb",
              "Availability"=>"available"}
            ]
          }
          response
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-sakuracloud-1.4.0 lib/fog/sakuracloud/requests/compute/list_plans.rb
fog-sakuracloud-1.3.3 lib/fog/sakuracloud/requests/compute/list_plans.rb