Class: ReceptorController::Client::Configuration
- Inherits:
-
Object
- Object
- ReceptorController::Client::Configuration
- Defined in:
- lib/receptor_controller/client/configuration.rb
Instance Attribute Summary collapse
-
#client_id_header ⇒ Object
x-rh-receptor-controller-client-id header for authentication with receptor controller (replaces x-rh-identity).
-
#connection_status_path ⇒ Object
Path to connection status requests.
-
#controller_host ⇒ Object
Host name of cloud receptor controller.
-
#controller_scheme ⇒ Object
Scheme of cloud receptor controller.
-
#job_path ⇒ Object
Path to sending directive requests.
-
#pre_shared_key ⇒ Object
x-rh-receptor-controller-psk header for authentication with receptor controller (replaces x-rh-identity).
-
#queue_auto_ack ⇒ Object
Kafka message auto-ack (default false).
-
#queue_host ⇒ Object
Kafka host name.
-
#queue_max_bytes ⇒ Object
Kafka topic max bytes received in one response.
-
#queue_persist_ref ⇒ Object
Kafka topic grouping (if nil, all subscribes receives all messages).
-
#queue_port ⇒ Object
Kafka port.
-
#queue_topic ⇒ Object
Kafka topic name for cloud receptor controller’s responses.
-
#response_timeout ⇒ Object
Timeout for how long successful request waits for response.
-
#response_timeout_poll_time ⇒ Object
Interval between timeout checks.
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #connection_status_url ⇒ Object
- #controller_url ⇒ Object
-
#initialize {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
- #job_url ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/receptor_controller/client/configuration.rb', line 37 def initialize @controller_scheme = 'http' @controller_host = 'localhost:9090' @connection_status_path = '/connection/status' @job_path = '/job' @pre_shared_key = nil @client_id_header = 'topological-inventory' @queue_auto_ack = true @queue_host = nil @queue_max_bytes = nil @queue_persist_ref = "receptor-client.#{SecureRandom.uuid}" @queue_port = nil @queue_topic = 'platform.receptor-controller.responses' @response_timeout = 2.minutes @response_timeout_poll_time = 10.seconds # TODO: use Concurrent::TimerTask yield(self) if block_given? end |
Instance Attribute Details
#client_id_header ⇒ Object
x-rh-receptor-controller-client-id header for authentication with receptor controller (replaces x-rh-identity)
10 11 12 |
# File 'lib/receptor_controller/client/configuration.rb', line 10 def client_id_header @client_id_header end |
#connection_status_path ⇒ Object
Path to connection status requests
12 13 14 |
# File 'lib/receptor_controller/client/configuration.rb', line 12 def connection_status_path @connection_status_path end |
#controller_host ⇒ Object
Host name of cloud receptor controller
7 8 9 |
# File 'lib/receptor_controller/client/configuration.rb', line 7 def controller_host @controller_host end |
#controller_scheme ⇒ Object
Scheme of cloud receptor controller
5 6 7 |
# File 'lib/receptor_controller/client/configuration.rb', line 5 def controller_scheme @controller_scheme end |
#job_path ⇒ Object
Path to sending directive requests
14 15 16 |
# File 'lib/receptor_controller/client/configuration.rb', line 14 def job_path @job_path end |
#pre_shared_key ⇒ Object
x-rh-receptor-controller-psk header for authentication with receptor controller (replaces x-rh-identity)
17 18 19 |
# File 'lib/receptor_controller/client/configuration.rb', line 17 def pre_shared_key @pre_shared_key end |
#queue_auto_ack ⇒ Object
Kafka message auto-ack (default false)
20 21 22 |
# File 'lib/receptor_controller/client/configuration.rb', line 20 def queue_auto_ack @queue_auto_ack end |
#queue_host ⇒ Object
Kafka host name
22 23 24 |
# File 'lib/receptor_controller/client/configuration.rb', line 22 def queue_host @queue_host end |
#queue_max_bytes ⇒ Object
Kafka topic max bytes received in one response
24 25 26 |
# File 'lib/receptor_controller/client/configuration.rb', line 24 def queue_max_bytes @queue_max_bytes end |
#queue_persist_ref ⇒ Object
Kafka topic grouping (if nil, all subscribes receives all messages)
26 27 28 |
# File 'lib/receptor_controller/client/configuration.rb', line 26 def queue_persist_ref @queue_persist_ref end |
#queue_port ⇒ Object
Kafka port
28 29 30 |
# File 'lib/receptor_controller/client/configuration.rb', line 28 def queue_port @queue_port end |
#queue_topic ⇒ Object
Kafka topic name for cloud receptor controller’s responses
30 31 32 |
# File 'lib/receptor_controller/client/configuration.rb', line 30 def queue_topic @queue_topic end |
#response_timeout ⇒ Object
Timeout for how long successful request waits for response
33 34 35 |
# File 'lib/receptor_controller/client/configuration.rb', line 33 def response_timeout @response_timeout end |
#response_timeout_poll_time ⇒ Object
Interval between timeout checks
35 36 37 |
# File 'lib/receptor_controller/client/configuration.rb', line 35 def response_timeout_poll_time @response_timeout_poll_time end |
Class Method Details
.default ⇒ Object
59 60 61 |
# File 'lib/receptor_controller/client/configuration.rb', line 59 def self.default @@default ||= new end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
63 64 65 |
# File 'lib/receptor_controller/client/configuration.rb', line 63 def configure yield(self) if block_given? end |
#connection_status_url ⇒ Object
81 82 83 |
# File 'lib/receptor_controller/client/configuration.rb', line 81 def connection_status_url File.join(controller_url, connection_status_path) end |
#controller_url ⇒ Object
77 78 79 |
# File 'lib/receptor_controller/client/configuration.rb', line 77 def controller_url "#{controller_scheme}://#{controller_host}".sub(/\/+\z/, '') end |
#job_url ⇒ Object
85 86 87 |
# File 'lib/receptor_controller/client/configuration.rb', line 85 def job_url File.join(controller_url, job_path) end |