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:
parent
4577a80010
commit
e7af149bb7
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue