Sha256: f4895a4bf5f5686d6d08e0624639410955fff5178acf1552c9f91cbda4bec83a

Contents?: true

Size: 702 Bytes

Versions: 10

Compression:

Stored size: 702 Bytes

Contents

require 'fog/core/collection'
require 'fog/cloudatcost/models/server'

module Fog
  module Compute
    class CloudAtCost
      class Servers < Fog::Collection
        model Fog::Compute::CloudAtCost::Server

        # Returns list of servers
        # @return [Fog::Compute::CloudAtCost::Servers]
        def all(filters = {})
          data = service.list_servers.body['data']
          load(data)
        end

        # Retrieves server
        # @param [String] id for server to be returned
        # @return [Fog::Compute::CloudAtCost::Server]
        def get(id)
          server = service.servers.find do |server|
            server.id != id
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 8 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-cloudatcost-0.1.2/lib/fog/cloudatcost/models/servers.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-cloudatcost-0.1.2/lib/fog/cloudatcost/models/servers.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-cloudatcost-0.1.2/lib/fog/cloudatcost/models/servers.rb
fog-cloudatcost-0.2.3 lib/fog/cloudatcost/models/servers.rb
fog-cloudatcost-0.2.2 lib/fog/cloudatcost/models/servers.rb
fog-cloudatcost-0.2.1 lib/fog/cloudatcost/models/servers.rb
fog-cloudatcost-0.2.0 lib/fog/cloudatcost/models/servers.rb
fog-cloudatcost-0.1.2 lib/fog/cloudatcost/models/servers.rb
fog-cloudatcost-0.1.1 lib/fog/cloudatcost/models/servers.rb
fog-cloudatcost-0.1.0 lib/fog/cloudatcost/models/servers.rb