Class: Prof::Environment::PcfDrinks

Inherits:
Object
  • Object
show all
Defined in:
lib/prof/environment/pcf_drinks.rb

Instance Method Summary collapse

Constructor Details

#initialize(tempest_config) ⇒ PcfDrinks

Returns a new instance of PcfDrinks.



25
26
27
# File 'lib/prof/environment/pcf_drinks.rb', line 25

def initialize(tempest_config)
  @tempest_config = tempest_config
end

Instance Method Details

#bosh_directorObject



45
46
47
48
49
50
51
# File 'lib/prof/environment/pcf_drinks.rb', line 45

def bosh_director
  @bosh_director ||= Hula::BoshDirector.new(
    target_url:  bosh_director_url,
    username:    bosh_credentials.fetch('identity'),
    password:    bosh_credentials.fetch('password')
  )
end

#cloud_foundryObject



33
34
35
36
37
38
39
# File 'lib/prof/environment/pcf_drinks.rb', line 33

def cloud_foundry
  @cloud_foundry ||= Prof::CloudFoundry.new(
    domain:   cloud_foundry_domain,
    username: ops_manager.cf_admin_credentials.username,
    password: ops_manager.cf_admin_credentials.password
  )
end

#cloud_foundry_domainObject



41
42
43
# File 'lib/prof/environment/pcf_drinks.rb', line 41

def cloud_foundry_domain
  tempest_config.fetch('cloudfoundry').fetch('domain')
end

#cloud_foundry_uaaObject



62
63
64
65
66
67
68
# File 'lib/prof/environment/pcf_drinks.rb', line 62

def cloud_foundry_uaa
  @cloud_foundry_uaa ||= UAAClient.new(
    cloud_foundry_domain,
    cloud_controller_client_credentials.identity,
    cloud_controller_client_credentials.password
  )
end

#ops_managerObject



29
30
31
# File 'lib/prof/environment/pcf_drinks.rb', line 29

def ops_manager
  @ops_manager ||= OpsManager.new(environment_name: ENV.fetch('TEMPEST_ENVIRONMENT'), version: ENV.fetch('OM_VERSION'))
end

#ssh_gatewayObject



53
54
55
56
57
58
59
60
# File 'lib/prof/environment/pcf_drinks.rb', line 53

def ssh_gateway
  SshGateway.new(
    gateway_host:     ssh_gateway_config.fetch('host'),
    gateway_username: ssh_gateway_config.fetch('username'),
    gateway_password: ssh_gateway_config['password'],
    ssh_key:          ssh_gateway_config['ssh_key']
  )
end