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

RSS

webhooks (6) Versions 0.2.0

LWRP Providers for API Calls

Berkshelf/Librarian
Policyfile
Knife
cookbook 'webhooks', '~> 0.2.0'
cookbook 'webhooks', '~> 0.2.0', :supermarket
knife cookbook site install webhooks
knife cookbook site download webhooks
README
Dependencies
Changelog
Quality 44%

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>Nil</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>Nil</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>Nil</tt></td> </tr> <tr> <td><tt>["webhooks"]["response_code"]</tt></td> <td>String</td> <td>Store Response Code.</td> <td><tt>Nil</tt></td> </tr> <tr> <td><tt>["webhooks"]["response_message"]</tt></td> <td>String</td> <td>Store Response Message.</td> <td><tt>Nil</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.2.0

  • stajkowski - Added to attributes default["webhooks"]["response_code"] and default["webhooks"]["response_message"] to capture request response codes and messages. Fixed ###.new URI parameter passing for requests that do not contain a parameter.

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

Collaborator Number Metric
            

0.2.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.2.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.2.0 failed this metric

FC057: Library provider does not declare use_inline_resources: webhooks/libraries/webhooks.rb:1
FC057: Library provider does not declare use_inline_resources: webhooks/libraries/webhooks.rb:166
FC064: Ensure issues_url is set in metadata: webhooks/metadata.rb:1
FC065: Ensure source_url is set in metadata: webhooks/metadata.rb:1
FC066: Ensure chef_version is set in metadata: webhooks/metadata.rb:1
FC069: Ensure standardized license defined in metadata: webhooks/metadata.rb:1
FC070: Ensure supports metadata defines valid platforms: webhooks/metadata.rb:1
FC072: Metadata should not contain "attribute" keyword: webhooks/metadata.rb:1
Run with Foodcritic Version 12.2.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

0.2.0 failed this metric

webhooks does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, Apache 2.0, MIT, mit, GPL-2.0, gplv2, GNU Public License 2.0, GPL-3.0, gplv3, GNU Public License 3.0.

No Binaries Metric
            

0.2.0 passed this metric

Publish Metric
            

0.2.0 passed this metric

Supported Platforms Metric
            

0.2.0 passed this metric

Testing File Metric
            

0.2.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.2.0 passed this metric