class OpenStack::Nova::Compute::SimpleTenantUsage
Server
usages for a tenant
Attributes¶ ↑
-
total_hours
- Amount of hour theSimpleTenantUsage
instance is related to -
total_vcpus_usage
- Aggregated virtual cpu usage -
total_memory_mb_usage
- Aggregated memory usage (MBytes) -
total_local_gb_usage
- Aggregated storage usage (GBytes)
Public Class Methods
find_between_dates(scope, from_date, to_date)
click to toggle source
Find all server usage between the given dates
Attributes¶ ↑
-
scope
-ActiveResource
scope (:all, :first, :last, :one or an id) -
from_date
- Initial date -
to_date
- Final date
# File lib/open_stack/nova/compute/simple_tenant_usage.rb, line 96 def self.find_between_dates(scope, from_date, to_date) find(scope, :params => { :start => from_date.utc.strftime(OpenStack::DATETIME_FORMAT), :end => to_date.utc.strftime(OpenStack::DATETIME_FORMAT) }) end
find_from_date(scope, from_date)
click to toggle source
Find all server usage from a given date to the current one
Attributes¶ ↑
-
scope
-ActiveResource
scope (:all, :first, :last, :one or an id) -
from_date
- Initial date
# File lib/open_stack/nova/compute/simple_tenant_usage.rb, line 80 def self.find_from_date(scope, from_date) now = Time.now.utc find(scope, :params => { :start => from_date.utc.strftime(OpenStack::DATETIME_FORMAT), :end => now.strftime(OpenStack::DATETIME_FORMAT) }) end
Public Instance Methods
server_usages()
click to toggle source
OpenStack::Nova::Compute::ServerUsage
instances
# File lib/open_stack/nova/compute/simple_tenant_usage.rb, line 105 def server_usages @attributes[:server_usages].present? ? @attributes[:server_usages] : [] end
start()
click to toggle source
The start date for the ServerUsage
set
# File lib/open_stack/nova/compute/simple_tenant_usage.rb, line 110 def start DateTime.parse(@attributes[:start] + ' UTC') end
stop()
click to toggle source
The stop date for the ServerUsage
set
# File lib/open_stack/nova/compute/simple_tenant_usage.rb, line 115 def stop DateTime.parse(@attributes[:stop] + ' UTC') end