Class: Api::Clients::Cortex

Inherits:
Object
  • Object
show all
Defined in:
lib/api/clients/cortex.rb

Constant Summary collapse

CORTEX_API =
"https://api.cortex.sportradar.ag/api/v1"
GITLAB_URL =
"https://gitlab.sportradar.ag/"
API_KEY =
ENV["CORTEX_API_KEY"]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gitlab_url:) ⇒ Cortex

Public:

  • gitlab_url: gitlab project url



21
22
23
# File 'lib/api/clients/cortex.rb', line 21

def initialize(gitlab_url:)
  @gitlab_url = gitlab_url
end

Instance Attribute Details

#gitlab_urlObject

Returns the value of attribute gitlab_url.



12
13
14
# File 'lib/api/clients/cortex.rb', line 12

def gitlab_url
  @gitlab_url
end

Instance Method Details

#check_serviceObject

Public: check gitlab info in cortex service



36
37
38
39
# File 'lib/api/clients/cortex.rb', line 36

def check_service
  service_has_gitlab_info?
  # post_call post_service_url, post_body
end

#serviceObject

Public: service tag in cortex.yaml



26
27
28
# File 'lib/api/clients/cortex.rb', line 26

def service
  @service ||= config["info"]["x-cortex-tag"]
end

#service_infoObject

Public: read the service info on cortex



31
32
33
# File 'lib/api/clients/cortex.rb', line 31

def service_info
  @service_info ||= get_call(get_service_url)
end