Class: Fog::Compute::Ecloud::BackupInternetService

Inherits:
Ecloud::Model show all
Defined in:
lib/fog/compute/models/ecloud/backup_internet_service.rb

Instance Attribute Summary

Attributes inherited from Ecloud::Model

#loaded

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Ecloud::Model

#load_unless_loaded!, #reload

Methods inherited from Model

#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, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#deleteObject



19
20
21
22
23
# File 'lib/fog/compute/models/ecloud/backup_internet_service.rb', line 19

def delete
  requires :href

  connection.delete_internet_service( href )
end

#monitor=(new_monitor = {}) ⇒ Object



25
26
27
28
29
# File 'lib/fog/compute/models/ecloud/backup_internet_service.rb', line 25

def monitor=(new_monitor = {})
  if new_monitor.nil? || new_monitor.empty?
    attributes[:monitor] = nil
  end
end

#nodesObject



40
41
42
# File 'lib/fog/compute/models/ecloud/backup_internet_service.rb', line 40

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

#saveObject



31
32
33
34
35
36
37
38
# File 'lib/fog/compute/models/ecloud/backup_internet_service.rb', line 31

def save
  if new_record?
    result = connection.add_backup_internet_service( collection.href, _compose_service_data )
    merge_attributes(result.body)
  else
    connection.configure_backup_internet_service( href, _compose_service_data )
  end
end