Ask Your Question
0

Mark Unhealthy Resources with method POST/PUT instead of PATCH

asked 2018-01-09 06:01:12 -0500

anonymous user

Anonymous

updated 2018-01-11 09:22:08 -0500

zaneb gravatar image

Hi everyone,

I am just trying to mark as unhealthy a resource. This is the command I use with method PATCH:

curl -X PATCH -d '{ "mark_unhealthy": true, "resource_status_reason": "repair" }' '/v1/tenant_id/stacks/stack_id/resource_id' -H "Content-Type: application/json" -H 'X-Auth-Token: 43ac1a9369e64864863974782e7ab70b'

But I would like to perform the same operation with method POST or PUT. What I used is this:

curl -X POST -d ' {"name": "mark_unhealthy", "args": { "unhealthy": "true", "resource_status_reason": "repair" }}' '/v1/tenant_id/stacks/stack_id/resource_id' -H "Content-Type: application/json" -H 'X-Auth-Token: 43ac1a9369e64864863974782e7ab70b'

but with no success. Any ideas? Is it possible? I tried this alternative, as I found this page: https://specs.openstack.org/openstack/heat-specs/specs/mitaka/mark-unhealthy.html (https://specs.openstack.org/openstack...)

Thank you

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-01-10 15:50:45 -0500

updated 2018-01-10 15:55:24 -0500

The API uses PATCH: https://developer.openstack.org/api-r.... Not PUT or POST.

Specs are proposal for changes. The spec you reference lists alternatives to the proposed change, among them a POST. It then explains why a PATCH is the appropriate solution.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-01-09 06:01:12 -0500

Seen: 44 times

Last updated: Jan 10