Class: Datadog::CI::Transport::Api::Agentless

Inherits:
Base
  • Object
show all
Defined in:
lib/datadog/ci/transport/api/agentless.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#headers_with_default

Constructor Details

#initialize(api_key:, citestcycle_url:, api_url:, citestcov_url:) ⇒ Agentless

Returns a new instance of Agentless.



13
14
15
16
17
18
# File 'lib/datadog/ci/transport/api/agentless.rb', line 13

def initialize(api_key:, citestcycle_url:, api_url:, citestcov_url:)
  @api_key = api_key
  @citestcycle_http = build_http_client(citestcycle_url, compress: true)
  @api_http = build_http_client(api_url, compress: false)
  @citestcov_http = build_http_client(citestcov_url, compress: true)
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



11
12
13
# File 'lib/datadog/ci/transport/api/agentless.rb', line 11

def api_key
  @api_key
end

Instance Method Details

#api_request(path:, payload:, headers: {}, verb: "post") ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/datadog/ci/transport/api/agentless.rb', line 26

def api_request(path:, payload:, headers: {}, verb: "post")
  super

  perform_request(
    @api_http,
    path: path,
    payload: payload,
    headers: headers,
    verb: verb,
    accept_compressed_response: true
  )
end

#citestcov_request(path:, payload:, headers: {}, verb: "post") ⇒ Object



39
40
41
42
43
# File 'lib/datadog/ci/transport/api/agentless.rb', line 39

def citestcov_request(path:, payload:, headers: {}, verb: "post")
  super

  perform_request(@citestcov_http, path: path, payload: @citestcov_payload, headers: headers, verb: verb)
end

#citestcycle_request(path:, payload:, headers: {}, verb: "post") ⇒ Object



20
21
22
23
24
# File 'lib/datadog/ci/transport/api/agentless.rb', line 20

def citestcycle_request(path:, payload:, headers: {}, verb: "post")
  super

  perform_request(@citestcycle_http, path: path, payload: payload, headers: headers, verb: verb)
end