Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rest_cherrypy - salt-api - How to change HTTP response status from runner client? #37458

Closed
danlsgiga opened this issue Nov 3, 2016 · 3 comments
Labels
Duplicate Duplicate of another issue or PR - will be closed Feature new functionality including changes to functionality and code refactors, etc. P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-low 4th level, cosemtic problems, work around exists
Milestone

Comments

@danlsgiga
Copy link
Contributor

I'm using the Salt-Api with the runner client for a long time but there's one specific requirement for our team to have specific HTTP status on the api returns based on the execution of our runners.
What happens is that I'm unable to specify in the runner level what should be the HTTP status code for specific conditions of the runner execution:

So, for example, we have a runner that does an automated deployment in all our nodes for a specific application. It can handle all the issues that can potentially happen in the deploy, including rollbacks. But since a valid and correct response of 200 from the API gives Jenkins the false impression that the deploy was successful even when it failed. This is a requirement from our development team to have proper HTTP status responses based on the outcome of the deployment execution.

Is there any way I can achieve this using the current restcherry api implementation?

@whiteinge
Copy link
Contributor

This is not currently possible. Salt's Python API only supports passing the return value through to the caller, no additional meta data. There is an in-progress effort to add the ability to programmatically determine the exit value of a function call in Salt which will eventually be exposed at the CLI as exit codes and via the REST API in the form of HTTP status codes. See #18510 and #37043 for more information.

In the meantime, the return value must be parsed to fish for errors. This is also true of Salt's CLI.

@gtmanfred gtmanfred added this to the Approved milestone Nov 4, 2016
@gtmanfred gtmanfred added Feature new functionality including changes to functionality and code refactors, etc. P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps TEAM Platform severity-low 4th level, cosemtic problems, work around exists labels Nov 4, 2016
@danlsgiga
Copy link
Contributor Author

Thanks @whiteinge, great info! Looking forward to have that feature.

@whiteinge
Copy link
Contributor

That's one I'm really looking forward to as well. 😄

I'm going to close this issue out as a duplicate. If there's any detail the above two issues are missing, please feel free to reopen this issue or comment on those issues.

@danlsgiga danlsgiga added the Duplicate Duplicate of another issue or PR - will be closed label Nov 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Duplicate of another issue or PR - will be closed Feature new functionality including changes to functionality and code refactors, etc. P1 Priority 1 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-low 4th level, cosemtic problems, work around exists
Projects
None yet
Development

No branches or pull requests

3 participants