Class: Squall::Network
Overview
OnApp Network
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Object) create(options = {})
Create a Network.
-
- (Object) delete(id)
Delete a network.
-
- (Object) edit(id, options = {})
Edit a Network.
-
- (Object) list
Lists all networks.
-
- (Object) rebuild(id)
Rebuild VM network.
Methods inherited from Base
#check_config, #default_params, #key_for_class, #request
Instance Method Details
- (Object) create(options = {})
Create a Network.
29 30 31 32 |
# File 'lib/squall/network.rb', line 29 def create( = {}) response = request(:post, '/settings/networks.json', default_params()) response.first[1] end |
- (Object) delete(id)
Delete a network.
49 50 51 |
# File 'lib/squall/network.rb', line 49 def delete(id) request(:delete, "/settings/networks/#{id}.json") end |
- (Object) edit(id, options = {})
Edit a Network
40 41 42 |
# File 'lib/squall/network.rb', line 40 def edit(id, = {}) request(:put, "/settings/networks/#{id}.json", default_params()) end |
- (Object) list
Lists all networks.
7 8 9 10 |
# File 'lib/squall/network.rb', line 7 def list response = request(:get, '/settings/networks.json') response.collect { |network| network['network'] } end |
- (Object) rebuild(id)
Rebuild VM network.
58 59 60 |
# File 'lib/squall/network.rb', line 58 def rebuild(id) request(:post, "/virtual_machines/#{id}/rebuild_network.json") end |