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

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/openstack/network/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 Model

#project

Instance Method Summary collapse

Methods inherited from 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/openstack/network/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/openstack/network/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/openstack/network/models/router.rb', line 31

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