1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[brightbox] ServerGroup association to Servers

This commit is contained in:
Paul Thornthwaite 2011-09-30 17:51:30 +01:00
parent 4577a80010
commit e7af149bb7

View file

@ -18,6 +18,8 @@ module Fog
attribute :default
attribute :created_at, :type => :time
attribute :server_ids, :aliases => "servers"
def save
options = {
:name => name,
@ -28,6 +30,13 @@ module Fog
true
end
def servers
srv_ids = server_ids.collect {|srv| srv["id"]}
srv_ids.collect do |srv_id|
connection.servers.get(srv_id)
end
end
# Adds specified servers to this server group
#
# @param [Array] identifiers array of server identifier strings to add