Class: Fog::Network::OpenStack::Router

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/network/openstack/models/router.rb

Overview

The Layer-3 Networking Extensions (router)

A logical entity for forwarding packets across internal subnets and NATting them on external networks through an appropriate external gateway.

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize, #save

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Instance Method Details

#createObject



22
23
24
25
26
27
28
29
# File 'lib/fog/network/openstack/models/router.rb', line 22

def create
  requires :name

  response = service.create_router(name, options)
  merge_attributes(response.body['router'])

  self
end

#destroyObject



38
39
40
41
42
# File 'lib/fog/network/openstack/models/router.rb', line 38

def destroy
  requires :id
  service.delete_router(id)
  true
end

#updateObject



31
32
33
34
35
36
# File 'lib/fog/network/openstack/models/router.rb', line 31

def update
  requires :id
  response = service.update_router(id, options)
  merge_attributes(response.body['router'])
  self
end