class Fog::HP::Network::Router

Public Instance Methods

add_interface(subnet_id=nil, port_id=nil, options={}) click to toggle source
# File lib/fog/hp/models/network/router.rb, line 21
def add_interface(subnet_id=nil, port_id=nil, options={})
  requires :id
  begin
    service.add_router_interface(id, subnet_id, port_id, options).body['router']
    true
  rescue ArgumentError, Fog::HP::Network::NotFound
    false
  end
end
destroy() click to toggle source
# File lib/fog/hp/models/network/router.rb, line 15
def destroy
  requires :id
  service.delete_router(id)
  true
end
ready?() click to toggle source
# File lib/fog/hp/models/network/router.rb, line 41
def ready?
  self.status == 'ACTIVE'
end
remove_interface(subnet_id=nil, port_id=nil, options={}) click to toggle source
# File lib/fog/hp/models/network/router.rb, line 31
def remove_interface(subnet_id=nil, port_id=nil, options={})
  requires :id
  begin
    service.remove_router_interface(id, subnet_id, port_id, options)
    true
  rescue ArgumentError, Fog::HP::Network::NotFound
    false
  end
end
save() click to toggle source
# File lib/fog/hp/models/network/router.rb, line 45
def save
  identity ? update : create
end

Private Instance Methods

create() click to toggle source
# File lib/fog/hp/models/network/router.rb, line 51
def create
  merge_attributes(service.create_router(attributes).body['router'])
  true
end
update() click to toggle source
# File lib/fog/hp/models/network/router.rb, line 56
def update
  requires :id
  merge_attributes(service.update_router(id, attributes).body['router'])
  true
end