Skip to content

Trying to create new kv pair on existing system via the API yields "Cannot create a new item, only existing items may be updated." #4

@zeeman

Description

@zeeman

This is for my currently private branch eav-api-writable.

zane@zane-OptiPlex-990 (~/cyder)$ curl -v -X PUT -H "Content-Type: application/json" -H "Authorization: Token 18d0e36dad2b2ae5818954eef8d2a091452d23ec" --data '{"name": "test-system", "systemav_set":[{"attribute":"Operating System", "value": "windoze"}]}' http://127.0.0.1:8000/api/v1/core/system/12541/
* About to connect() to 127.0.0.1 port 8000 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
> PUT /api/v1/core/system/12541/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1:8000
> Accept: */*
> Content-Type: application/json
> Authorization: Token 18d0e36dad2b2ae5818954eef8d2a091452d23ec
> Content-Length: 94
>
* upload completely sent off: 94 out of 94 bytes
* HTTP 1.0, assume close after body
< HTTP/1.0 400 BAD REQUEST
< Date: Sat, 09 Nov 2013 00:33:01 GMT
< Server: WSGIServer/0.1 Python/2.7.4
< Vary: Accept, Cookie
< Content-Type: application/json
< Allow: GET, PUT, DELETE, HEAD, OPTIONS, PATCH
< Set-Cookie:  cyder=90e0bb240817d1006100e991563df5c8; expires=Sat, 23-Nov-2013 00:33:01 GMT; httponly; Max-Age=1209600; Path=/
<
* Closing connection 0
{"systemav_set": [{"non_field_errors": ["Cannot create a new item, only existing items may be updated."]}]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions