Class: Fog::Compute::Ecloud::Row

Inherits:
Ecloud::Model show all
Defined in:
lib/fog/ecloud/models/compute/row.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, #symbolize_keys, #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, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#create_group(options = {}) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/fog/ecloud/models/compute/row.rb', line 35

def create_group(options = {})
  options[:uri] = "/cloudapi/ecloud/layoutGroups/environments/#{environment_id}/action/createLayoutGroup"
  options[:row_name] = name
  options[:href] = href
  data = connection.groups_create(options).body
  group = Fog::Compute::Ecloud::Groups.new(:connection => connection, :href => data[:href])[0]
end

#deleteObject



31
32
33
# File 'lib/fog/ecloud/models/compute/row.rb', line 31

def delete
  connection.rows_delete(href).body
end

#edit(options) ⇒ Object



16
17
18
19
# File 'lib/fog/ecloud/models/compute/row.rb', line 16

def edit(options)
  options[:uri] = href
  connection.rows_edit(options).body
end

#environment_idObject



43
44
45
# File 'lib/fog/ecloud/models/compute/row.rb', line 43

def environment_id
  other_links[:Link][:href].scan(/\d+/)[0]
end

#groupsObject



12
13
14
# File 'lib/fog/ecloud/models/compute/row.rb', line 12

def groups
  @groups = Fog::Compute::Ecloud::Groups.new(:connection => connection, :href => href)
end

#idObject



47
48
49
# File 'lib/fog/ecloud/models/compute/row.rb', line 47

def id
  href.scan(/\d+/)[0]
end

#move_down(options) ⇒ Object



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

def move_down(options)
  options[:uri] = href + "/action/movedown"
  connection.rows_movedown(options).body
end

#move_up(options) ⇒ Object



21
22
23
24
# File 'lib/fog/ecloud/models/compute/row.rb', line 21

def move_up(options)
  options[:uri] = href + "/action/moveup"
  connection.rows_moveup(options).body
end