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

Instance Method Summary collapse

Methods inherited from Ecloud::Model

#load_unless_loaded!, #reload

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] = "#{service.base_path}/layoutGroups/environments/#{environment_id}/action/createLayoutGroup"
  options[:row_name] = name
  options[:href] = href
  data = service.groups_create(options).body
  group = self.service.groups.new(data)
end

#deleteObject Also known as: destroy



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

def delete
  service.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
  service.rows_edit(options).body
end

#environment_idObject



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

def environment_id
  reload if other_links.nil?
  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 = self.service.groups(:href => href)
end

#idObject



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

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"
  service.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"
  service.rows_moveup(options).body
end