gnocchixyz / python-gnocchiclient

Python client from Gnocchi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gnocchi resource-type update instance -a hostthem:string:true:fill=a does not work

jd opened this issue · comments

REQ: curl -g -i -X PATCH http://127.0.0.1:8041/v1/resource_type/instance -H "User-Agent: gnocchi keystoneauth1/3.1.0 python-requests/2.18.2 CPython/2.7.13" -H "Content-Type: application/json-patch+json" -H "Accept: application/json, */*" -H "X-Auth-Token: {SHA1}e6c606ff3206015e5e623cfaf7446c75ca836c76" -d '[{"path":"\/attributes\/hostthem","value":{"required":true,"type":"string","fill":"a"},"op":"add"}]'
Starting new HTTP connection (1): 127.0.0.1
http://127.0.0.1:8041 "PATCH /v1/resource_type/instance HTTP/1.1" 400 152
RESP: [400] Date: Tue, 19 Dec 2017 14:21:56 GMT Server: Apache Content-Length: 152 Connection: close Content-Type: application/json 
RESP BODY: {"code": 400, "description": "Invalid input: not a valid value for dictionary value @ data['attributes'][u'hostthem'][u'type']", "title": "Bad Request"}

Invalid input: not a valid value for dictionary value @ data['attributes'][u'hostthem'][u'type'] (HTTP 400)

[15:28:13] <jd_> sum12: yeah so the fill options is in the wrong spot
[15:28:51] <jd_> it should be {"required":true,"type":"string", "options": {"fill":"a"}}

reported by @sum12

I have similar problem:

Making authentication request to http://192.168.1.1:5000/v2.0/tokens
"POST /v2.0/tokens HTTP/1.1" 200 1559
REQ: curl -g -i -X PATCH http://192.168.1.1:8041/v1/resource_type/host_network_interface -H "User-Agent: gnocchi ..." -H "Content-Type: application..." -H "Accept: application/json, /" -H "X-Auth-Token: {SHA1}..." -d '[{"path": "/attributes/mac", "value": {"max_length": 255, "required": false, "type": "string"}, "op": "add"}]'
Starting new HTTP connection (1): 192.168.1.1
"PATCH /v1/resource_type/host_network_interface HTTP/1.1" 405 63
RESP: [405] Allow: DELETE, GET Content-Length: 63 Content-Type: application/json; charset=UTF-8 Connection: close
RESP BODY: {"code": 405, "description": "", "title": "Method Not Allowed"}

gnocchi: 2.2.1
gnocchiclient: 2.8.2

This has been fixed in gnocchiclient 7.0.1.

I updated package. It still returns 405.

Gnocchi 2.2.1 does not support that feature.