Class: GoodData::ExecutionDetail

Inherits:
Rest::Resource show all
Defined in:
lib/gooddata/models/execution_detail.rb

Instance Attribute Summary collapse

Attributes inherited from Rest::Object

#client, #project

Instance Method Summary collapse

Methods included from Mixin::ObjId

#obj_id

Methods inherited from Rest::Object

client, default_client, #saved?

Methods included from Mixin::DataPropertyReader

#data_property_reader

Methods included from Mixin::DataPropertyWriter

#data_property_writer

Methods included from Mixin::MetaPropertyReader

#metadata_property_reader

Methods included from Mixin::MetaPropertyWriter

#metadata_property_writer

Methods included from Mixin::MetaGetter

#meta

Methods included from Mixin::RootKeyGetter

#root_key

Methods included from Mixin::ContentGetter

#content

Constructor Details

#initialize(json) ⇒ ExecutionDetail

Initializes object instance from raw wire JSON

Parameters:

  • json

    Json used for initialization



19
20
21
22
# File 'lib/gooddata/models/execution_detail.rb', line 19

def initialize(json)
  super
  @json = json
end

Instance Attribute Details

#dirtyObject (readonly)

Returns the value of attribute dirty.



12
13
14
# File 'lib/gooddata/models/execution_detail.rb', line 12

def dirty
  @dirty
end

#jsonObject (readonly) Also known as: data

Returns the value of attribute json.



12
13
14
# File 'lib/gooddata/models/execution_detail.rb', line 12

def json
  @json
end

Instance Method Details

#==(other) ⇒ Object

Compares two executions - based on their URI



77
78
79
# File 'lib/gooddata/models/execution_detail.rb', line 77

def ==(other)
  other.respond_to?(:uri) && other.uri == uri && other.respond_to?(:to_hash) && other.to_hash == to_hash
end

#createdObject

Timestamp when execution was created



25
26
27
# File 'lib/gooddata/models/execution_detail.rb', line 25

def created
  Time.parse(json['executionDetail']['created'])
end

#error?Boolean

Has execution failed?

Returns:

  • (Boolean)


30
31
32
# File 'lib/gooddata/models/execution_detail.rb', line 30

def error?
  status == :error
end

#finishedObject

Timestamp when execution was finished



35
36
37
# File 'lib/gooddata/models/execution_detail.rb', line 35

def finished
  Time.parse(json['executionDetail']['finished'])
end

#logObject

Log for execution



40
41
42
# File 'lib/gooddata/models/execution_detail.rb', line 40

def log
  @client.get(json['executionDetail']['links']['log'])
end

#log_filenameObject

Filename of log



45
46
47
# File 'lib/gooddata/models/execution_detail.rb', line 45

def log_filename
  @client.get(json['executionDetail']['logFileName'])
end

#ok?Boolean

Is execution ok?

Returns:

  • (Boolean)


50
51
52
# File 'lib/gooddata/models/execution_detail.rb', line 50

def ok?
  status == :ok
end

#startedObject

Timestamp when execution was started



55
56
57
# File 'lib/gooddata/models/execution_detail.rb', line 55

def started
  Time.parse(json['executionDetail']['started'])
end

#statusObject

Status of execution



60
61
62
# File 'lib/gooddata/models/execution_detail.rb', line 60

def status
  json['executionDetail']['status'].downcase.to_sym
end

#updatedObject

Timestamp when execution was updated



65
66
67
# File 'lib/gooddata/models/execution_detail.rb', line 65

def updated
  Time.parse(json['executionDetail']['updated'])
end

#uriString

Returns URL

Returns:



72
73
74
# File 'lib/gooddata/models/execution_detail.rb', line 72

def uri
  @json['executionDetail']['links']['self'] if @json && @json['executionDetail'] && @json['executionDetail']['links']
end