class OnappMarket::OnApp::HypervisorZone

Represents an OnApp CP Resource as supplied to the OnApp Market

OnApp HypervisorZone

Constants

TYPE

Type

Attributes

cloud_id[RW]

id of the cloud/control panel

net_zone_id[RW]

Network Zone id

net_zone_label[RW]

Network Zone Label

store_label[RW]

Storage Zone label

store_zone_id[RW]

Storage Zone id

Deprecated Attributes (proposed to be removed)

↑ top

Attributes

failover_disabled[RW]

Failover disabled - Bool

hypervisor_type[RW]

Hypervisor type

memory_guarantee[RW]

Memory guarantee - Bool

Public Class Methods

new(hash = {}) click to toggle source

Create a new resource, specifying a credentials Hash which should include user and pass as per OnApp CP documentation.

Attributes

  • hash - Hash of attributes to apply

  • type - type for serialization help

# File lib/onapp_market/onapp/hypervisor_zone.rb, line 46
def initialize(hash = {})
  super(hash, TYPE)
  restrict [:cloud_id, :hypervisor_type, :net_zone_id, :store_zone_id], [:supplier, :admin, :ro_admin]
end

Public Instance Methods

get_vms(filter = {}) click to toggle source

Get a list of VMs provisioned on this OnApp Hypervisor Zone by the market

Attributes

  • filter Exact match filters

Returns

Roles

supplier, admin

# File lib/onapp_market/onapp/hypervisor_zone.rb, line 90
def get_vms(filter = {})
  filter[:type] = OnappMarket::OnApp::VM::TYPE
  get_instances(filter)
end
hibernate(instance_id, hot = false) click to toggle source

Hibernate a VM

  • if a Supplier

Attributes

  • instance_id - The OnApp Market VM id

  • hot - hot hibernation if true, else cold (default)

Returns

Roles

supplier, admin

# File lib/onapp_market/onapp/hypervisor_zone.rb, line 78
def hibernate(instance_id, hot = false)
  @api.get("/onapp/hypervisor_zone/#{instance_id.to_s.url_safe}/hibernate_vm", {:hot => hot})
end
shutdown_vm(instance_id) click to toggle source

Shutdown a VM

  • if a Supplier

Attributes

  • instance_id - The OnApp Market VM id

Returns

Roles

supplier, admin

# File lib/onapp_market/onapp/hypervisor_zone.rb, line 62
def shutdown_vm(instance_id)
  @api.get("/onapp/hypervisor_zone/#{instance_id.to_s.url_safe}/shutdown_vm")
end
submit_event(type, data) click to toggle source

Submit event data about a resource for forwarding to interested traders

Attributes

  • type - type of the event

  • data - data associated with the event

  • OnappMarket::API::Response - object/hash of JSON billing data if is_ok?

Roles

supplier, admin

# File lib/onapp_market/onapp/hypervisor_zone.rb, line 103
def submit_event(type, data)
  @api.post("/onapp/hypervisor_zone/#{self.resource_id.url_safe}/submit_event", {:event_type => type, :event_data => data})
end