Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
danryan committed Aug 8, 2013
1 parent 1069f48 commit cb27db9
Show file tree
Hide file tree
Showing 16 changed files with 443 additions and 35 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Revily

TODO: Write a gem description
[![Build
Status](https://secure.travis-ci.org/revily/revily-client.png?branch=master)](https://travis-ci.org/revily/revily-client)¬
[![Code
Climate](https://codeclimate.com/github/revily/revily-client.png)](https://codeclimate.com/github/revily/revily-client)¬

## Installation

Expand Down
6 changes: 3 additions & 3 deletions lib/revily/client/resources/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ def service_trigger_incident(key, message=nil, description=nil, options={})
message: message,
description: description,
key: key
}
}.reject { |k,v| v.nil? }
put "trigger", options.merge(incident)
end
alias_method :service_trigger, :service_trigger_incident

def service_acknowledge_incident(key, options={})
put "acknowledge", options.merge(key: key)
boolean_from_response :put, "acknowledge", options.merge(key: key)
end
alias_method :service_acknowledge, :service_acknowledge_incident

def service_resolve_incident(key, options={})
put "resolve", options.merge(key: key)
boolean_from_response :put, "resolve", options.merge(key: key)
end
alias_method :service_resolve, :service_resolve_incident

Expand Down
10 changes: 7 additions & 3 deletions lib/revily/client/resources/policies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ def policy(id, options={})
end

def create_policy(name, loop_limit, options={})
post "policies", options.merge({name: name, loop_limit: loop_limit})
params = {
name: name,
loop_limit: loop_limit
}
post "policies", options.merge(params)
end

def update_policy(id, options={})
patch "policies/#{id}", options
boolean_from_response :patch, "policies/#{id}", options
end

def delete_policy(id, options={})
delete "policies/#{id}", options
boolean_from_response :delete, "policies/#{id}", options
end

end
4 changes: 2 additions & 2 deletions lib/revily/client/resources/policy_rules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def create_policy_rule(policy_id, assignment_id, assignment_type, position=nil,
alias :create_rule :create_policy_rule

def update_policy_rule(policy_id, id, options={})
patch "policies/#{policy_id}/rules/#{id}", options
boolean_from_response :patch, "policies/#{policy_id}/rules/#{id}", options
end
alias :update_rule :update_policy_rule

def delete_policy_rule(policy_id, id, options={})
delete "policies/#{policy_id}/rules/#{id}", options
boolean_from_response :delete, "policies/#{policy_id}/rules/#{id}", options
end
alias :delete_rule :delete_policy_rule

Expand Down
18 changes: 13 additions & 5 deletions lib/revily/client/resources/schedules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@ module Revily::Client::Resources::Schedules
def schedules(options={})
get "schedules", options
end
alias :list_schedules :schedules
alias_method :list_schedules, :schedules

def schedule(id, options={})
get "schedules/#{id}", options
end

def create_schedule(name, auto_resolve_timeout, acknowledge_timeout, options={})
post "schedules", options.merge({name: name})
def create_schedule(name, time_zone=nil, options={})
params = {
name: name,
time_zone: time_zone
}
post "schedules", options.merge(params)
end

def update_schedule(id, options={})
patch "schedules/#{id}", options
params = {
name: options[:name],
time_zone: options[:time_zone]
}.reject { |k,v| v.nil? }
boolean_from_response :patch, "schedules/#{id}", options
end

def delete_schedule(id, options={})
delete "schedules/#{id}", options
boolean_from_response :delete, "schedules/#{id}", options
end
end
5 changes: 5 additions & 0 deletions lib/revily/client/resources/services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ def create_service(name, acknowledge_timeout, auto_resolve_timeout, options={})
end

def update_service(id, options={})
params = {
name: options[:name],
acknowledge_timeout: options[:acknowledge_timeout],
auto_resolve_timeout: options[:auto_resolve_timeout]
}.reject { |k,v| v.nil? }
boolean_from_response :patch, "services/#{id}", options
end

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cb27db9

Please sign in to comment.