Class: Fog::Compute::Packet::BgpSession

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/compute/packet/models/bgp_session.rb

Overview

BgpSession Model

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ BgpSession

Returns a new instance of BgpSession.



17
18
19
# File 'lib/fog/compute/packet/models/bgp_session.rb', line 17

def initialize(attributes = {})
  super
end

Instance Method Details

#destroyObject



27
28
29
30
31
# File 'lib/fog/compute/packet/models/bgp_session.rb', line 27

def destroy
  requires :id
  response = service.delete_bgp_session(id)
  true if response.status == 204
end

#saveObject



21
22
23
24
25
# File 'lib/fog/compute/packet/models/bgp_session.rb', line 21

def save
  requires :device_id, :address_family
  response = service.create_bgp_session(device_id, address_family)
  merge_attributes(response.body)
end