class OnappMarket::Resource::Compute

A generic ‘hypervisor’ resource to define an individual hypervisor, for example, a hypervisor zone from an OnApp CP, or a more generic interface such as to RackSpace OpenStack or EC2. Any resource always has credentials which are used to authenticate when a VM is created by the market on this ‘hypervisor’ resource.

Constants

TYPE

Attributes

backup_supported[RW]

Is backup of VMs supported?

cpus[RW]

Number of cpus available

credentials[RW]

Hash of credentials required to provision a VM (likely specific to a hypervisor)

store_size[RW]

Total storage size

total_memory[RW]

Total hypervisor memory

Public Class Methods

new(hash = {}, type = nil) click to toggle source

Create a new ‘hypervisor’ resource with given credentials

Attributes

  • hash - Hash of attributes to apply

  • type - type for serialization help

# File lib/onapp_market/resource/compute.rb, line 28
def initialize(hash = {}, type = nil)
  type = TYPE if type == nil
  super(hash, type)
  restrict :credentials, [:supplier, :admin, :ro_admin]
end

Public Instance Methods

get_flavors() click to toggle source

Get the flavors supported by this compute resource

Returns

OnappMarket::API::Response, data contains array of flavors if successful

# File lib/onapp_market/resource/compute.rb, line 38
def get_flavors
  @api.get("/compute/#{self.resource_id}/flavors")
end