Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This document describes the relevant changes beween releases of the
_hawkular-client_ project.

=== V 0.2.1

* Add support to create items in inventory

=== V 0.2.0

* Add support for Hawkular-Inventory and Hawkular-Alerts
Expand Down
24 changes: 13 additions & 11 deletions lib/hawkular.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def http_get(suburl, headers = {})
# @param [String] url_part Part of an url to be escaped
# @return [String] escaped url_part as new string
def hawk_escape(url_part)
return url_part.to_s if url_part.is_a?(Numeric)

sub_url = url_part.dup
sub_url.gsub!('%', '%25')
sub_url.gsub!(' ', '%20')
Expand Down Expand Up @@ -171,6 +173,17 @@ def generate_query_params(param_hash = {})
ret
end

# Specialized exception to be thrown
# when the interaction with Hawkular fails
class HawkularException < StandardError
def initialize(message, status_code = 0)
@message = message
@status_code = status_code
super(message)
end
attr_reader :message, :status_code
end

private

def not_suitable?(v)
Expand Down Expand Up @@ -208,15 +221,4 @@ def handle_fault(f)
end
end
end

# Specialized exception to be thrown
# when the interaction with Hawkular fails
class HawkularException < StandardError
def initialize(message, status_code = 0)
@message = message
@status_code = status_code
super(message)
end
attr_reader :message, :status_code
end
end
Loading