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

Methods inherited from Base

#[], #[]=, #created, friendly_attributes, #id, #initialize, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, #updated

Methods included from RestfullyAccessible

#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #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



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/yao/resources/compute_services.rb', line 18

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



10
11
12
13
14
15
16
# File 'lib/yao/resources/compute_services.rb', line 10

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