Skip to content

Commit

Permalink
Merge pull request #299 from irontable/develop
Browse files Browse the repository at this point in the history
add json_link attr to RunningJob in Python client
  • Loading branch information
irontablee committed Jun 24, 2016
2 parents 5a3ee9d + 4931e05 commit e0ad261
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions genie-client/src/main/python/pygenie/adapter/genie_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def get_info_for_rj(self, job_id, *args, **kwargs):
'group': data.get('group'),
'id': data.get('id'),
'job_link': data.get('killURI'),
'json_link': data.get('killURI'),
'kill_uri': data.get('killURI'),
'name': data.get('name'),
'output_uri': data.get('outputURI'),
Expand Down
1 change: 1 addition & 0 deletions genie-client/src/main/python/pygenie/adapter/genie_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def get_info_for_rj(self, job_id, *args, **kwargs):
'group': request_data.get('group'),
'id': data.get('id'),
'job_link': job_link,
'json_link': link,
'kill_uri': link,
'name': data.get('name'),
'output_uri': output_link,
Expand Down
24 changes: 24 additions & 0 deletions genie-client/src/main/python/pygenie/jobs/running.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,24 @@ def job_link(self):
Returns:
str: The link to the job.
"""

return self.info.get('job_link')

@property
def json_link(self):
"""
Get the link for the job json.
Example:
>>> print running_job.json_link
'http://localhost/api/v3/jobs/1234-abcd'
Returns:
str: The link to the job json.
"""

return self.info.get('json_link')

@property
def kill_uri(self):
"""
Expand Down Expand Up @@ -388,6 +404,14 @@ def stderr(self, iterator=False):
else self._cached_stderr
return self._adapter.get_stderr(self._job_id, iterator=iterator)

@property
def stdout_url(self):
"""
Returns a url for the stdout of the job.
"""

return '{}/stdout'.format(self.output_uri.replace('/output/', '/file/', 1))

def stdout(self, iterator=False):
"""
Get the job's stdout as either an iterator or full text.
Expand Down
2 changes: 1 addition & 1 deletion genie-client/src/main/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

setup(
name='nflx-genie-client',
version='3.0.7',
version='3.0.8',
author='Netflix Inc.',
author_email='genieoss@googlegroups.com',
keywords='genie hadoop cloud netflix client bigdata presto',
Expand Down

0 comments on commit e0ad261

Please sign in to comment.