Skip to content

Instantly share code, notes, and snippets.

@StlTenny
Last active October 30, 2015 11:18
Show Gist options
  • Save StlTenny/a1d2403978e7ec194457 to your computer and use it in GitHub Desktop.
Save StlTenny/a1d2403978e7ec194457 to your computer and use it in GitHub Desktop.
require ‘net/http’
require ‘cgi’
class StatusMessage
attr_accessor :status, :status_endpoint
end
def whyrun_supported?
true
end
action :run do
converge_by(“Posting Status Update of “#{resource.status}”) do
notify_endpoint
end
end
def notify_endpoint
resource.query_params[“status”] = resource.status
query_url = resource.status_endpoint + “?” + resource.query_params.map{|k,v| “#{k}={v}”}*”&”
uri = URI.parse(query_url)
http = Net::HTTP.new(uri.host,uri.port)
// additional implementation of notify here
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment