2011-01-28 19:00:29 -05:00
|
|
|
require 'fog/core/collection'
|
2011-01-30 18:11:36 -05:00
|
|
|
require 'fog/compute/models/go_grid/password'
|
2011-01-28 19:00:29 -05:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class GoGrid
|
2011-01-28 19:00:29 -05:00
|
|
|
|
|
|
|
class Passwords < Fog::Collection
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
model Fog::Compute::GoGrid::Password
|
2011-01-28 19:00:29 -05:00
|
|
|
|
|
|
|
def all
|
|
|
|
data = connection.support_password_list.body['list']
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def bootstrap(new_attributes = {})
|
|
|
|
password = create(new_attributes)
|
|
|
|
password.wait_for { ready? }
|
|
|
|
password
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(id)
|
|
|
|
#if server_id && server = connection.grid_server_get(server_id).body['list']
|
|
|
|
if id && server = connection.support_password_get(id).body['list']
|
|
|
|
new(server)
|
|
|
|
end
|
2011-06-16 19:28:54 -04:00
|
|
|
rescue Fog::Compute::GoGrid::NotFound
|
2011-01-28 19:00:29 -05:00
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|