Class: Fog::Compute::ProfitBricks::Interface
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::ProfitBricks::Interface
- Defined in:
- lib/fog/profitbricks/models/compute/interface.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #destroy ⇒ Object
- #failed? ⇒ Boolean
-
#initialize(attributes = {}) ⇒ Interface
constructor
A new instance of Interface.
- #ready? ⇒ Boolean
- #save ⇒ Object
- #set_internet_access(options = {}) ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Interface
Returns a new instance of Interface.
21 22 23 |
# File 'lib/fog/profitbricks/models/compute/interface.rb', line 21 def initialize(attributes={}) super end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
19 20 21 |
# File 'lib/fog/profitbricks/models/compute/interface.rb', line 19 def end |
Instance Method Details
#destroy ⇒ Object
41 42 43 44 45 |
# File 'lib/fog/profitbricks/models/compute/interface.rb', line 41 def destroy requires :id service.delete_nic(id) true end |
#failed? ⇒ Boolean
58 59 60 |
# File 'lib/fog/profitbricks/models/compute/interface.rb', line 58 def failed? self.state == 'ERROR' end |
#ready? ⇒ Boolean
54 55 56 |
# File 'lib/fog/profitbricks/models/compute/interface.rb', line 54 def ready? self.state == 'AVAILABLE' end |
#save ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/fog/profitbricks/models/compute/interface.rb', line 25 def save requires :server_id, :lan_id data = service.create_nic(server_id, lan_id, ={}) merge_attributes(data.body['createNicResponse']) true end |
#set_internet_access(options = {}) ⇒ Object
47 48 49 50 51 52 |
# File 'lib/fog/profitbricks/models/compute/interface.rb', line 47 def set_internet_access(={}) service.set_internet_access( [:data_center_id], [:lan_id], [:internet_access] ) true end |
#update ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/fog/profitbricks/models/compute/interface.rb', line 33 def update requires :id data = service.update_nic(id, ) merge_attributes(data.body['updateNicResponse']) true end |