Class: Openlayer::Resources::BackgroundTasks

Inherits:
Object
  • Object
show all
Defined in:
lib/openlayer/resources/background_tasks.rb,
sig/openlayer/resources/background_tasks.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ BackgroundTasks

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of BackgroundTasks.

Parameters:



33
34
35
# File 'lib/openlayer/resources/background_tasks.rb', line 33

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(task_id, request_options: {}) ⇒ Openlayer::Models::BackgroundTaskRetrieveResponse

Retrieve a background task's status, progress and results.

Endpoints that cannot answer within one request queue a task and hand back its id -- for example POST /frameworks/{frameworkId}/export. Poll this endpoint until complete is true, then read what the task produced from outputs.

Parameters:

Returns:

See Also:



21
22
23
24
25
26
27
28
# File 'lib/openlayer/resources/background_tasks.rb', line 21

def retrieve(task_id, params = {})
  @client.request(
    method: :get,
    path: ["background-tasks/%1$s", task_id],
    model: Openlayer::Models::BackgroundTaskRetrieveResponse,
    options: params[:request_options]
  )
end