Class: Fog::Compute::Ecloud::Rows

Inherits:
Ecloud::Collection show all
Defined in:
lib/fog/ecloud/models/compute/rows.rb

Instance Method Summary collapse

Methods inherited from Ecloud::Collection

#check_href!, #load

Instance Method Details

#allObject



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

def all
  data = service.get_layout(href).body[:Rows][:Row]
  load(data)
end

#create(options = {}) ⇒ Object



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

def create(options = {})
  options[:uri] = "#{service.base_path}/layoutRows/environments/#{environment_id}/action/createLayoutRow"
  data = service.rows_create(options).body
  new(data)
end

#environment_idObject



33
34
35
# File 'lib/fog/ecloud/models/compute/rows.rb', line 33

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

#get(uri) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/fog/ecloud/models/compute/rows.rb', line 16

def get(uri)
  data = service.get_row(uri).body
  if data == ""
    nil
  else
    new(data)
  end
rescue Excon::Errors::NotFound
  nil
end