Class: Yao::Resources::ComputeServices
- Defined in:
- lib/yao/resources/compute_services.rb
Instance Attribute Summary
Attributes included from RestfullyAccessible
Class Method Summary collapse
Instance Method Summary collapse
-
#disabled? ⇒ Bool
return true if ComputeServices is disabled.
-
#enabled? ⇒ Bool
return true if ComputeServices is enabled.
Methods inherited from Base
#[], #[]=, #created, friendly_attributes, #id, #initialize, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, #to_hash, #updated
Methods included from RestfullyAccessible
#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #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) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/yao/resources/compute_services.rb', line 30 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) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/yao/resources/compute_services.rb', line 22 def enable(host, binary) params = { "host" => host, "binary" => binary, } put("enable", params) end |
Instance Method Details
#disabled? ⇒ Bool
return true if ComputeServices is disabled
17 18 19 |
# File 'lib/yao/resources/compute_services.rb', line 17 def disabled? status == 'disabled' end |
#enabled? ⇒ Bool
return true if ComputeServices is enabled
11 12 13 |
# File 'lib/yao/resources/compute_services.rb', line 11 def enabled? status == 'enabled' end |