Class: Squall::IpAddressJoin
Overview
Handles IP assignments for virtual machines
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Object) assign(virtual_machine_id, options = {})
Assigns an IP address to a VM.
-
- (Object) delete(virtual_machine_id, ip_address_id)
Deletes an IP address assignment from a VM.
-
- (Object) list(virtual_machine_id)
List IP address assignments for a virtual machine.
Methods inherited from Base
#check_config, #default_params, #key_for_class, #request
Instance Method Details
- (Object) assign(virtual_machine_id, options = {})
Assigns an IP address to a VM.
22 23 24 25 |
# File 'lib/squall/ip_address_join.rb', line 22 def assign(virtual_machine_id, = {}) response = request(:post, "/virtual_machines/#{virtual_machine_id}/ip_addresses.json", default_params()) response['ip_address_join'] end |
- (Object) delete(virtual_machine_id, ip_address_id)
Deletes an IP address assignment from a VM
33 34 35 |
# File 'lib/squall/ip_address_join.rb', line 33 def delete(virtual_machine_id, ip_address_id) request(:delete, "/virtual_machines/#{virtual_machine_id}/ip_addresses/#{ip_address_id}.json") end |
- (Object) list(virtual_machine_id)
List IP address assignments for a virtual machine.
9 10 11 12 |
# File 'lib/squall/ip_address_join.rb', line 9 def list(virtual_machine_id) response = request(:get, "/virtual_machines/#{virtual_machine_id}/ip_addresses.json") response.collect { |ip| ip['ip_address_join'] } end |