Class: ServerInternal

Inherits:
Object
  • Object
show all
Extended by:
RightScale::Api::BaseExtend, RightScale::Api::InternalExtend
Includes:
RightScale::Api::Base, RightScale::Api::Internal, SshHax
Defined in:
lib/rest_connection/rightscale/server_internal.rb

Overview

API 0.1

Constant Summary

Constants included from SshHax

SshHax::SSH_RETRY_COUNT

Instance Attribute Summary

Attributes included from RightScale::Api::Base

#params

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RightScale::Api::BaseExtend

[], create, deny_methods, filters, find, find_all, find_by, find_by_cloud_id, find_by_id, find_by_nickname, find_by_nickname_speed, find_with_filter

Methods included from RightScale::Api::BaseConnection

#connection

Methods included from RightScale::Api::InternalConnection

#connection

Methods included from SshHax

#spot_check, #spot_check_command, #spot_check_command?, #ssh_key_config

Methods included from RightScale::Api::Base

#[], #[]=, #destroy, #initialize, #method_missing, #reload, #rs_id, #save

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightScale::Api::Base

Class Method Details

.resource_plural_nameObject



44
45
46
# File 'lib/rest_connection/rightscale/server_internal.rb', line 44

def self.resource_plural_name
  "servers"
end

.resource_singular_nameObject



48
49
50
# File 'lib/rest_connection/rightscale/server_internal.rb', line 48

def self.resource_singular_name
  "server"
end

Instance Method Details

#resource_plural_nameObject



36
37
38
# File 'lib/rest_connection/rightscale/server_internal.rb', line 36

def resource_plural_name
  "servers"
end

#resource_singular_nameObject



40
41
42
# File 'lib/rest_connection/rightscale/server_internal.rb', line 40

def resource_singular_name
  "server"
end

#set_multi_cloud_image(mci_href) ⇒ Object



62
63
64
65
# File 'lib/rest_connection/rightscale/server_internal.rb', line 62

def set_multi_cloud_image(mci_href)
  t = URI.parse(self.href)
  connection.put(t.path + '/set_multi_cloud_image', :multi_cloud_image_href => mci_href)
end

#startObject



52
53
54
55
# File 'lib/rest_connection/rightscale/server_internal.rb', line 52

def start
  t = URI.parse(self.href)
  return connection.post(t.path + '/start')
end

#stopObject



57
58
59
60
# File 'lib/rest_connection/rightscale/server_internal.rb', line 57

def stop
  t = URI.parse(self.href)
  connection.post(t.path + '/stop')
end