Class: Fog::Network::OpenStack::LbVip
- Defined in:
- lib/fog/openstack/models/network/lb_vip.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
-
#initialize(attributes) ⇒ LbVip
constructor
A new instance of LbVip.
- #save ⇒ Object
- #update ⇒ Object
Methods inherited from Model
#inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
#initialize(attributes) ⇒ LbVip
Returns a new instance of LbVip.
23 24 25 26 |
# File 'lib/fog/openstack/models/network/lb_vip.rb', line 23 def initialize(attributes) prepare_service_value(attributes) super end |
Instance Method Details
#create ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/fog/openstack/models/network/lb_vip.rb', line 33 def create requires :subnet_id, :pool_id, :protocol, :protocol_port merge_attributes(service.create_lb_vip(self.subnet_id, self.pool_id, self.protocol, self.protocol_port, self.attributes).body['vip']) self end |
#destroy ⇒ Object
50 51 52 53 54 |
# File 'lib/fog/openstack/models/network/lb_vip.rb', line 50 def destroy requires :id service.delete_lb_vip(self.id) true end |
#save ⇒ Object
28 29 30 31 |
# File 'lib/fog/openstack/models/network/lb_vip.rb', line 28 def save requires :subnet_id, :pool_id, :protocol, :protocol_port identity ? update : create end |
#update ⇒ Object
43 44 45 46 47 48 |
# File 'lib/fog/openstack/models/network/lb_vip.rb', line 43 def update requires :id, :subnet_id, :pool_id, :protocol, :protocol_port merge_attributes(service.update_lb_vip(self.id, self.attributes).body['vip']) self end |