Sha256: 92c628d4c1f2a487952989c7f1b4edf516f11fbbb8f4d7f018cd695437c7219d
Contents?: true
Size: 756 Bytes
Versions: 6
Compression:
Stored size: 756 Bytes
Contents
require 'fog/core/collection' require 'fog/compute/models/voxel/server' module Fog module Voxel class Compute class Servers < Fog::Collection model Fog::Voxel::Compute::Server def all data = connection.devices_list.body['devices'].select {|device| device['type']['id'] == '3'} load(data) end def get(device_id) if device_id && server = connection.devices_list(device_id).body['devices'] new(server.first) end rescue Fog::Service::Error => error if error.message == "The device_id passed in can't be matched to a valid device." nil else raise error end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems