Class | Chef::REST |
In: |
lib/chef/rest/auth_credentials.rb
lib/chef/rest/rest_request.rb lib/chef/rest/cookie_jar.rb lib/chef/rest.rb |
Parent: | Object |
Chef‘s custom REST client with built-in JSON support and RSA signed header authentication.
CONTENT_ENCODING | = | "content-encoding".freeze |
GZIP | = | "gzip".freeze |
DEFLATE | = | "deflate".freeze |
IDENTITY | = | "identity".freeze |
auth_credentials | [R] | |
cookies | [RW] | |
redirect_limit | [RW] | |
sign_on_redirect | [RW] | |
url | [RW] |
Create a REST client object. The supplied url is used as the base for all subsequent requests. For example, when initialized with a base url localhost:4000, a call to get_rest with ‘nodes’ will make an HTTP GET request to localhost:4000/nodes
Streams a download to a tempfile, then yields the tempfile to a block. After the download, the tempfile will be closed and unlinked. If you rename the tempfile, it will not be deleted. Beware that if the server streams infinite content, this method will stream it until you run out of disk space.
Send an HTTP GET request to the path
Using this method to fetch a file is considered deprecated.
path: | The path to GET |
raw: | Whether you want the raw body returned, or JSON inflated. Defaults |
to JSON inflated.
Use api_request instead
Makes a streaming download request. Doesn‘t speak JSON. Streams the response body to a tempfile. If a block is given, it‘s passed to Tempfile.open(), which means that the tempfile will automatically be unlinked after the block is executed.
If no block is given, the tempfile is returned, which means it‘s up to you to unlink the tempfile when you‘re done with it.