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
This commit is contained in:
Jeremy Freudberg
2018-07-09 12:11:00 -04:00
parent 296c183388
commit f52070c4a6
3 changed files with 8 additions and 4 deletions

View File

@@ -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.

View File

@@ -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."""

View File

@@ -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."""