Chef web app developer training - Part 7 continued even more (draft)


here are some checks that you have setup the data bag correctly;




Part 7

======



once the data bag is setup correctly, you should be able to search the fields you created


1) search for goalies in your data bag;


$ knife search everton position:goalie
1 items found

chef_type: data_bag_item
data_bag:  everton
id:        neville-southall
position:  goalie





2) search in long form, and output to json


$ knife search everton position:goalie -l -Fj
{
  "results": 1,
  "rows": [
    {
      "name": "data_bag_item_everton_neville-southall",
      "json_class": "Chef::DataBagItem",
      "chef_type": "data_bag_item",
      "data_bag": "everton",
      "raw_data": {
        "position": "goalie",
        "id": "neville-southall"
      }
    }
  ]
}

No comments:

Post a Comment

Don't be nasty. Being rude is fine.