Class: Yao::Resources::ComputeServices

Inherits:
Base
  • Object
show all
Defined in:
lib/yao/resources/compute_services.rb

Instance Attribute Summary

Attributes included from RestfullyAccessible

#service

Class Method Summary collapse

Instance Method Summary collapse

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, #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

Parameters:

  • host (String)
  • binary (String)
  • resason (String)

Returns:



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/yao/resources/compute_services.rb', line 40

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

Parameters:

  • host (String)
  • binary (String)

Returns:



28
29
30
31
32
33
34
# File 'lib/yao/resources/compute_services.rb', line 28

def enable(host, binary)
  params = {
    "host" => host,
    "binary" => binary,
  }
  put("enable", params)
end

Instance Method Details

#disabled?Bool

return true if ComputeServices is disabled

Returns:

  • (Bool)


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

Returns:

  • (Bool)


14
15
16
# File 'lib/yao/resources/compute_services.rb', line 14

def enabled?
  status == 'enabled'
end