Created
February 11, 2013 14:35
-
-
Save giorgian/4754737 to your computer and use it in GitHub Desktop.
Trying to create (or update) a data bag item via Chef REST API (using a non-ruby client), a key `action` gets removed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Trying to create a data bag item foo bar with the following json via REST API: | |
{ | |
"id": "bar", | |
"key": "value", | |
"action": "remove" | |
} | |
// The POST succeeds, but then the content of the data bag item is: | |
{ | |
"id": "bar", | |
"key": "value" | |
} | |
// This is instead the body of the POST sent by knife data bag from file foo | |
{ | |
"name": "data_bag_item_foo_bar", | |
"json_class": "Chef::DataBagItem", | |
"chef_type": "data_bag_item", | |
"data_bag": "foo", | |
"raw_data": { | |
"id": "bar", | |
"key": "value", | |
"action": "remove" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sniffing local traffic on the server, I captured this piece of internal communication: