diff options
author | Andrey Pavlov <apavlov@mirantis.com> | 2015-10-20 13:11:12 +0300 |
---|---|---|
committer | Andrey Pavlov <apavlov@mirantis.com> | 2015-10-20 13:11:12 +0300 |
commit | 1e986fa23c8e7443b51e1477b923f0fc656a0e7c (patch) | |
tree | 683ccdd1bfbd37afb283f8aac7ec71c44e63cbec /saharaclient/api/job_executions.py | |
parent | 29fe1b98e7fe676b7f6fa7d17f6931b36a58b6fb (diff) | |
download | python-saharaclient-1e986fa23c8e7443b51e1477b923f0fc656a0e7c.tar.gz |
Making parameters of job executions create optional
input_id, output_id, configs parameters of job execution
create method should not be required.
This change doesn't break backward compatibility.
Change-Id: I01fb2406264c671aa15351df834814d32d3275a6
Closes-bug: #1507966
Diffstat (limited to 'saharaclient/api/job_executions.py')
-rw-r--r-- | saharaclient/api/job_executions.py | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/saharaclient/api/job_executions.py b/saharaclient/api/job_executions.py index 23fd686..4d76b24 100644 --- a/saharaclient/api/job_executions.py +++ b/saharaclient/api/job_executions.py @@ -33,29 +33,18 @@ class JobExecutionsManager(base.ResourceManager): def delete(self, obj_id): self._delete('/job-executions/%s' % obj_id) - def create(self, job_id, cluster_id, input_id, - output_id, configs, interface=None, is_public=None, + def create(self, job_id, cluster_id, input_id=None, + output_id=None, configs=None, interface=None, is_public=None, is_protected=None): url = "/jobs/%s/execute" % job_id data = { "cluster_id": cluster_id, - "job_configs": configs, } - if interface: - data['interface'] = interface - - # Leave these out if they are null. For Java job types they - # are not part of the schema - io_ids = (("input_id", input_id), - ("output_id", output_id)) - for key, value in io_ids: - if value is not None: - data.update({key: value}) - - self._copy_if_defined(data, is_public=is_public, - is_protected=is_protected) + self._copy_if_defined(data, input_id=input_id, output_id=output_id, + job_configs=configs, interface=interface, + is_public=is_public, is_protected=is_protected) return self._create(url, data, 'job_execution') |