Class: OpenStack::Nova::Compute::ServerUsage

Inherits:
Base show all
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 or uptime) for this entry

  • memory_mb - Memory (MBytes) used by the server in the timespan (started_at - ended_at or uptime) 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

  • hours - The uptime of this server in hours

  • tenant_id - The tenant id for this server usage entry

Instance Method Summary collapse

Methods inherited from Base

site, site=

Methods inherited from Common

collection_path, custom_method_collection_url, element_path

Methods inherited from Base

headers

Methods inherited from ActiveResource::Base

#load

Instance Method Details

#ended_atObject

The final date for this server usage entry (can be nil if the server is still alive)



155
156
157
158
# File 'lib/open_stack/nova/compute/simple_tenant_usage.rb', line 155

def ended_at
  return nil if @attributes[:ended_at].blank?
  DateTime.parse(@attributes[:ended_at] + ' UTC')
end

#started_atObject

The initial date for this server usage entry



150
151
152
# File 'lib/open_stack/nova/compute/simple_tenant_usage.rb', line 150

def started_at
  DateTime.parse(@attributes[:started_at] + ' UTC')
end