Class: SoftLayer::VLANFirewallOrder

Inherits:
Object
  • Object
show all
Defined in:
lib/softlayer/VLANFirewallOrder.rb

Overview

This class allows you to order a Firewall for a VLAN

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vlan_id, client = nil) ⇒ VLANFirewallOrder

Create a new order for the given VLAN Note that the vlan_id is NOT the same as the vlan number.



24
25
26
27
28
29
30
# File 'lib/softlayer/VLANFirewallOrder.rb', line 24

def initialize (vlan_id, client = nil)
  @softlayer_client = client || Client.default_client
  raise "#{__method__} requires a client but none was given and Client::default_client is not set" if !@softlayer_client

  @vlan_id = vlan_id
  @high_availability = false
end

Instance Attribute Details

#high_availabilityObject

Set high_availability to true if you want redundant firewall devices (defaults to false, no high_availability)



19
20
21
# File 'lib/softlayer/VLANFirewallOrder.rb', line 19

def high_availability
  @high_availability
end

#vlan_idObject (readonly)

The VLAN that you are ordering the firewall for.



14
15
16
# File 'lib/softlayer/VLANFirewallOrder.rb', line 14

def vlan_id
  @vlan_id
end

Instance Method Details

#place_order!Object

Calls the SoftLayer API to place an order for a new server based on the template in this order. If this succeeds then you will be billed for the new server.

If you provide a block, it will receive the order template as a parameter and the block may make changes to the template before it is submitted.



53
54
55
56
57
58
# File 'lib/softlayer/VLANFirewallOrder.rb', line 53

def place_order!()
  order_template = firewall_order_template
  order_template = yield order_template if block_given?

  @softlayer_client[:Product_Order].placeOrder(order_template)
end

#verifyObject

Calls the SoftLayer API to verify that the template provided by this order is valid This routine will return the order template generated by the API or will throw an exception

This routine will not actually create a Bare Metal Instance and will not affect billing.

If you provide a block, it will receive the order template as a parameter and the block may make changes to the template before it is submitted.



40
41
42
43
44
45
# File 'lib/softlayer/VLANFirewallOrder.rb', line 40

def verify()
  order_template = firewall_order_template
  order_template = yield order_template if block_given?

  @softlayer_client[:Product_Order].verifyOrder(order_template)
end