Module: Rox::Core::Environment

Defined in:
lib/rox/core/consts/environment.rb

Class Method Summary collapse

Class Method Details

.analytics_pathObject



47
48
49
# File 'lib/rox/core/consts/environment.rb', line 47

def self.analytics_path
  @analytics_path
end

.api_pathObject



35
36
37
# File 'lib/rox/core/consts/environment.rb', line 35

def self.api_path
  @api_path
end

.cdn_pathObject



31
32
33
# File 'lib/rox/core/consts/environment.rb', line 31

def self.cdn_path
  @cdn_path
end

.notifications_pathObject



51
52
53
# File 'lib/rox/core/consts/environment.rb', line 51

def self.notifications_path
  @notifications_path
end

.reset(rox_options = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rox/core/consts/environment.rb', line 6

def self.reset(rox_options = nil)
  @roxy_internal_path = 'device/request_configuration'
  if !rox_options&.network_configurations_options.nil?
      @cdn_path = rox_options&.network_configurations_options&.get_config_cloud_endpoint
      @api_path = rox_options&.network_configurations_options&.get_config_api_endpoint
      @state_cdn_path = rox_options&.network_configurations_options&.send_state_cloud_endpoint
      @state_api_path = rox_options&.network_configurations_options&.send_state_api_endpoint
      @analytics_path = rox_options&.network_configurations_options&.analytics_endpoint
      @notifications_path = rox_options&.network_configurations_options&.push_notification_endpoint
  else
    case ENV['ROLLOUT_MODE']
    when 'QA'
      setQA
    when 'LOCAL'
      setLOCAL
    else
      setDefault(rox_options)
    end
  end
end

.roxy_internal_pathObject



27
28
29
# File 'lib/rox/core/consts/environment.rb', line 27

def self.roxy_internal_path
  @roxy_internal_path
end

.set_platform(rox_options) ⇒ Object



55
56
57
58
59
60
61
62
63
# File 'lib/rox/core/consts/environment.rb', line 55

def self.set_platform(rox_options)
  @cdn_path = 'https://rox-conf.cloudbees.io'
  @state_cdn_path = 'https://rox-state.cloudbees.io'
  alternative_api_url = rox_options&.self_managed_options&.server_url || 'https://api.cloudbees.io'
  @api_path = "#{alternative_api_url}/device/get_configuration"
  @state_api_path = "#{alternative_api_url}/device/update_state_store"
  @analytics_path = rox_options&.self_managed_options&.analytics_url || 'https://fm-analytics.cloudbees.io'
  @notifications_path = 'https://sdk-notification-service.cloudbees.io/sse'
end

.state_api_pathObject



43
44
45
# File 'lib/rox/core/consts/environment.rb', line 43

def self.state_api_path
  @state_api_path
end

.state_cdn_pathObject



39
40
41
# File 'lib/rox/core/consts/environment.rb', line 39

def self.state_cdn_path
  @state_cdn_path
end