Class: Yao::Resources::ComputeServices
- Defined in:
- lib/yao/resources/compute_services.rb
Instance Attribute Summary
Attributes included from RestfullyAccessible
Class Method Summary collapse
- .disable(host, binary, reason = nil) ⇒ Yao::Resources::ComputeServices
- .enable(host, binary) ⇒ Yao::Resources::ComputeServices
Instance Method Summary collapse
-
#delete ⇒ Object
[].
-
#disabled? ⇒ Bool
return true if ComputeServices is disabled.
-
#enabled? ⇒ Bool
return true if ComputeServices is enabled.
Methods inherited from Base
#[], #[]=, add_instantiation_name_list, #destroy, friendly_attributes, #id, #initialize, instantiation?, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, map_attributes_to_time, #to_hash, #update
Methods included from RestfullyAccessible
#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #find_next_link, #get, #get!, #list, #resources_path, #resources_path=, #return_single_on_querying, #return_single_on_querying=, #update
Constructor Details
This class inherits a constructor from Yao::Resources::Base
Class Method Details
.disable(host, binary, reason = nil) ⇒ Yao::Resources::ComputeServices
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/yao/resources/compute_services.rb', line 45 def disable(host, binary, reason = nil) params = { "host" => host, "binary" => binary, } if reason params["disabled_reason"] = reason put("disable-log-reason", params) else put("disable", params) end end |
.enable(host, binary) ⇒ Yao::Resources::ComputeServices
33 34 35 36 37 38 39 |
# File 'lib/yao/resources/compute_services.rb', line 33 def enable(host, binary) params = { "host" => host, "binary" => binary, } put("enable", params) end |
Instance Method Details
#delete ⇒ Object
Returns [].
25 26 27 |
# File 'lib/yao/resources/compute_services.rb', line 25 def delete self.class.delete(id) end |
#disabled? ⇒ Bool
return true if ComputeServices is disabled
20 21 22 |
# File 'lib/yao/resources/compute_services.rb', line 20 def disabled? status == 'disabled' end |
#enabled? ⇒ Bool
return true if ComputeServices is enabled
14 15 16 |
# File 'lib/yao/resources/compute_services.rb', line 14 def enabled? status == 'enabled' end |