Class: Hodor::Oozie::Action

Inherits:
Job
  • Object
show all
Defined in:
lib/hodor/api/oozie/action.rb

Instance Attribute Summary collapse

Attributes inherited from Job

#columns, #conf, #id, #index, #rest_call, #skip_to

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Job

#child_columns, #children, #children_title, #conf_map, #definition, #display_as_array, #display_as_time, #display_children, #display_properties, #indexed_job_id, #log, #oozie, #parse_time, #sanitize, #session, #set_index, #title

Constructor Details

#initialize(json) ⇒ Action

Returns a new instance of Action.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/hodor/api/oozie/action.rb', line 15

def initialize(json)
  super()
  @json = json

  @error_message = json["errorMessage"]
  @status = json["status"]
  @stats = json["stats"]
  @data = json["data"]
  @transition = json["transition"]
  @external_status = json["externalStatus"]
  @cred = json["cred"]
  @conf = json["conf"]
  @type = json["type"]
  @end_time = parse_time json["endTime"]
  @external_id = json["externalId"]
  @id = json["id"]
  @start_time = parse_time json["startTime"]
  @external_child_ids = json["externalChildIDs"]
  @name = json["name"]
  @error_code = json["errorCode"]
  @tracker_url = json["trackerUri"]
  @retries = json["retries"]
  @to_string = json["toString"]
  @console_url = json["consoleUrl"]
  @parent_id = @id[0..@id.index('@')-1]
end

Instance Attribute Details

#console_urlObject (readonly)

Returns the value of attribute console_url.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def console_url
  @console_url
end

#credObject (readonly)

Returns the value of attribute cred.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def cred
  @cred
end

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def data
  @data
end

#end_timeObject (readonly)

Returns the value of attribute end_time.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def end_time
  @end_time
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def error_message
  @error_message
end

#external_child_idsObject (readonly)

Returns the value of attribute external_child_ids.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def external_child_ids
  @external_child_ids
end

#external_idObject (readonly)

Returns the value of attribute external_id.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def external_id
  @external_id
end

#external_statusObject (readonly)

Returns the value of attribute external_status.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def external_status
  @external_status
end

#jsonObject (readonly)

Returns the value of attribute json.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def json
  @json
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def name
  @name
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def parent_id
  @parent_id
end

#retriesObject (readonly)

Returns the value of attribute retries.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def retries
  @retries
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def start_time
  @start_time
end

#statusObject (readonly)

Returns the value of attribute status.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def status
  @status
end

#to_stringObject (readonly)

Returns the value of attribute to_string.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def to_string
  @to_string
end

#tracker_urlObject (readonly)

Returns the value of attribute tracker_url.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def tracker_url
  @tracker_url
end

#transitionObject (readonly)

Returns the value of attribute transition.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def transition
  @transition
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/hodor/api/oozie/action.rb', line 5

def type
  @type
end

Class Method Details

.default_columnsObject



10
11
12
# File 'lib/hodor/api/oozie/action.rb', line 10

def default_columns
  [:index, :id, :name, :status, :created_at, :nominal_time]
end

Instance Method Details

#expandObject



42
43
44
45
46
47
48
# File 'lib/hodor/api/oozie/action.rb', line 42

def expand
  if @external_id && !@external_id.eql?('-')
    [ oozie.job_by_id(@external_id) ]
  else
    nil
  end
end