Class: Cuboid::OptionGroups::RPC
- Inherits:
-
Cuboid::OptionGroup
- Object
- Cuboid::OptionGroup
- Cuboid::OptionGroups::RPC
- Defined in:
- lib/cuboid/option_groups/rpc.rb
Overview
Holds Engine::RPC::Client and Engine::RPC::Server options.
Instance Attribute Summary collapse
-
#client_max_retries ⇒ Integer
Maximum retries for failed RPC calls.
-
#client_ssl_certificate ⇒ String
Path to client SSL certificate in PEM format.
-
#client_ssl_private_key ⇒ String
Path to a client SSL private key in PEM format.
-
#connection_pool_size ⇒ Integer
Amount of concurrently open connections for each RPC client.
-
#server_address ⇒ String
Hostname or IP address for the RPC server.
-
#server_external_address ⇒ String
External (hostname or IP) address for the RPC server to advertise.
-
#server_port ⇒ Integer
RPC server port.
-
#server_socket ⇒ String
Path to the UNIX socket to use for RPC communication.
-
#server_ssl_certificate ⇒ String
Path to server SSL certificate in PEM format.
-
#server_ssl_private_key ⇒ String
Path to a server SSL private key in PEM format.
-
#ssl_ca ⇒ String
Path to an SSL certificate authority file in PEM format.
Instance Method Summary collapse
Methods inherited from Cuboid::OptionGroup
#==, attr_accessor, attributes, #attributes, defaults, #defaults, #hash, inherited, #initialize, #merge, set_defaults, #to_h, #to_hash, #to_rpc_data, #update, #validate
Constructor Details
This class inherits a constructor from Cuboid::OptionGroup
Instance Attribute Details
#client_max_retries ⇒ Integer
Returns Maximum retries for failed RPC calls.
65 66 67 |
# File 'lib/cuboid/option_groups/rpc.rb', line 65 def client_max_retries @client_max_retries end |
#client_ssl_certificate ⇒ String
Returns Path to client SSL certificate in PEM format.
59 60 61 |
# File 'lib/cuboid/option_groups/rpc.rb', line 59 def client_ssl_certificate @client_ssl_certificate end |
#client_ssl_private_key ⇒ String
Returns Path to a client SSL private key in PEM format.
53 54 55 |
# File 'lib/cuboid/option_groups/rpc.rb', line 53 def client_ssl_private_key @client_ssl_private_key end |
#connection_pool_size ⇒ Integer
This should be permanently set to ‘1`, otherwise it will cause issues with the scheduling of the workload distribution of multi-Instance scans.
Returns Amount of concurrently open connections for each RPC client.
74 75 76 |
# File 'lib/cuboid/option_groups/rpc.rb', line 74 def connection_pool_size @connection_pool_size end |
#server_address ⇒ String
Returns Hostname or IP address for the RPC server.
18 19 20 |
# File 'lib/cuboid/option_groups/rpc.rb', line 18 def server_address @server_address end |
#server_external_address ⇒ String
Returns External (hostname or IP) address for the RPC server to advertise.
22 23 24 |
# File 'lib/cuboid/option_groups/rpc.rb', line 22 def server_external_address @server_external_address end |
#server_port ⇒ Integer
Returns RPC server port.
28 29 30 |
# File 'lib/cuboid/option_groups/rpc.rb', line 28 def server_port @server_port end |
#server_socket ⇒ String
Returns Path to the UNIX socket to use for RPC communication.
12 13 14 |
# File 'lib/cuboid/option_groups/rpc.rb', line 12 def server_socket @server_socket end |
#server_ssl_certificate ⇒ String
Returns Path to server SSL certificate in PEM format.
47 48 49 |
# File 'lib/cuboid/option_groups/rpc.rb', line 47 def server_ssl_certificate @server_ssl_certificate end |
#server_ssl_private_key ⇒ String
Returns Path to a server SSL private key in PEM format.
41 42 43 |
# File 'lib/cuboid/option_groups/rpc.rb', line 41 def server_ssl_private_key @server_ssl_private_key end |
#ssl_ca ⇒ String
Returns Path to an SSL certificate authority file in PEM format.
35 36 37 |
# File 'lib/cuboid/option_groups/rpc.rb', line 35 def ssl_ca @ssl_ca end |
Instance Method Details
#to_client_options ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'lib/cuboid/option_groups/rpc.rb', line 86 def { connection_pool_size: connection_pool_size, max_retries: client_max_retries, ssl_ca: ssl_ca, ssl_pkey: client_ssl_private_key, ssl_cert: client_ssl_certificate } end |
#to_server_options ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/cuboid/option_groups/rpc.rb', line 96 def { host: server_address, external_address: server_external_address, port: server_port, socket: server_socket, ssl_ca: ssl_ca, ssl_pkey: server_ssl_private_key, ssl_cert: server_ssl_certificate } end |
#url ⇒ Object
82 83 84 |
# File 'lib/cuboid/option_groups/rpc.rb', line 82 def url "#{server_address}:#{server_port}" end |