2012-02-22 00:09:26 +08:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class OpenStack
|
|
|
|
class Tenant < Fog::Model
|
|
|
|
identity :id
|
|
|
|
|
|
|
|
attribute :description
|
|
|
|
attribute :enabled
|
|
|
|
attribute :name
|
2012-04-02 15:26:45 +08:00
|
|
|
|
2012-02-22 00:09:26 +08:00
|
|
|
def to_s
|
|
|
|
self.name
|
|
|
|
end
|
2012-03-06 14:43:02 +08:00
|
|
|
|
|
|
|
def usage(start_date, end_date)
|
|
|
|
requires :id
|
2012-12-22 23:24:36 +00:00
|
|
|
service.get_usage(self.id, start_date, end_date).body['tenant_usage']
|
2012-03-06 14:43:02 +08:00
|
|
|
end
|
2012-02-22 00:09:26 +08:00
|
|
|
end # class Tenant
|
|
|
|
end # class OpenStack
|
|
|
|
end # module Compute
|
|
|
|
end # module Fog
|