Commit Graph

17 Commits

Author SHA1 Message Date
Telles Nobrega f422b31b81 Fixing policies inconsistencies
Fixing some jobs/job-templates/job-executions policy inconsistencies.

Change-Id: I05223981bd44d5f467808576113c29fbb37a3191
Story: #2004675
Task: #28666
2019-03-06 13:50:28 -03:00
Jeremy Freudberg 69d74c1a66 Some polish for APIv2
- update_keypair now only in v2 schema
- tenant_id->project_id in cluster provision steps
- tenant_id->project_id in referenced job binaries in job templates
- proper check for job template existence, to fail early (as intended)
- hadoop_version->plugin_version for query string filter
- unbreak some data source stuff (related to tenant_id->project_id)
- fix omission of show_progress from cluster GET query string whitelist
- job_id->job_template_id for v2 jobs
- add missing release note info for strict query string checking
- release notes for all the rest

Change-Id: Idea117c406b5ab9b8d85ccf8adb175053416d6ff
Story: 2004505
Task: 28822
2019-01-10 10:01:04 -03:00
Zuul 78090dee69 Merge "APIv2 - Fix 500 on malformed query string on" 2019-01-09 22:20:40 +00:00
Telles Nobrega 7105a891c2 APIv2 - Fix 500 on malformed query string on
In order to improve return information to clients we are adding a check
to verify parameters before each call and return a more appropriate
message to the users.

Change-Id: I9923601d0903e415a3fe30bec9bdc8fc34b91ff6
Story: #2004506
Task: #28228
2019-01-09 15:52:22 -03:00
Telles Nobrega 9bf50ce571 APIv2 Changing return payload to project_id
As part of the APIv2 work we need to change all tenant_id references
to project_id on the return payload.

Story: #2004505
Taks: #28227

Change-Id: I94bca161aa4f7bdd56d5528bae92fa81af188a43
2018-12-12 07:09:51 -03:00
Jeremy Freudberg cb0e5ad7ca Final fixup to APIv2 responses
Some inconsistencies still remained.

Change-Id: Ic54af5433f6498488f457d8e49dae74e684e2bd2
Story: 1745294
Task: 8392
2018-07-09 12:00:43 -04:00
Jeremy Freudberg ccb9167e18 Various server-side fixes to APIv2
* Check if plugin_version key is in dict before doing something to it
* Fix references to non-existent policies
* Generally, correct how some responses get tweaked (in many cases the
  old way was throwing an error)
* Fix an incorrect schema

Change-Id: I6b4802a614e4b58678343f12856dd531827dc7b2
2018-01-25 05:23:22 +00:00
Shu Yingya 3c24a9b00e [APIv2] Refactor job cancel operation
Remove endpoint "/jobs/{job_id}/cancel" for cancelling a job.
we can request a cancelled state on a PATCH to the new /jobs/{job_id}
endpoint to make code more consistency.
The request body should be: {"info": {"status": "cancel"}}

Change-Id: I4a427d99e533979be42a84d388324ec2f933acc2
Partial-Implements: bp v2-api-experimental-impl
2017-05-04 12:44:46 +08:00
Shu Yingya e0477d161c [APIv2] Refactor job refresh status
The endpoint /jobs/{job_id}/refresh-status has been removed in favor
of using a GET on the new /jobs/{job_id} endpoint with parameter.
To refresh job status, we can GET on:
http://{host:ip}/v2/jobs/{job_id}?refresh_status=True

Change-Id: I8674a9f26512702f1732c0fefb230a1c0ab90e1e
Partial-Implements: bp v2-api-experimental-impl
2017-05-04 12:44:39 +08:00
Marianne Linhares Monteiro 21045d3c39 [APIv2] Rename oozie_job_id
oozie_job_id should be changed to engine_job_id.

This patch only changes json responses, the complete
change should be done when APIv2 is stable
and APIv1 deprecated. Along with this should be a
data model change as well.

