Class: Yao::Resources::VolumeServices

Inherits:
Base
  • Object
show all
Defined in:
lib/yao/resources/volume_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, #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) ⇒ Hash

Parameters:

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

Returns:

  • (Hash)


49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/yao/resources/volume_services.rb', line 49

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) ⇒ Hash

Parameters:

  • host (String)
  • binary (String)

Returns:

  • (Hash)


37
38
39
40
41
42
43
# File 'lib/yao/resources/volume_services.rb', line 37

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

Instance Method Details

#disable(reason = nil) ⇒ Object



29
30
31
# File 'lib/yao/resources/volume_services.rb', line 29

def disable(reason = nil)
  self.class.disable(host, binary, reason)
end

#disabled?Bool

return true if ComputeServices is disabled

Returns:

  • (Bool)


21
22
23
# File 'lib/yao/resources/volume_services.rb', line 21

def disabled?
  status == 'disabled'
end

#enableObject



25
26
27
# File 'lib/yao/resources/volume_services.rb', line 25

def enable
  self.class.enable(host, binary)
end

#enabled?Bool

return true if ComputeServices is enabled

Returns:

  • (Bool)


15
16
17
# File 'lib/yao/resources/volume_services.rb', line 15

def enabled?
  status == 'enabled'
end