Method: GoodData::Schedule#execute

Defined in:
lib/gooddata/models/schedule.rb

#execute(opts = {}) ⇒ Object

Executes schedule

Parameters:

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

    execution options.

Options Hash (opts):

  • :wait (Boolean)

    Wait for execution result

Returns:


196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/gooddata/models/schedule.rb', line 196

def execute(opts = {})
  return nil unless saved?
  opts = { :wait => true }.merge(opts)
  data = {
    :execution => {}
  }
  res = client.post(execution_url, data)
  execution = client.create(GoodData::Execution, res, client: client, project: project)

  return execution unless opts[:wait]
  execution.wait_for_result(opts)
end