In master environment, it is different behavior when we try to delete with request body. I fixed it in [1] but network/subnet/port doesn't pass this code:
[1] https://github.com/openstack/neutron/blame/master/neutron/api/v2/base.py#L555
[FloatingIP, Router] $ source ~/devstack/openrc admin admin; export TOKEN=`openstack token issue | grep ' id ' | get_field 2` $ curl -i -X DELETE -d '{"floatingip":{"description": "aaa"}}' -H "content-type:application/json" -H 'accept:application/json' -H "x-auth-token:$TOKEN" 192.168.122.33:9696/v2.0/floatingips/f4e9b845-4472-4806-bd7a-bec8f7618af2 HTTP/1.1 400 Bad Request Content-Length: 113 Content-Type: application/json X-Openstack-Request-Id: req-deaffdb3-7c13-4604-89d0-78fbcc184ef5 Date: Fri, 30 Jun 2017 00:56:56 GMT
{"NeutronError": {"message": "Request body is not supported in DELETE.", "type": "HTTPBadRequest", "detail": ""}}
$ curl -i -X DELETE -d '{"router": {"name": "aaa"}}' -H "content-type:application/json" -H 'accept:application/json' -H "x-auth-token:$TOKEN" 192.168.122.33:9696/v2.0/routers/1d0ea30e-c481-4be3-a548-a659d9e3787c HTTP/1.1 400 Bad Request Content-Length: 113 Content-Type: application/json X-Openstack-Request-Id: req-a2f9babb-4eb3-471e-9b42-ccfe722c44f0 Date: Fri, 30 Jun 2017 01:44:40 GMT
[Network/Subnet/Port] $ source ~/devstack/openrc admin admin; export TOKEN=`openstack token issue | grep ' id ' | get_field 2` $ curl -i -X DELETE -d '{"network":{"name": "aaaa"}}' -H "content-type:application/json" -H 'accept:application/json' -H "x-auth-token:$TOKEN" 192.168.122.33:9696/v2.0/networks/1fb94931-dabe-49dc-bce4-68c8bafea8b0
HTTP/1.1 204 No Content Content-Length: 0 X-Openstack-Request-Id: req-7e838c38-e6cd-46c3-8703-c93f5bb4a503 Date: Fri, 30 Jun 2017 01:32:12 GMT
$ curl -i -X DELETE -d '{"subnet": {"name": "aaa"}}' -H "content-type:application/json" -H 'accept:application/json' -H "x-auth-token:$TOKEN" 192.168.122.33:9696/v2.0/subnets/a18fb191-2a89-4193-80d1-5330a8052d64
HTTP/1.1 204 No Content Content-Length: 0 X-Openstack-Request-Id: req-901476cf-7e87-4b7c-ab20-209b81d2eb25 Date: Fri, 30 Jun 2017 01:37:01 GMT
$ curl -i -X DELETE -d '{"port": {"name": "aaa"}}' -H "content-type:application/json" -H 'accept:application/json' -H "x-auth-token:$TOKEN" 192.168.122.33:9696/v2.0/ports/47f2c36a-7461-4c1a-a23e-931d5aee3f9c
HTTP/1.1 204 No Content Content-Length: 0 X-Openstack-Request-Id: req-48452706-6309-42c2-ac80-f0f4e387060e Date: Fri, 30 Jun 2017 01:37:33 GMT
In master environment, it is different behavior when we try to delete with
request body. I fixed it in [1] but network/subnet/port doesn't pass this code:
[1] https:/ /github. com/openstack/ neutron/ blame/master/ neutron/ api/v2/ base.py# L555
[FloatingIP, Router] :{"description" : "aaa"}}' -H "content- type:applicatio n/json" -H 'accept: application/ json' -H "x-auth- token:$ TOKEN" 192.168. 122.33: 9696/v2. 0/floatingips/ f4e9b845- 4472-4806- bd7a-bec8f7618a f2 Request- Id: req-deaffdb3- 7c13-4604- 89d0-78fbcc184e f5
$ source ~/devstack/openrc admin admin; export TOKEN=`openstack token issue | grep ' id ' | get_field 2`
$ curl -i -X DELETE -d '{"floatingip"
HTTP/1.1 400 Bad Request
Content-Length: 113
Content-Type: application/json
X-Openstack-
Date: Fri, 30 Jun 2017 00:56:56 GMT
{"NeutronError": {"message": "Request body is not supported in DELETE.", "type": "HTTPBadRequest", "detail": ""}}
$ curl -i -X DELETE -d '{"router": {"name": "aaa"}}' -H "content- type:applicatio n/json" -H 'accept: application/ json' -H "x-auth- token:$ TOKEN" 192.168. 122.33: 9696/v2. 0/routers/ 1d0ea30e- c481-4be3- a548-a659d9e378 7c Request- Id: req-a2f9babb- 4eb3-471e- 9b42-ccfe722c44 f0
HTTP/1.1 400 Bad Request
Content-Length: 113
Content-Type: application/json
X-Openstack-
Date: Fri, 30 Jun 2017 01:44:40 GMT
{"NeutronError": {"message": "Request body is not supported in DELETE.", "type": "HTTPBadRequest", "detail": ""}}
[Network/ Subnet/ Port] :{"name" : "aaaa"}}' -H "content- type:applicatio n/json" -H 'accept: application/ json' -H "x-auth- token:$ TOKEN" 192.168. 122.33: 9696/v2. 0/networks/ 1fb94931- dabe-49dc- bce4-68c8bafea8 b0
$ source ~/devstack/openrc admin admin; export TOKEN=`openstack token issue | grep ' id ' | get_field 2`
$ curl -i -X DELETE -d '{"network"
HTTP/1.1 204 No Content Request- Id: req-7e838c38- e6cd-46c3- 8703-c93f5bb4a5 03
Content-Length: 0
X-Openstack-
Date: Fri, 30 Jun 2017 01:32:12 GMT
$ curl -i -X DELETE -d '{"subnet": {"name": "aaa"}}' -H "content- type:applicatio n/json" -H 'accept: application/ json' -H "x-auth- token:$ TOKEN" 192.168. 122.33: 9696/v2. 0/subnets/ a18fb191- 2a89-4193- 80d1-5330a8052d 64
HTTP/1.1 204 No Content Request- Id: req-901476cf- 7e87-4b7c- ab20-209b81d2eb 25
Content-Length: 0
X-Openstack-
Date: Fri, 30 Jun 2017 01:37:01 GMT
$ curl -i -X DELETE -d '{"port": {"name": "aaa"}}' -H "content- type:applicatio n/json" -H 'accept: application/ json' -H "x-auth- token:$ TOKEN" 192.168. 122.33: 9696/v2. 0/ports/ 47f2c36a- 7461-4c1a- a23e-931d5aee3f 9c
HTTP/1.1 204 No Content Request- Id: req-48452706- 6309-42c2- ac80-f0f4e38706 0e
Content-Length: 0
X-Openstack-
Date: Fri, 30 Jun 2017 01:37:33 GMT