Class: Fog::Vcloud::Terremark::Ecloud::InternetService

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/vcloud/terremark/ecloud/models/internet_service.rb

Instance Attribute Summary

Attributes inherited from Model

#loaded

Attributes inherited from Model

#connection

Instance Method Summary collapse

Methods inherited from Model

#load_unless_loaded!, #reload

Methods inherited from Model

#collection, #initialize, #inspect, #reload, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #identity, #identity=, #merge_attributes, #new_record?, #requires

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#deleteObject



22
23
24
25
26
# File 'lib/fog/vcloud/terremark/ecloud/models/internet_service.rb', line 22

def delete
  requires :href

  connection.delete_internet_service( href )
end

#nodesObject



37
38
39
# File 'lib/fog/vcloud/terremark/ecloud/models/internet_service.rb', line 37

def nodes
  @nodes ||= Fog::Vcloud::Terremark::Ecloud::Nodes.new( :connection => connection, :href => href + "/nodeServices" )
end

#saveObject



28
29
30
31
32
33
34
35
# File 'lib/fog/vcloud/terremark/ecloud/models/internet_service.rb', line 28

def save
  if new_record?
    result = connection.add_internet_service( collection.href, _compose_service_data )
    merge_attributes(result.body)
  else
    connection.configure_internet_service( href, _compose_service_data, _compose_ip_data )
  end
end