Class: Bosh::Monitor::Director
- Inherits:
-
Object
- Object
- Bosh::Monitor::Director
- Defined in:
- lib/bosh/monitor/director.rb
Instance Method Summary collapse
- #get_deployment_vms(name) ⇒ Object
- #get_deployments ⇒ Object
-
#initialize(options, logger) ⇒ Director
constructor
A new instance of Director.
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(, logger) @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_deployments ⇒ Object
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 |