Class: Server

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

Class Method Summary collapse

Class Method Details

.ip(auth_code, host, environment, subdomain, type) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/proboscis_cli.rb', line 7

def self.ip(auth_code, host, environment, subdomain, type)
  response = HTTParty.get("#{host}/api/api/hives/#{subdomain}/#{type}", headers: {"X-Authorization" => auth_code})
  if response.code != 200
    puts "Unable to fetch details for domain #{subdomain}"
    exit -1
  end
  hive = JSON::parse(response.body)
  @ipAddress = hive["ip_address"]
end