diff --git a/lib/fog/joyent/analytics.rb b/lib/fog/joyent/analytics.rb index 3ac2834b6..1ec771e69 100644 --- a/lib/fog/joyent/analytics.rb +++ b/lib/fog/joyent/analytics.rb @@ -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 diff --git a/lib/fog/joyent/compute.rb b/lib/fog/joyent/compute.rb index 212553e9a..1dd062c1b 100644 --- a/lib/fog/joyent/compute.rb +++ b/lib/fog/joyent/compute.rb @@ -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 diff --git a/lib/fog/joyent/models/analytics/instrumentations.rb b/lib/fog/joyent/models/analytics/instrumentations.rb index b0b2d2a6b..429cba0b1 100644 --- a/lib/fog/joyent/models/analytics/instrumentations.rb +++ b/lib/fog/joyent/models/analytics/instrumentations.rb @@ -12,6 +12,11 @@ module Fog load(data) end + def get(id) + data = service.get_instrumentation(id).body + new(data) + end + end end end diff --git a/lib/fog/joyent/requests/analytics/create_instrumentation.rb b/lib/fog/joyent/requests/analytics/create_instrumentation.rb new file mode 100644 index 000000000..e69de29bb diff --git a/lib/fog/joyent/requests/analytics/get_instrumentation.rb b/lib/fog/joyent/requests/analytics/get_instrumentation.rb new file mode 100644 index 000000000..e69de29bb