lib/fog/rackspace/monitoring.rb in fog-maestrodev-1.15.0.20130927082724 vs lib/fog/rackspace/monitoring.rb in fog-maestrodev-1.18.0.20131111203459

- old
+ new

@@ -11,14 +11,30 @@ include Fog::Rackspace::Errors class IdentifierTaken < Fog::Errors::Error; end class ServiceError < Fog::Rackspace::Errors::ServiceError; end class InternalServerError < Fog::Rackspace::Errors::InternalServerError; end - class BadRequest < Fog::Rackspace::Errors::BadRequest; end class Conflict < Fog::Rackspace::Errors::Conflict; end class ServiceUnavailable < Fog::Rackspace::Errors::ServiceUnavailable; end + + class BadRequest < Fog::Rackspace::Errors::BadRequest + attr_reader :validation_errors + + def self.slurp(error, service=nil) + new_error = super(error) + if new_error.response_data && new_error.response_data['details'] + new_error.instance_variable_set(:@validation_errors, new_error.response_data['details']) + end + + status_code = error.response ? error.response.status : nil + new_error.instance_variable_set(:@status_code, status_code) + new_error.set_transaction_id(error, service) + new_error + end + end + requires :rackspace_api_key, :rackspace_username recognizes :rackspace_auth_url recognizes :persistent recognizes :rackspace_monitoring_url recognizes :rackspace_region @@ -79,9 +95,12 @@ request :delete_check request :delete_entity request :delete_notification request :evaluate_alarm_example + + request :list_monitoring_zones + request :get_monitoring_zone class Mock < Fog::Rackspace::Service def initialize(options={})