Class: OpenStack::Nova::Compute::ServerUsage
- Inherits:
-
Base
- Object
- ActiveResource::Base
- Base
- Common
- Base
- OpenStack::Nova::Compute::ServerUsage
- Defined in:
- lib/open_stack/nova/compute/simple_tenant_usage.rb
Overview
A server usage entry
Attributes
-
name
- The name of the server this entry is related -
vcpus
- Virtual CPU used by the server in the timespan (started_at
-ended_at
oruptime
) for this entry -
memory_mb
- Memory (MBytes) used by the server in the timespan (started_at
-ended_at
oruptime
) for this entry -
local_gb
- The amount of storage used over the uptime (GBytes) -
flavor
- The flavor id used by the server in this server usage entry -
state
- Current state for the server in this server usage entry -
uptime
- The uptime of this server in seconds -
instance_id
- Instance id of the server -
hours
- The uptime of this server in hours -
tenant_id
- The tenant id for this server usage entry
Instance Method Summary collapse
-
#ended_at ⇒ Object
The final date for this server usage entry (can be nil if the server is still alive).
-
#started_at ⇒ Object
The initial date for this server usage entry.
Methods inherited from Base
Methods inherited from Common
collection_path, custom_method_collection_url, element_path
Methods inherited from Base
Methods inherited from ActiveResource::Base
Instance Method Details
#ended_at ⇒ Object
The final date for this server usage entry (can be nil if the server is still alive)
157 158 159 160 |
# File 'lib/open_stack/nova/compute/simple_tenant_usage.rb', line 157 def ended_at return nil if @attributes[:ended_at].blank? DateTime.parse(@attributes[:ended_at] + ' UTC') end |
#started_at ⇒ Object
The initial date for this server usage entry
152 153 154 |
# File 'lib/open_stack/nova/compute/simple_tenant_usage.rb', line 152 def started_at DateTime.parse(@attributes[:started_at] + ' UTC') end |