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

  • 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

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)



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_atObject

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