Class: Yao::Resources::FloatingIP

Inherits:
Base
  • Object
show all
Includes:
PortAssociationable, ProjectAssociationable
Defined in:
lib/yao/resources/floating_ip.rb

Instance Attribute Summary

Attributes included from RestfullyAccessible

#service

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ProjectAssociationable

included, #project

Methods included from PortAssociationable

included, #port

Methods inherited from Base

#[], #[]=, add_instantiation_name_list, #destroy, friendly_attributes, #id, #initialize, instantiation?, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, map_attributes_to_time, #to_hash, #update

Methods included from RestfullyAccessible

#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #get, #get!, #list, #resources_path, #resources_path=, #return_single_on_querying, #return_single_on_querying=, #update

Constructor Details

This class inherits a constructor from Yao::Resources::Base

Class Method Details

.associate_port(id, port_id) ⇒ Yao::Resources::FloatingIP

Parameters:

  • id (String)

    ID of floating_ip

  • port_id (String)

    ID of port

Returns:



42
43
44
# File 'lib/yao/resources/floating_ip.rb', line 42

def associate_port(id, port_id)
  update(id, port_id: port_id)
end

.disassociate_port(id) ⇒ Yao::Resources::FloatingIP

Parameters:

  • id (String)

    ID of floating_ip

Returns:



48
49
50
# File 'lib/yao/resources/floating_ip.rb', line 48

def disassociate_port(id)
  update(id, port_id: nil)
end

Instance Method Details

#associate_port(port) ⇒ Yao::Resources::FloatingIP



28
29
30
# File 'lib/yao/resources/floating_ip.rb', line 28

def associate_port(port)
  self.class.associate_port(id, port.id)
end

#disassociate_portYao::Resources::FloatingIP



33
34
35
# File 'lib/yao/resources/floating_ip.rb', line 33

def disassociate_port
  self.class.disassociate_port(id)
end

#routerYao::Resources::Router



22
23
24
# File 'lib/yao/resources/floating_ip.rb', line 22

def router
  @router ||= Yao::Router.get(router_id)
end