Type
id of the cloud/control panel
Network Zone id
Network Zone Label
Storage Zone label
Storage Zone id
Failover disabled - Bool
Hypervisor type
Memory guarantee - Bool
Create a new resource, specifying a credentials Hash which should include user and pass as per OnApp CP documentation.
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
Get a list of VMs provisioned on this OnApp Hypervisor Zone by the market
filter Exact match filters
OnappMarket::API::Response - data will contain an Array of VM ids if is_ok?
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 a VM
if a Supplier
OnappMarket::API::Response - Response
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 a VM
if a Supplier
OnappMarket::API::Response - Response
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 data about a resource for forwarding to interested traders
type - type of the event
data - data associated with the event
OnappMarket::API::Response - object/hash of JSON billing data if is_ok?
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