Class: Bosh::Monitor::Director

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/monitor/director.rb

Instance Method Summary collapse

Constructor Details

#initialize(options, logger) ⇒ Director

Returns a new instance of Director.



4
5
6
7
# File 'lib/bosh/monitor/director.rb', line 4

def initialize(options, logger)
  @options = options
  @logger = logger
end

Instance Method Details

#get_deployment_vms(name) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/bosh/monitor/director.rb', line 22

def get_deployment_vms(name)
  http = perform_request(:get, "/deployments/#{name}/vms")

  body   = http.response
  status = http.response_header.http_status

  if status != '200'
    raise DirectorError, "Cannot get deployment '#{name}' from director at #{http.uri}: #{status} #{body}"
  end

  parse_json(body, Array)
end

#get_deploymentsObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/bosh/monitor/director.rb', line 9

def get_deployments
  http = perform_request(:get, '/deployments')

  body   = http.response
  status = http.response_header.http_status

  if status != '200'
    raise DirectorError, "Cannot get deployments from director at #{http.uri}: #{status} #{body}"
  end

  parse_json(body, Array)
end