Method: Miasma::Models::Orchestration::OpenStack#stack_all

Defined in:
lib/miasma/contrib/open_stack/orchestration.rb

#stack_all(options = {}) ⇒ Array<Models::Orchestration::Stack>

TODO:

check if we need any mappings on state set

Return all stacks

Parameters:

  • options (Hash) (defaults to: {})

    filter

Returns:

  • (Array<Models::Orchestration::Stack>)


154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/miasma/contrib/open_stack/orchestration.rb', line 154

def stack_all(options={})
  result = request(
    :method => :get,
    :path => '/stacks'
  )
  result.fetch(:body, :stacks, []).map do |s|
    Stack.new(
      self,
      :id => s[:id],
      :created => Time.parse(s[:creation_time]),
      :description => s[:description],
      :name => s[:stack_name],
      :state => s[:stack_status].downcase.to_sym,
      :status => s[:stack_status],
      :status_reason => s[:stack_status_reason],
      :updated => s[:updated_time].to_s.empty? ? nil : Time.parse(s[:updated_time])
    ).valid_state
  end
end