Class: Squall::NetworkZone
Overview
OnApp NetworkZone
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Object) attach(id, network_id)
Attach a network to a network zone.
-
- (Object) create(options = {})
Creates a new network zone.
-
- (Object) delete(id)
Deletes an existing network zone.
-
- (Object) detach(id, network_id)
Detach a network from a network zone.
-
- (Object) edit(id, options = {})
Updates an existing network zone.
-
- (Object) list
Lists all network zones.
-
- (Object) show(id)
Get the details for a network zone.
Methods inherited from Base
#check_config, #default_params, #key_for_class, #request
Instance Method Details
- (Object) attach(id, network_id)
Attach a network to a network zone.
57 58 59 |
# File 'lib/squall/network_zone.rb', line 57 def attach(id, network_id) request(:post, "/network_zones/#{id}/networks/#{network_id}/attach.json") end |
- (Object) create(options = {})
Creates a new network zone.
38 39 40 |
# File 'lib/squall/network_zone.rb', line 38 def create( = {}) request(:post, "/network_zones.json", query: { pack: }) end |
- (Object) delete(id)
Deletes an existing network zone.
47 48 49 |
# File 'lib/squall/network_zone.rb', line 47 def delete(id) request(:delete, "/network_zones/#{id}.json") end |
- (Object) detach(id, network_id)
Detach a network from a network zone.
67 68 69 |
# File 'lib/squall/network_zone.rb', line 67 def detach(id, network_id) request(:post, "/network_zones/#{id}/networks/#{network_id}/detach.json") end |
- (Object) edit(id, options = {})
Updates an existing network zone.
28 29 30 |
# File 'lib/squall/network_zone.rb', line 28 def edit(id, = {}) request(:put, "/network_zones/#{id}.json", query: { pack: }) end |
- (Object) list
Lists all network zones.
7 8 9 10 |
# File 'lib/squall/network_zone.rb', line 7 def list response = request(:get, "/network_zones.json") response.collect { |i| i['network_group'] } end |
- (Object) show(id)
Get the details for a network zone.
17 18 19 20 |
# File 'lib/squall/network_zone.rb', line 17 def show(id) response = request(:get, "/network_zones/#{id}.json") response['network_group'] end |