Method: Chef::Node#save
- Defined in:
- lib/chef/node.rb
#save ⇒ Object
Save this node via the REST API
415 416 417 418 419 420 421 422 423 424 425 426 427 |
# File 'lib/chef/node.rb', line 415 def save r = Chef::REST.new(Chef::Config[:chef_server_url]) begin r.put_rest("nodes/#{Chef::Node.escape_node_id(@name)}", self) rescue Net::HTTPServerException => e if e.response.code == "404" r.post_rest("nodes", self) else raise e end end self end |