diff options
author | Jeremy Freudberg <jeremyfreudberg@gmail.com> | 2018-07-09 12:11:00 -0400 |
---|---|---|
committer | Jeremy Freudberg <jeremyfreudberg@gmail.com> | 2018-07-09 16:55:53 +0000 |
commit | f52070c4a671ad6ec3585a1f224d82f971407881 (patch) | |
tree | 8ee997bf4b83dbd4a3f12346eeaf2c266fec3f4b | |
parent | 296c1833889eea294e53e81774624ea65a399254 (diff) | |
download | python-saharaclient-f52070c4a671ad6ec3585a1f224d82f971407881.tar.gz |
Reflect response fixes for jobs/jobs templates
In the experimental APIv2, some inconsistencies were recently fixed.
Reflect that.
Depends-On: https://review.openstack.org/581072
Change-Id: I408a0ab5ee1647307bb63635b2d7839c24be73d0
-rw-r--r-- | releasenotes/notes/job-job-template-apiv2-change-93ffbf2b1360cddc.yaml | 4 | ||||
-rw-r--r-- | saharaclient/api/v2/job_templates.py | 4 | ||||
-rw-r--r-- | saharaclient/api/v2/jobs.py | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/releasenotes/notes/job-job-template-apiv2-change-93ffbf2b1360cddc.yaml b/releasenotes/notes/job-job-template-apiv2-change-93ffbf2b1360cddc.yaml new file mode 100644 index 0000000..76d89ca --- /dev/null +++ b/releasenotes/notes/job-job-template-apiv2-change-93ffbf2b1360cddc.yaml @@ -0,0 +1,4 @@ +other: + - When using APIv2, the viewing (GET) of specific job templates and jobs and + the creation (POST) of job templates and jobs now only supports the API + behavior of Sahara 9.0.0.0b3 or later. diff --git a/saharaclient/api/v2/job_templates.py b/saharaclient/api/v2/job_templates.py index 0236829..3fb2be0 100644 --- a/saharaclient/api/v2/job_templates.py +++ b/saharaclient/api/v2/job_templates.py @@ -36,7 +36,7 @@ class JobTemplatesManagerV2(base.ResourceManager): libs=libs, interface=interface, is_public=is_public, is_protected=is_protected) - return self._create('/%s' % 'job-templates', data, 'job') + return self._create('/%s' % 'job-templates', data, 'job_template') def list(self, search_opts=None, limit=None, marker=None, sort_by=None, reverse=None): @@ -49,7 +49,7 @@ class JobTemplatesManagerV2(base.ResourceManager): def get(self, job_id): """Get information about a Job Template.""" - return self._get('/%s/%s' % ('job-templates', job_id), 'job') + return self._get('/%s/%s' % ('job-templates', job_id), 'job_template') def get_configs(self, job_type): """Get config hints for a specified Job Template type.""" diff --git a/saharaclient/api/v2/jobs.py b/saharaclient/api/v2/jobs.py index fa50894..63ed701 100644 --- a/saharaclient/api/v2/jobs.py +++ b/saharaclient/api/v2/jobs.py @@ -34,7 +34,7 @@ class JobsManagerV2(base.ResourceManager): def get(self, obj_id): """Get information about a Job.""" - return self._get('/jobs/%s' % obj_id, 'job_execution') + return self._get('/jobs/%s' % obj_id, 'job') def delete(self, obj_id): """Delete a Job.""" @@ -54,7 +54,7 @@ class JobsManagerV2(base.ResourceManager): job_configs=configs, interface=interface, is_public=is_public, is_protected=is_protected) - return self._create('/jobs', data, 'job_execution') + return self._create('/jobs', data, 'job') def refresh_status(self, obj_id): """Refresh Job Status.""" |