class Squall::HypervisorZone
OnApp HypervisorZone
Public Instance Methods
Public: Add a data store to a hypervisor zone.
id - ID of the hypervisor zone data_store_id - ID of the data store
Returns a Hash.
# File lib/squall/hypervisor_zone.rb, line 77 def add_data_store_join(id, data_store_id) request(:post, "/settings/hypervisor_zones/#{id}/data_store_joins.json", query: { data_store_id: data_store_id }) end
Public: Add a network to a hypervisor zone
id - ID of the hypervisor zone options - Params for updating the hypervisor zone
:network_id - ID of the network to add to the hypervisor zone :interface - Name of the appropriate network interface
Returns a Hash.
# File lib/squall/hypervisor_zone.rb, line 109 def add_network_join(id, options = {}) request(:post, "/settings/hypervisor_zones/#{id}/network_joins.json", query: { network_join: options }) end
Public: Creates a new hypervisor zone.
options - Params for updating the hypervisor zone:
:label - Label for the hypervisor zone
Returns a Hash
# File lib/squall/hypervisor_zone.rb, line 28 def create(options = {}) request(:post, "/settings/hypervisor_zones.json", query: { pack: options }) end
Public: List data store joins attached to a hypervisor zone.
id - ID of the hypervisor zone
Returns an Array.
# File lib/squall/hypervisor_zone.rb, line 66 def data_store_joins(id) response = request(:get, "/settings/hypervisor_zones/#{id}/data_store_joins.json") response.collect { |i| i['data_store_join'] } end
Public: Deletes an existing hypervisor zone.
id - ID of the hypervisor zone
Returns a Hash.
# File lib/squall/hypervisor_zone.rb, line 47 def delete(id) request(:delete, "/settings/hypervisor_zones/#{id}.json") end
Public: Updates an existing hypervisor zone.
id - ID of the hypervisor zone options - Params for updating the hypervisor zone, see `#create`
Returns a Hash.
# File lib/squall/hypervisor_zone.rb, line 38 def edit(id, options = {}) request(:put, "/settings/hypervisor_zones/#{id}.json", query: { pack: options }) end
Public: List hypervisors attached to a zone.
id - ID of the hypervisor zone
Returns an Array.
# File lib/squall/hypervisor_zone.rb, line 56 def hypervisors(id) response = request(:get, "/settings/hypervisor_zones/#{id}/hypervisors.json") response.collect { |hv| hv['hypervisor'] } end
Public: Lists all hypervisor zones.
Returns an Array.
# File lib/squall/hypervisor_zone.rb, line 7 def list response = request(:get, "/settings/hypervisor_zones.json") response.collect { |i| i['hypervisor_group'] } end
Public: List networks attached to a hypervisor zone.
id - ID of the hypervisor zone
Returns an Array.
# File lib/squall/hypervisor_zone.rb, line 96 def network_joins(id) response = request(:get, "/settings/hypervisor_zones/#{id}/network_joins.json") response.collect { |i| i['network_join'] } end
Public: Remove a data store from a hypervisor zone.
id - ID of the hypervisor zone data_store_join_id - ID of the join record
Returns a Hash.
# File lib/squall/hypervisor_zone.rb, line 87 def remove_data_store_join(id, data_store_join_id) request(:delete, "/settings/hypervisor_zones/#{id}/data_store_joins/#{data_store_join_id}.json") end
Public: Remove a network from a hypervisor zone.
id - ID of the hypervisor zone network_join_id - ID of the join record
Returns a Hash.
# File lib/squall/hypervisor_zone.rb, line 119 def remove_network_join(id, network_join_id) request(:delete, "/settings/hypervisor_zones/#{id}/network_joins/#{network_join_id}.json") end
Public: Get the details for a hypervisor zone.
id - ID of the hypervisor zone
Returns a Hash.
# File lib/squall/hypervisor_zone.rb, line 17 def show(id) response = request(:get, "/settings/hypervisor_zones/#{id}.json") response['hypervisor_group'] end