Class: Fog::Network::OpenStack::LbMember
- Inherits:
-
Model
- Object
- Model
- Fog::Network::OpenStack::LbMember
- Defined in:
- lib/fog/openstack/models/network/lb_member.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
-
#initialize(attributes) ⇒ LbMember
constructor
A new instance of LbMember.
- #save ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(attributes) ⇒ LbMember
Returns a new instance of LbMember.
17 18 19 20 |
# File 'lib/fog/openstack/models/network/lb_member.rb', line 17 def initialize(attributes) prepare_service_value(attributes) super end |
Instance Method Details
#create ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/openstack/models/network/lb_member.rb', line 27 def create requires :pool_id, :address, :protocol_port, :weight merge_attributes(service.create_lb_member(self.pool_id, self.address, self.protocol_port, self.weight, self.attributes).body['member']) self end |
#destroy ⇒ Object
44 45 46 47 48 |
# File 'lib/fog/openstack/models/network/lb_member.rb', line 44 def destroy requires :id service.delete_lb_member(self.id) true end |
#save ⇒ Object
22 23 24 25 |
# File 'lib/fog/openstack/models/network/lb_member.rb', line 22 def save requires :pool_id, :address, :protocol_port, :weight identity ? update : create end |
#update ⇒ Object
37 38 39 40 41 42 |
# File 'lib/fog/openstack/models/network/lb_member.rb', line 37 def update requires :id, :pool_id, :address, :protocol_port, :weight merge_attributes(service.update_lb_member(self.id, self.attributes).body['member']) self end |