mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
create instrumentations, handle errors better, get an individual instrumentation
This commit is contained in:
parent
6f42542600
commit
df73f445d7
5 changed files with 13 additions and 0 deletions
|
@ -18,6 +18,8 @@ module Fog
|
|||
|
||||
request :describe_analytics
|
||||
request :list_instrumentations
|
||||
request :get_instrumentation
|
||||
request :create_instrumentation
|
||||
|
||||
|
||||
model_path 'fog/joyent/models/analytics'
|
||||
|
@ -132,6 +134,9 @@ module Fog
|
|||
|
||||
response
|
||||
rescue Excon::Errors::HTTPStatusError => e
|
||||
if e.response.headers["Content-Type"] == "application/json"
|
||||
e.response.body = json_decode(e.response.body)
|
||||
end
|
||||
raise_if_error!(e.request, e.response)
|
||||
end
|
||||
|
||||
|
|
|
@ -173,6 +173,9 @@ module Fog
|
|||
|
||||
response
|
||||
rescue Excon::Errors::HTTPStatusError => e
|
||||
if e.response.headers["Content-Type"] == "application/json"
|
||||
e.response.body = json_decode(e.response.body)
|
||||
end
|
||||
raise_if_error!(e.request, e.response)
|
||||
end
|
||||
|
||||
|
|
|
@ -12,6 +12,11 @@ module Fog
|
|||
load(data)
|
||||
end
|
||||
|
||||
def get(id)
|
||||
data = service.get_instrumentation(id).body
|
||||
new(data)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
0
lib/fog/joyent/requests/analytics/get_instrumentation.rb
Normal file
0
lib/fog/joyent/requests/analytics/get_instrumentation.rb
Normal file
Loading…
Reference in a new issue