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



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

def initialize(json)
  super
  @json = json
end

Instance Attribute Details

#dirtyObject (readonly)

Returns the value of attribute dirty.



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

def dirty
  @dirty
end

#jsonObject (readonly) Also known as: data

Returns the value of attribute json.



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

def json
  @json
end

Instance Method Details

#==(other) ⇒ Object

Compares two executions - based on their URI



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

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



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

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

#error?Boolean

Has execution failed?

Returns:

  • (Boolean)


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

def error?
  status == :error
end

#finishedObject

Timestamp when execution was finished



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

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

#logObject

Log for execution



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

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

#log_filenameObject

Filename of log



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

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

#ok?Boolean

Is execution ok?

Returns:

  • (Boolean)


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

def ok?
  status == :ok
end

#startedObject

Timestamp when execution was started



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

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

#statusObject

Status of execution



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

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

#updatedObject

Timestamp when execution was updated



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

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

#uriString

Returns URL

Returns:

  • (String)

    Schedule URL



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

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