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) ⇒ Director
constructor
A new instance of Director.
Constructor Details
#initialize(options) ⇒ Director
Returns a new instance of Director.
4 5 6 7 8 |
# File 'lib/bosh/monitor/director.rb', line 4 def initialize() @endpoint = ["endpoint"].to_s @user = ["user"].to_s @password = ["password"].to_s end |
Instance Method Details
#get_deployment_vms(name) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bosh/monitor/director.rb', line 23 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
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bosh/monitor/director.rb', line 10 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 |