Class: Fog::Network::OpenStack::LbVip
- Inherits:
-
Model
- Object
- Model
- Fog::Network::OpenStack::LbVip
- Defined in:
- lib/fog/openstack/models/network/lb_vip.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
-
#initialize(attributes) ⇒ LbVip
constructor
A new instance of LbVip.
- #save ⇒ Object
- #update ⇒ Object
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 |