diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-10-21 12:18:25 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-10-21 12:18:25 +0000 |
commit | e623e6d6ad67ba58a212d0baf0ca2b198e748c17 (patch) | |
tree | 73cfd97100b15e418817182061751581200a9edf /saharaclient/api | |
parent | 978bb44920039369ab0a2ace163b20ef2e299515 (diff) | |
parent | 1e986fa23c8e7443b51e1477b923f0fc656a0e7c (diff) | |
download | python-saharaclient-e623e6d6ad67ba58a212d0baf0ca2b198e748c17.tar.gz |
Merge "Making parameters of job executions create optional"
Diffstat (limited to 'saharaclient/api')
-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') |