Class: DimensionShell::CloudControl

Inherits:
Object
  • Object
show all
Defined in:
lib/dimension_shell/cloud_control.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ CloudControl

Returns a new instance of CloudControl.



7
8
9
10
11
12
# File 'lib/dimension_shell/cloud_control.rb', line 7

def initialize(args)
  @region = args[:region]
  @organization = args[:organization]
  @username = args[:username]
  @password = args[:password]
end

Instance Method Details

#get_server(servername) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/dimension_shell/cloud_control.rb', line 14

def get_server(servername)
  response = _invoke_get path: 'server/server', query: { name: servername }
  if response.ok? then
    JSON.parse(response.body)
  else
    { reason: "#{response.status.to_s} - #{response.reason.to_s}" }
  end
end