Change-Id: I2ecfbb56d1e53d6b005ae6a52c70576238341da2
Partial-Implements: bp v2-api-experimental-impl
2017-04-27 17:02:13 -03:00
Shu Yingya d5467e30ff [APIv2] Refactor job execute endpoint
This patch is going to update endpoint of job execution.
Executing a job template through the /jobs/{job_id}/execute endpoint
has been changed to a POST operation on the new /jobs endpoint.

Change-Id: Ic511b0442ea4464ace6370454631fc090c428638
Partial-Implements: bp v2-api-experimental-impl
2017-03-09 09:02:15 +00:00
Shu Yingya e4dc6fd5bd [APIv2] Further rename endpoint of jobs & job_executions
Patch [1] has already changed endpoint from jobs to
job_templates and job_executions to jobs.
However, the filename is still confusing.
Follow changes included in this patch:
 * rename filenames: jobs.py -> job_templates.py
                     job_executions.py -> jobs.py
 * rename function name in "api/v2":
                     job_list() -> job_template_list()
 * rename parameter in both "api/v11.py" and "api/v2":
                     job_id -> job_templates_id
                     job_execution_id -> job_id
                     ...
I want to correct the parameter name in APIv2,
but that leads to validation error. So I also changed
the parameter name in "api/v11.py"

[1]: https://review.openstack.org/#/c/309395/

Partial-Implements: bp v2-api-experimental-impl
Change-Id: Ia7a7ca811c82ddea13c21521a3abd62165ebd513
2017-03-06 20:21:24 +08:00
Mikhail Lelyakin 9cf7c30b45 Add sorting ability to Sahara-API
Sorting ability was added to api
v1.0, v1.1 and v2

Change-Id: Icb83422a516961acd7c1c20a88cb0bb816c6bc81
bp: pagination
Depends-on: I50fa225361617e835c314e873035704b9fe811d0
2016-08-10 10:11:44 +00:00
Mikhail Lelyakin 2d9c8abff5 Add pagination ability to Sahara-API
Pagination ability was added to api
v1.0, v1.1 and v2

Change-Id: I50fa225361617e835c314e873035704b9fe811d0
bp: pagination
2016-07-21 00:36:15 +03:00
pratik-gadiya 44c5332bf3 Renamed job execution and templates endpoints
/jobs endpoint should be renamed to .../job-templates,
and then the .../job-executions endpoint should be
renamed to .../jobs

Change-Id: I5d1a3d594b7716555df6f5b2619a596f551ba14e
Partial-Implements: bp v2-api-experimental-impl
2016-04-22 13:14:58 +00:00
Michael McCune ef3815988e rename service api modules
This change renames the service api modules to be organized under the
sahara.service.api package. A v2 package has been added which holds the
equivalent v10 and v11 functions. To make the api version setup
transparent to the caller, the global OPS variable has been refactored
into the base sahara.service.api package.

Changes
* create sahara/service/api package
* rename sahara/service/api.py to sahara/service/api/v10.py
* rename sahara/service/edp/api.py to sahara/service/api/v11.py
* correct occurances of old imports in code and tests
* rename sahara/tests/unit/service/test_api.py to
  sahara/tests/unit/service/api/test_v10.py
* add initial v2 equivalents for current api services
* move global OPS object into the sahara.service.api package
* add documentation for the api service layer

Partial-Implements: bp v2-api-experimental-impl
Depends-On: I16918a30a862b42edd7a982caf555be618199ac3
Change-Id: Iefbedbc76ac620ff012bcaf536c17637b6252a15
2016-03-28 19:21:19 -04:00
Michael McCune a9137addb4 add initial v2 api
this change implements the initial v2 experimental api. it is
implemented as an optional series of class that can be configured
through the paste deploy configuration file.

* add wsgi auth validator
* add middleware router
* add v2 endpoints
* add v2 flask blueprint object
* add optional paste filter and composite
* add developer docs for v2 api

Change-Id: I74627c0879851b354b5043f8a6ff91bae8438bb1
Partial-Implements: bp v2-api-experimental-impl
2016-02-10 09:56:07 -05:00