2010-11-08 12:21:31 +00:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
2011-06-16 16:28:54 -07:00
|
|
|
module Compute
|
|
|
|
class Brightbox
|
2010-11-08 12:21:31 +00:00
|
|
|
|
|
|
|
class Account < Fog::Model
|
|
|
|
|
|
|
|
identity :id
|
|
|
|
attribute :url
|
2011-08-22 17:41:18 +01:00
|
|
|
attribute :resource_type
|
|
|
|
|
2010-11-08 12:21:31 +00:00
|
|
|
attribute :name
|
|
|
|
attribute :status
|
2011-08-22 17:41:18 +01:00
|
|
|
|
2010-11-08 12:21:31 +00:00
|
|
|
attribute :address_1
|
|
|
|
attribute :address_2
|
|
|
|
attribute :city
|
|
|
|
attribute :county
|
|
|
|
attribute :postcode
|
|
|
|
attribute :country_code
|
|
|
|
attribute :country_name
|
|
|
|
attribute :vat_registration_number
|
|
|
|
attribute :telephone_number
|
2011-08-18 13:13:25 +01:00
|
|
|
attribute :verified_telephone
|
|
|
|
attribute :verified_ip
|
2010-11-08 12:21:31 +00:00
|
|
|
attribute :ram_limit
|
|
|
|
attribute :ram_used
|
2011-08-16 19:04:29 +01:00
|
|
|
attribute :cloud_ips_limit
|
2011-08-18 13:13:25 +01:00
|
|
|
attribute :cloud_ips_used
|
|
|
|
attribute :load_balancers_limit
|
|
|
|
attribute :load_balancers_used
|
2010-11-08 12:21:31 +00:00
|
|
|
attribute :library_ftp_host
|
|
|
|
attribute :library_ftp_user
|
2012-11-20 11:28:14 +00:00
|
|
|
# This is always returned as nil unless after a call to reset_ftp_password
|
2010-11-08 12:21:31 +00:00
|
|
|
attribute :library_ftp_password
|
|
|
|
|
2011-08-22 17:41:18 +01:00
|
|
|
# Boolean flags
|
|
|
|
attribute :valid_credit_card
|
|
|
|
attribute :telephone_verified
|
|
|
|
|
|
|
|
# Times
|
2011-08-26 16:00:24 +01:00
|
|
|
attribute :created_at, :type => :time
|
|
|
|
attribute :verified_at, :type => :time
|
2011-08-22 17:41:18 +01:00
|
|
|
|
|
|
|
# Links - to be replaced
|
2010-11-08 12:21:31 +00:00
|
|
|
attribute :owner_id, :aliases => "owner", :squash => "id"
|
|
|
|
attribute :clients
|
|
|
|
attribute :images
|
|
|
|
attribute :servers
|
|
|
|
attribute :users
|
|
|
|
attribute :zones
|
|
|
|
|
2012-11-20 11:28:14 +00:00
|
|
|
# Resets the account's image library FTP password returning the new value
|
|
|
|
#
|
|
|
|
# @return [String] Newly issue FTP password
|
|
|
|
#
|
2010-11-08 12:21:31 +00:00
|
|
|
def reset_ftp_password
|
|
|
|
requires :identity
|
2012-11-20 11:28:14 +00:00
|
|
|
data = connection.reset_ftp_password_account(identity)
|
|
|
|
merge_attributes(data)
|
|
|
|
library_ftp_password
|
2010-11-08 12:21:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
2012-11-20 11:28:14 +00:00
|
|
|
end
|