Sha256: 783b046d7e6d211fbfac7c040a5c955e41e5e5315200d116788ab30f388fc259

Contents?: true

Size: 1.51 KB

Versions: 16

Compression:

Stored size: 1.51 KB

Contents

module Fog
  module Compute
    class Linode
      class Real
        # Get available data centers
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Array>:
        # TODO: docs
        def avail_datacenters
          request(
            :expects  => 200,
            :method   => 'GET',
            :query    => { :api_action => 'avail.datacenters' }
          )
        end
      end

      class Mock
        def avail_datacenters
          response = Excon::Response.new
          response.status = 200
          response.body = {
            "ERRORARRAY" => [],
            "DATA" => [
              { "LOCATION" => "Dallas, TX, USA",     "DATACENTERID" => 2,  "ABBR" => "dallas" },
              { "LOCATION" => "Fremont, CA, USA",    "DATACENTERID" => 3,  "ABBR" => "fremont" },
              { "LOCATION" => "Atlanta, GA, USA",    "DATACENTERID" => 4,  "ABBR" => "atlanta" },
              { "LOCATION" => "Newark, NJ, USA",     "DATACENTERID" => 6,  "ABBR" => "newark" },
              { "LOCATION" => "London, England, UK", "DATACENTERID" => 7,  "ABBR" => "london" },
              { "LOCATION" => "Tokyo, JP",           "DATACENTERID" => 8,  "ABBR" => "tokyo" },
              { "LOCATION" => "Singapore, SGP",      "DATACENTERID" => 9,  "ABBR" => "singapore" },
              { "LOCATION" => "Frankfurt, DE",       "DATACENTERID" => 10, "ABBR" => "frankfurt" },
            ],
            "ACTION" => "avail.datacenters"
          }
          response
        end
      end
    end
  end
end

Version data entries

16 entries across 14 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/linode/requests/compute/avail_datacenters.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/linode/requests/compute/avail_datacenters.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/linode/requests/compute/avail_datacenters.rb
fog-1.42.1 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-2.0.0 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-1.42.0 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-1.41.0 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-1.40.0 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-1.39.0 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-1.38.0 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-1.37.0 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-1.36.0 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-1.35.0 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-2.0.0.pre.0 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-1.34.0 lib/fog/linode/requests/compute/avail_datacenters.rb
fog-1.33.0 lib/fog/linode/requests/compute/avail_datacenters.rb