Class: CloudControl::API::Server

Inherits:
Core
  • Object
show all
Defined in:
lib/cloudcontrol/api/server.rb

Instance Attribute Summary

Attributes inherited from Core

#client

Instance Method Summary collapse

Methods inherited from Core

#endpoint, #get, #get_simple, #initialize, #log, #org_endpoint, #org_id, #perform, #post, #post_simple, #query_params, #request_query_string, #request_simple_body, #request_xml_body, #simple_params, #single, #xml_params

Constructor Details

This class inherits a constructor from CloudControl::API::Core

Instance Method Details

#list(options = {}) ⇒ Object



5
6
7
8
9
# File 'lib/cloudcontrol/api/server.rb', line 5

def list(options = {})
  endpoint "/#{org_id}/server/server"
  query_params options
  get
end

#list_anti_affinity(target_id, options = {}) ⇒ Object



32
33
34
35
# File 'lib/cloudcontrol/api/server.rb', line 32

def list_anti_affinity(target_id, options = {})
  endpoint "/#{org_id}/server/nic"
  get
end

#list_nics(vlan_id, options = {}) ⇒ Object



27
28
29
30
# File 'lib/cloudcontrol/api/server.rb', line 27

def list_nics(vlan_id, options = {})
  endpoint "/#{org_id}/server/nic"
  get
end

#show(server_id, options = {}) ⇒ Object



11
12
13
14
# File 'lib/cloudcontrol/api/server.rb', line 11

def show(server_id, options = {})
  endpoint "/#{org_id}/server/server/#{server_id}"
  get
end

#show_by_id(id, options = {}) ⇒ Object



21
22
23
24
# File 'lib/cloudcontrol/api/server.rb', line 21

def show_by_id(id, options = {})
  options[:id] = id
  single(list(options))
end

#show_by_ip(ip, options = {}) ⇒ Object



37
38
39
40
# File 'lib/cloudcontrol/api/server.rb', line 37

def show_by_ip(ip, options = {})
  options[:private_ip] = ip
  single(list(options))
end

#show_by_name(name, options = {}) ⇒ Object



16
17
18
19
# File 'lib/cloudcontrol/api/server.rb', line 16

def show_by_name(name, options = {})
  options[:name] = name
  single(list(options))
end