tumblr / collins

groovy kind of love
tumblr.github.com/collins
Apache License 2.0
570 stars 99 forks source link

API documentation: curl examples for Asset delete and decommission miss 'reason' #603

Open justme-justus opened 5 years ago

justme-justus commented 5 years ago

Following the curl examples on

https://tumblr.github.io/collins/api.html

I expect the API to delete my asset with

# curl --basic -u blake:admin:first -d nuke=true -X DELETE http://localhost:9000/api/asset/testswitch {"status":"error","data":{"message":"Reason must be specified."}}

Same counts for decommissioning

# curl --basic -u blake:admin:first -d status='Decommissioned' -X POST http://localhost:9000/api/asset/testswitch {"status":"error","data":{"message":"No reason for the status change was specified."}}

Adding -d reason="foobar" makes the API call work for both actions.

# curl --basic -u blake:admin:first -d status='Decommissioned' -d reason='foobar' -X POST http://localhost:9000/api/asset/testswitch {"status":"success:ok","data":{"SUCCESS":true}}

curl --basic -u blake:admin:first -d nuke=true -d reason='foobar' -X DELETE http://localhost:9000/api/asset/testswitch {"status":"success:ok","data":{"SUCCESS":true}}

Please fix documentation.

Thanks in advance and best regards