Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

webhooks (6) Versions 0.1.3

LWRP Providers for API Calls

Policyfile
Berkshelf
Knife
cookbook 'webhooks', '= 0.1.3', :supermarket
cookbook 'webhooks', '= 0.1.3'
knife supermarket install webhooks
knife supermarket download webhooks
README
Dependencies
Changelog
Quality 0%

Webhooks Cookbook

<br />
Maybe you are using Chef-Solo and need an API to store node configuration or other configuration values. Maybe you just want to access an API for whatever reason. Maybe you don't need this because you are using Chef-Server. I found a use for it, maybe you can to!

Supported Platforms

Debian(6.x+), Ubuntu(10.04+)
CentOS(6.x+), RedHat, Fedora(20+)

Tested Against

Debian 6.x and above
Ubuntu 10.04 and above
CenOS 6.x and above
Fedora 20

Planned Improvements

0.1.2 - Enable Proxy

No additional cookboks are required.
<br />
<br />
<br />

Attributes


webhooks::default

<br />
<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>["webhooks"]["get_response"]</tt></td>
<td>String</td>
<td>Store GET Response and Parse it Later.</td>
<td><tt>Empty</tt></td>
</tr>
<tr>
<td><tt>["webhooks"]["post_response"]</tt></td>
<td>String</td>
<td>Store POST Response and Parse it Later.</td>
<td><tt>Empty</tt></td>
</tr>
<tr>
<td><tt>["webhooks"]["put_response"]</tt></td>
<td>String</td>
<td>Store PUT Response and Parse it Later.</td>
<td><tt>Empty</tt></td>
</tr>
</table>
<br />
<br />
<br />

Resource/Provider


webhooks_request

<br />

Actions

  • :get
  • :post
  • :put <br /> <br /> ### Attribute Parameters
#Default name for operation.  Not used for other than resource name.
attribute :operation_name, :name_attribute => true, :kind_of => String, :required => true

#Base Required Options
attribute :uri, :kind_of => String, :required => true, :default => nil
attribute :uri_port, :kind_of => Integer, :required => false, :default => 80
attribute :expected_response_codes, :kind_of => Array, :required => false, :default => [200]
attribute :follow_redirect, :kind_of => [ TrueClass, FalseClass ], :default => false
attribute :read_timeout, :kind_of => Integer, :required => false, :default => 60
attribute :use_ssl, :kind_of => [ TrueClass, FalseClass ], :default => false
attribute :ssl_validation, :kind_of => [ TrueClass, FalseClass ], :default => true
attribute :post_data, :kind_of => Hash, :required => false, :default => nil
attribute :header_data, :kind_of => Hash, :required => false, :default => nil
attribute :save_response, :kind_of => [ TrueClass, FalseClass ], :default => true
attribute :post_json, :kind_of => [ TrueClass, FalseClass ], :default => false
attribute :post_xml, :kind_of => [ TrueClass, FalseClass ], :default => false

#Basic Authentication
attribute :use_basic_auth, :kind_of => [ TrueClass, FalseClass ], :default => false
attribute :basic_auth_username, :kind_of => String, :required => false, :default => nil
attribute :basic_auth_password, :kind_of => String, :required => false, :default => nil

#Proxy Options
attribute :use_proxy, :kind_of => [ TrueClass, FalseClass ], :default => false
attribute :proxy_address, :kind_of => String, :required => false, :default => nil
attribute :proxy_port, :kind_of => Integer, :required => false, :default => nil
attribute :proxy_username, :kind_of => String, :required => false, :default => nil
attribute :proxy_password, :kind_of => String, :required => false, :default => nil

<br />
<br />

Example

webhooks_request "Test Get" do
  uri "s1n4l2z.runscope.net/"
  use_ssl true
  expected_response_codes [ 200, 201 ]
  action :get
end
webhooks_request "Test Post" do
  uri "s1n4l2z.runscope.net/gethosts?api_key=123"
  use_ssl true
  post_json true
  post_data (
                { 'value1' => '1', 'value2' => '2'}
            )
  header_data (
                { 'header1' => '1', 'header2' => '2', 'User-Agent' => 'Mozilla/5.0'}
              )
  expected_response_codes [ 200, 201 ]
  action :post
end

<br />
<br />
<br />

Recipe Usage

N/A NONE

<br />
<br />
<br />

License and Authors


Authors: Brian Stajkowski

Copyright 2014 Brian Stajkowski

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

webhooks CHANGELOG

0.1.3

  • stajkowski - Fixed URI parse for parameters. Now you can include www.mysite.com/gethosts?api_key=123 URL parameters and they will be passed. Added post_json option to post post_data as json; default is set to false but just enable with true. Moved the entire implementation to a Library WebhooksNS into Chef::Provider::LWRP and Chef::Recipe so you can access in either an LWRP or Recipe by WebhooksNS.execute_request

The defaults of the method follow the defaults of the LWRP Resource so if you don't include a parameter then it will default to what is described for the LWRP Resource. Please see the Provider on how to use
this Library; basically, you get the full response back and can use it how you please.


0.1.25

  • stajkowski - Fix ssl validation disable. Also adjusted exception message and exit status.

0.1.2

  • stajkowski - Add ssl_validation attribute. It is set to enable by default; disable it for self signed certs.

0.1.1

  • stajkowski - Fix Documentation

0.1.0

  • stajkowski - Initial release of webhooks

Foodcritic Metric
            

0.1.3 failed this metric

FC002: Avoid string interpolation where not required: /tmp/cook/f8b7f8ab8d6788ab971d2f8d/webhooks/libraries/webhooks.rb:86
FC002: Avoid string interpolation where not required: /tmp/cook/f8b7f8ab8d6788ab971d2f8d/webhooks/libraries/webhooks.rb:105