Class: Fog::Compute::ProfitBricks::Interface

Inherits:
Models::ProfitBricks::Base show all
Defined in:
lib/fog/compute/profit_bricks/models/interface.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Models::ProfitBricks::Base

#wait_for

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



20
21
22
# File 'lib/fog/compute/profit_bricks/models/interface.rb', line 20

def options
  @options
end

Instance Method Details

#destroyObject



38
39
40
41
42
# File 'lib/fog/compute/profit_bricks/models/interface.rb', line 38

def destroy
  requires :id
  service.delete_nic(id)
  true
end

#failed?Boolean



55
56
57
# File 'lib/fog/compute/profit_bricks/models/interface.rb', line 55

def failed?
  state == "ERROR"
end

#ready?Boolean



51
52
53
# File 'lib/fog/compute/profit_bricks/models/interface.rb', line 51

def ready?
  state == "AVAILABLE"
end

#saveObject



22
23
24
25
26
27
28
# File 'lib/fog/compute/profit_bricks/models/interface.rb', line 22

def save
  requires :server_id, :lan_id

  data = service.create_nic(server_id, lan_id, options = {})
  merge_attributes(data.body["createNicResponse"])
  true
end

#set_internet_access(options = {}) ⇒ Object



44
45
46
47
48
49
# File 'lib/fog/compute/profit_bricks/models/interface.rb', line 44

def set_internet_access(options = {})
  service.set_internet_access(
    options[:data_center_id], options[:lan_id], options[:internet_access]
  )
  true
end

#updateObject



30
31
32
33
34
35
36
# File 'lib/fog/compute/profit_bricks/models/interface.rb', line 30

def update
  requires :id

  data = service.update_nic(id, options)
  merge_attributes(data.body["updateNicResponse"])
  true
end