Exception: Cute::G5K::BadRequest
- Defined in:
- lib/cute/g5k_api.rb
Overview
It wraps the http response 400 that corresponds to a bad request. When using the reserve or deploy methods this could mean: a bad syntax in the request, not valid properties in the request, not enough resources to supply the request, non existing environment, etc.
Example
You can handle this exception and decide what to do with your experiment. In the example below, we iterate over all sites until a site has resources with the property ‘ib20g’ set to ‘YES’.
require 'cute'
g5k = Cute::G5K::API.new()
sites = g5k.site_uids
sites.each do |site|
begin
job = g5k.reserve(:site => site, :resources => "{ib20g='YES'}/nodes=2/core=1",:walltime => '00:30:00', :keys => "~/my_ssh_jobkey" )
rescue Cute::G5K::BadRequest
puts "Resource not available in this site, trying with another one"
end
end
Instance Attribute Summary collapse
-
#inner_code ⇒ Object
Returns the value of attribute inner_code.
-
#inner_message ⇒ Object
Returns the value of attribute inner_message.
-
#inner_title ⇒ Object
Returns the value of attribute inner_title.
-
#inner_url ⇒ Object
Returns the value of attribute inner_url.
Attributes inherited from Error
Method Summary
Methods inherited from Error
Constructor Details
This class inherits a constructor from Cute::G5K::Error
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Cute::G5K::Error
Instance Attribute Details
#inner_code ⇒ Object
Returns the value of attribute inner_code.
66 67 68 |
# File 'lib/cute/g5k_api.rb', line 66 def inner_code @inner_code end |
#inner_message ⇒ Object
Returns the value of attribute inner_message.
66 67 68 |
# File 'lib/cute/g5k_api.rb', line 66 def @inner_message end |
#inner_title ⇒ Object
Returns the value of attribute inner_title.
66 67 68 |
# File 'lib/cute/g5k_api.rb', line 66 def inner_title @inner_title end |
#inner_url ⇒ Object
Returns the value of attribute inner_url.
66 67 68 |
# File 'lib/cute/g5k_api.rb', line 66 def inner_url @inner_url end |